wswain

230 Reputation

7 Badges

13 years, 343 days

MaplePrimes Activity


These are replies submitted by wswain

@Joe Riel 

Hi Joe, 

Thanks for your reply.  I'll incorprate the stoperror('all');  ...  somewhere.

The iterative "for loop" resides in a worksheet.

It calls Property() from the thermophysical,coolprop package.

The crash is an error -> 

"Error, (in ThermophysicalData:-CoolProp:-PropsSI) Two-phase inputs not supported for pseudo-pure for now : PropsSI("Z","P",1289238.529,"T",112.1727954,"Air")"

From this error it looks like I've hit the saturated vapor line for the iteration at 112.17K.    This would look correct on a T-s plot for the isentropic process.   

I might have the answer through a different way to do debugging without single stepping up to the error, but do find it frustrating to not be able to stop say 5 iterations before the break-out and then single step through to follow what's happening in code vs. physlcs world.

The value returned from the error "1289238.529" is suspect and I don't recogize this.  The PropsSI call is a subfunction of Property and this call is getting Z, compressibility, but I did not ask for this that I am aware of, so is has to be sub-process.   I did achieve 412 iterations with what looks like physically resonable answers until it "error'ed" out.

I would presume the thermophysical package "property" method/procs are locked would not let single stepping into them, and so would:

"Stoperror('all'); allow to watch the process up to the error?

Any assistance with debugging techniques into Maplesoft packages from a worksheet level call (within "for loop") and tracing the variable through until the error would be very helpful.

Thanks,
Bill

@pik1432 

After my initial rsponse it occured that you're most likely trying to solve psychrometric problems with water vapour (?).   There is a different module in Maple for psychrometrics.  Specifically, if you search help on psychrometrics you'll see examples and how to potentially find the solution you're looking for.

If you're looking at saturated vapour with quality 1.0 or >  then this might be a better place to start as that falls on the pressure temperature line for vaporization and above.

Regards,
Bill

Hello,

I use thermophysical data package all the time.  From what I can see you've asked for Pressure for water in the solid state (233K is < freezing point) with a mass vapor quality of 1.  These two conditions are physically incompatible.  

    PropsSI is only valid for > freezing state.  Hence the error range says must be > 273K.

This link shows the valid range for PropsSI with water (bottom of page table)

http://www.coolprop.org/fluid_properties/Incompressibles.html

Hope this helps,
Bill

@acer 

The main reason I've gone down this path is the units carried through within the Matrix elements don't seem to work well with certain functions such as Statistics:-Mean  hence the unit_free step and checks for reapplying later.   

The goal is to do the math and then preset the results with correct units (i.e. create variable for the combined units as a unit conformity check, strip (unit_free) to allow other packages to work on the matrix then re-apply the correct dimensions.

The final result is getting to an output with units.  (P.S., I know the Mean in this sheet is not a real mean physically for the workseheet at this stage - its a test of the package function and the call to it.

If I'm not approaching this correct, please - all help accepted.  I'd love for the units to carry through without the problems.  I do know some funtions must be unitless.

Regards,
Bill 

@acer 

Please find attached.

I am still trying to work out Matrices with units, dataframes and rTables as final outputs for presentation in a report (i.e., excel looking with Row's column headers.

Please see attached.

Based on the replies, does #mi or #mo (etc.) become MathML when enclosed in the single, left facing quotes instead of a comment via the # symbol?

Regards,
Bill

Aluminum_E_Test_Solution_-_Webpost.mw

@tomleslie 

Thank you Tom for the clear response.

I was trying to avoid the addition of the explicit "convert(%, units, 1/minute);" to get to the units desired.  I most often use the context window to change it to the units desired and let the SW handle all the conversion math.   This ensures to me that a bad conversion factor hasn't been used and I get dimensional checks.  (1/time and Hz vs. rev (cycle) get dimensional hiccups)

The main issue I was having was using " per 'rev' " as circumfrence length per revolution (rev) as units where maplesoft has rev as 2*pi radians and uses an awkward "length(radians)" unit which confuses my dimensional checking head.

I can live with 1/time where 1/"time each rev" = rev speed (not a unit, but a description).

Bill

@mmcdara 

I know that we use A*e^b*t  all the time for time series of growth or -b*t for decay.

I had always assumed the t carried the seconds.   

After posting and doing a bit more digging into the dimensional analysis ALL power exponents must be dimensionless - which makes sense.  you can't exponent time (or other) dimension as an independent variable (or as a single number either).

Therefore, b must carry 1/s to cancle the time dimension.

My recent post was about getting the coeffients and I now have the 'b' to rebuild/recast the solution with units by adding Unit(1/s) to 'b'. 

Still stumped why 'A' returned correct in the eqn form, but not correct in output = parametervalues or parametervector.

Regards,

Bill

@acer 

Understand, thanks.

P.S., You didn't comment on actually doing the nonlinearfit (or exponential fit) with a dimensioned matrix, or vectors.

Is this not possible?

I note your over-complicated statement.  Is there a cleaner way to strip or send dimensioned data into a regression solver (linear or nonlinear)?

Thanks,

@mmcdara 

Thanks, 

I've been working with output = parametervalues and output = parametervector after I posted the original.

I do get a two values.   How can I assign them back to two variables?  I tried (a1,b1):= to assign the two onto the new variables for use.  The error was saying I was trying to assign 2 variables from 1 item (the vector results)

Also, The orginal A_Const and C_Const are not assigned these results.

As additional info/question:

I also used:  ExponentialFit with output = paramatervalues.

The result showed 0.43*e^3.2854....    

the plot showed good agreement to the data - However:

The  output = parametervalues  returned [-0.8384..    3.2854..]

How could these be so different?   i.e, var1  showing as 0.43 is correct,    -0.8384..  is not.  

Thanks in advance,

Bill

@acer

As Always,

Thanks @acer

Couple questions.

I see you use the :- operator independent of a package (i.e. long form) name in front.   What does this do?  :-eval(...)

and backwards quoted =,   '='

P.S., I had problems with Units:-UseSystem(FPS)   back in Maple 2016.   I have not tried to re-use lately but was considering as a low priority change-over.  Looks like this can be part of my standard setup when using FPS

Bill

@rlopez 

Hi Robert,

 

   I recently posted a similar call (in fact I think identical except theta instead of t for the animate range variable) and had an interesting error on the range.   That was solved by forcing an evalf on the realcons Pi/2, (using the Greek Pi tablet click). 
 

  I am now interested in the vectorCaculus form.   My main interest is to visualize a vector's transformation as it applies to robotic frames and transformations.  Watching in 3D a rotation is really key than seeing a start and finished view on how the transforms work and then the math for 'exp' and Log of velocity transforms, screw, transpose, twist, wrench, etc.
 

  At the moment I am trying to see a two rotation sequence in animate where two rotation matrices are applied to the starting vector, [P].   Using simple matrix multiplication of the rotations matrices inside the arrow function for "what I think is the operation's output" of a two column vector of position for the animation - But, did not achieve the final expected position.

 

  I am wondering now if the order of operations is the problem and the frame-by-frame vector is not completing properly.
 

P.S., love discovering these tidbits, but often wonder the challenges of finding these when debugging problematic outputs.  The matrix math for frame transformations is a challenge in and of itself and I am pre-planning a proc() for the 4x4 and other transforms (skew-symmetric).  Hoping Maple has this already in a package that I've yet to discover.

 

All thoughts welcome.

 

Bill

@acer 

 

I agree with @acer that the 0 = 0..Pi/2   showed the assignment earlier to test static.

When I commented the Theta := 0 out the error still persisted.   When I typed evalf(Pi/2) it worked.

I did re-rerun with 1.) an unassign in variables tab - same error; 2.) commenting out the initial assignment-same error; and lastly 3.) incorporated the evalf(Pi/2) - worked.

 

I do appreciate the difference in the Upper Pi vs lower pi.    In most intances I started with the greek panel usage of theta and Pi. I don't often type Pi or pi, but recognize the difference.

All said, just for final thought - 4.) I took evalf(Pi/2) and removed it to force the numeric with Pi/2.0 (hint by Earl of what needed to be there) and just hit run with Pi/2 and it DID NOT Error out.

I suspect a persitence existed or maybe a typo for the pi?  I am not sure now.

It is working and I am now getting good results moving into 3D vector animated rotations.

Thank you both.  Just wanted to document for future users that may have similar problems.

 

@wswain 

@acer  @Earl

 

I just used the evalf(pi/2) and the animation sequence works.

Not sure why Acer comment didn't resolve, but Earl's evalf did work.

 

Thanks to both for the assist.

Bill

 

@acer 

 

Is 0 an appropriate cos or sin value?

 

I trialed the static version using theta = 0 and got the first frame's presentation correct by function.

I unassigned in the variable list the theta = 0 assignment.   I also just commented this assignment out with # symbol and re-ran but get same error.

@Carl Love 

 

thank you both @acer for your replies.  Very clear and helpful with improving capability and usage of Maple.

 

 Regards,

Bill

1 2 3 4 5 Page 2 of 5