cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

manage the outputs

payman
13-Aquamarine

manage the outputs

Hello,

In the attached file, the function p4(d,y1) calculates for a large set of parameters. Unfortunately, my Mathcad version does not support WRITEEXCEL routine to export and store the results. Currently I have to wait for a long time and if something intrrupt the calculation, I lose all the calculated data.

Could you please suggest a better way to handle the outputs? I also appreciate it if you make some advices to speet up the calculation time.

 

All the best,

Payman

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:payman)

I get various errors, a few of which I corrected (index j is undefined).

But I put in the statement where I think they belong:

Write the matrix header with WRITEPRN before calling the p4 function, and (assuming your row-vector m would produce an individual result) I augmented that, transposed, to the set of N-values for APPENDPRN output each time inside the loop.

Success!
Luc

 

View solution in original post

7 REPLIES 7
LucMeekes
23-Emerald III
(To:payman)

You can write successive (Calculation input/output) row data to a matrix using WRITEPRN and APPENDPRN, and read it back using READPRN.

Here's a simple example:

managingOutputs.png

So in between the WRITEPRN and each of the APPENDPRN you can do whatever calculations as you like/need.

Be sure to keep the same row-size (the result wants to be a matrix), and where necessary omit units (only a single unit per matrix is allowed).

 

Success!
Luc

 

 

payman
13-Aquamarine
(To:LucMeekes)

Thank you Luc,

can you show me how I can incorporate the commands into the function p4(d,y1)?

Does it save the comptutation time if I first create and save all the test models into a .prn file and then recall the file into p4(d,y1) for final computation?

 

Regards

Payman

 

 

Fred_Kohlhepp
23-Emerald I
(To:payman)

It's apparent that you're used to programming; you are writing programs in Mathcad's interpreted programming language. 

Mathcad has been optimized to work on vectors or arrays of numbers.  If you can write your expressions out as functions of numbers, then operate on entire vectors things may go much faster. 

LucMeekes
23-Emerald III
(To:payman)

Your attachment appears empty. I can't get anything out.

Please use ordinary zip (not 7-zip), e.g. using the right-mouse click on the Mathcad file, then choose "Send to" => "Compressed (zipped) folder" from the context menu.

 

Success!
Luc

payman
13-Aquamarine
(To:LucMeekes)

Sorry, I didn't realized that the attached file is empry. Here is the modified file.

LucMeekes
23-Emerald III
(To:payman)

I get various errors, a few of which I corrected (index j is undefined).

But I put in the statement where I think they belong:

Write the matrix header with WRITEPRN before calling the p4 function, and (assuming your row-vector m would produce an individual result) I augmented that, transposed, to the set of N-values for APPENDPRN output each time inside the loop.

Success!
Luc

 

payman
13-Aquamarine
(To:LucMeekes)

Thank you very much.

Top Tags