Skip to main content
1-Visitor
January 23, 2018
Question

RUNNING MATHCAD OVER DIFFERENT INPUT VALUE AND EXPORT SEPARATELY

  • January 23, 2018
  • 3 replies
  • 3450 views

Hi everybody,

my question is very simple but, as the same time, a bit complicate.

I would like running a Mathcad sheet over different input values. At the beginning, I solve the problem with equations in vector modus, but I need increase the calculus with several conditionals and complicate equations. Vector modus gives me a lot of problems and the number of table rows will change.

I thought, maybe it will be possible runs equations on each table rows (from 1 to N) and export results to an Excel files. Is it possible?

Another idea was running Mathcad sheet over different input excel files. Output results would be exported and stored to each excel file. ¿?

 

Thanks in advance.

You are great 

3 replies

25-Diamond I
January 23, 2018

Its a long standing feature wish of the Mathcad community to be able to turn a Mathcad shet or a portion of it into a function.

 

On idea which comes to min is to turn every calculated value into a function dependent on all input variables. This can become boring and cumbersome, though.

Every function is written to deal with scalar arguments but can be call (vectorized) with a vector of input values ar argument.

See attached file (Prime 4 format)

 

EDIT: I added a PDF print of the file as well

 

 
 
23-Emerald I
January 23, 2018

Posted example opened in Prime 3.0.  He won't be able to read your Prime 4. . .

25-Diamond I
January 24, 2018

wrote:

Posted example opened in Prime 3.0.  He won't be able to read your Prime 4. . .


Thats bad, but there's nothing that can be done (other than posting a pdf printout, which I eventually will do later).

When working on a machine with Prime 4 installed you don't realize which version an opened file was originally. And even if you could it won't help as P4 cannot save in older formats - stupid PTC 😞

 

1-Visitor
January 23, 2018

With Prime 3.1 & higher, I believe it would be possible to use the API to set the values of your inputs to various values, save each iteration as a separate worksheet (if desired), and get the output values.

The API code could be written as an Excel macro that iterates through several rows of input values in a spreadsheet, and gets the Mathcad output for each.

Unfortunately, I do not currently have time to generate an example.

23-Emerald IV
January 24, 2018

Your problem might be solvable with the method discussed here:

https://community.ptc.com/t5/PTC-Mathcad-Questions/Excel-to-MathCAD-and-Results-Back-to-Excel/m-p/498507#M178171

 

Success!

Luc