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
Solved! Go to Solution.
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
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:
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
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
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.
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
Sorry, I didn't realized that the attached file is empry. Here is the modified file.
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
Thank you very much.