wswain

200 Reputation

7 Badges

12 years, 133 days

MaplePrimes Activity


These are replies submitted by wswain

@Carl Love   I hope OP notices the DataFrame answer!

Bill

@Carl Love 

wasn't sure the OP literally meant the values (vars) in the matrix were same as indices wanting to be alphabetical.  

OP goals seem a little missing with this slight conundrum as posted.

R's,
Bill

@Thomas Richard 

 

I was able to process the tutorial Pick and Place in v2021.2 version.  I had not needed the MapleSim functionality until just recently based on work/life demands.  I am now back onto MapleSim and upgraded to v2022.2 prior to running the MapleSim tutorial for importCad toolbox so cannot answer if it worked in v2022.1.  I still need to debug the issue.

I however found in my v2021.2 version that the coordinate (B) from the tutorial is showing correct in the location during creation (flange of "top_slide"), but becomes located at the center_of_mass in the "accept and return" post review of the model.  Has anyone else seen this behaviour?

Per the tutorial, item "i. A Rigid Body Frame connecting B to the CoM of top slide." is incorrect.  Selecting the port B shows the coordinate Triad at the CoM location in 3d workspace vs the flange center.   I note the Z dimension in the R vector (of RBF) for port B properties to be incorrect, but I cannot manually change.   This causes an incorrect connection of the two parts.






The CAD Tool's (double click from workspace on "top_slide") measurement tool works and provides the correct dimension to the B coordinate which is what I was trying to enter manually. The Triad is in the correct place.   Again, when Cad Tool is closed the triad and Z dimension are in wrong location.  Can this be changed or corrected manually?

Any assistance greatly appreciated.
Bill    

@tomleslie 

Thanks Tom,

   You hit the mnail on the head of concerns.  My intuition is to put as much local scpe of what is needed without referencing higher scope, esp. globals unless necessary.

   This is probably a lingering concern from my early days of straight coding.  Making sure parameters outside a procedure and function have some serious consequences if not managed well (IMHO).  I use globals for static items like "universal gas constant" but always concerned of how they get passed into a procedure or function and made avialable within the local scope.

    I'm probably showing the limited programming capability for large efforts, but I get buy and am growing unique functions (procs) based on our specific engineering goals.

Your info is greatly appreciated.

Bill  

@acer 

This is very helpful.  Just to close any other thoughts, if the with command is invoked at the worksheet level AND the uses command is implemented withing the proc of the same package - is there any problems?

Thanks,
Bill

@acer 

As always.  Thank you.

I had updated the code to initiate the variable, but was waiting to see the reply before running.

Found a couple "minor" typo's and got the debugger working where I also found a syntax problem, [ ] needed versus () for matrix index, causing the grief.   

Regards,
Bill

@Carl Love 

Thank you for replying and that you use these. 

I used error in my decription for ease of reading.  The variable is actually error_now and compared to error_tol set.

I am not sure why when I tried to change the execution group to Maple Input (with F5 and by the pull down) and it kept responding as in 2-D mode even though it said "maple input" in the bar.

I went ahead and created a code block to ensure 1-D entry and the operator took.

However, I am still getting an error.   (Not pretty code yet) as I'm trying to fix the recursive while loop flow problem and havent applied the vector to run through.  Please find:

Trial := proc() 
    
    local y2, test1, iterations; 
    y2 := Vector(5, fill = 0.); 
    y2[5] := 1; 
    test1 := 1.0; 
    
    while 1e-5 < test1 do
        test1 /= 2.0; 
        ++iterations; 
    end do; 
    
    test1; 
    iterations; 
        
    end proc;

Trial();
Error, (in Trial) recursive operator assignment

It seems like valid code iterative calculations.  Any assitance greatly appreciated.

Bill

@Carl Love 

@tomleslie 

As to what am I trying to accomplish?  I often do not know when I run into MATLAB commands that are unusual like "deal".  I appreciate the response about why it exists as the reply was exactly in the direction I was thinking and you've both helped clarify.

Kind Regards,
Bill

 

@tomleslie 

This is helpful.   I love Maple for its math capabilities.  I struggle with converting the documents into professional reports for delivery to the customer with the embedded math, but hiding the commands such as restart and the set-up like "with(XXX)", or UseUnits, etc.

Bill

@tomleslie 

It looks like the answer still requires the command "convert" which I was trying to avoid as combersome looking for a report, but I'll go for hiding this.  The context menu doesn't seem to allow the same conversion as stipulated via the convert command.

K/R,
Bill

@Joe Riel 

I am struggling as I'm kinda used to the regular debugger of ifort, MS C++, etc. with pretty easy controls of walking through of loops and function levels to finally find - maybe a simple syntax call error.

I'm finally really using Maplesoft in a more coding level and find the stepping through debug a challenge.

I used your example and see how that kicked open the debugger (thumbs up).   The next thing was to assign i:=1 to restart and begin single stepping.  In this simple case the problem identifies pretty quick.  But, I could not iterate one at a time to watch the flow from 1, 2, 3 - boom, which on a much bigger process loop may not be so obvious.

Am I missing something in how to do this?

Thanks,
Bill



 

@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

1 2 3 4 5 Page 1 of 5