Skip to main content
3-Newcomer
December 14, 2024
Solved

Automate MathCAD Prime 8 Iterations

  • December 14, 2024
  • 1 reply
  • 1141 views

I have an iteration in a calculation that requires I select “Calculate” repeatedly until two numbers are relatively equal. Is there a way to automate this iteration so that I only need to select “Calculate” once?

Best answer by StuartBruff

@LP_12590548 wrote:
I’m unable to share my worksheet. Any chance you can provide generic instructions?

Can you at least provide an example?  For example, a screenshot, a photograph, pdf, sketch or text of the equations?

 

There are a multiplicity of methods of solving iterative problems within Mathcad.  Which one is best (for values of best) depends upon the nature of your problem.  Indeed, there may well be non-iterative solutions to your problem.   Here's a starter ...

 

2024 12 14 B.png

 

2024 12 14 C.png

 

2024 12 14 D.png

 

Of course, it could well be that none of these methods suits your problem.  If no methods are suitable within Mathcad Prime itself, it might be possible to use JScript within an Advanced Control or some external program that calls the Mathcad Prime API (there are plenty of examples within the Mathcad Prime Help; search for Automation or API).

 

Stuart

 

Sorry, I don't have my Mathcad Prime 8 laptop to hand at the moment, so the attached worksheet is in Mathcad Prime 10 format.

1 reply

23-Emerald V
December 14, 2024

@LP_12590548 wrote:

I have an iteration in a calculation that requires I select “Calculate” repeatedly until two numbers are relatively equal. Is there a way to automate this iteration so that I only need to select “Calculate” once?


Very likely. Please post a worksheet with your calculation. 

Stuart

3-Newcomer
December 14, 2024
I’m unable to share my worksheet. Any chance you can provide generic instructions?
23-Emerald V
December 14, 2024

@LP_12590548 wrote:
I’m unable to share my worksheet. Any chance you can provide generic instructions?

Can you at least provide an example?  For example, a screenshot, a photograph, pdf, sketch or text of the equations?

 

There are a multiplicity of methods of solving iterative problems within Mathcad.  Which one is best (for values of best) depends upon the nature of your problem.  Indeed, there may well be non-iterative solutions to your problem.   Here's a starter ...

 

2024 12 14 B.png

 

2024 12 14 C.png

 

2024 12 14 D.png

 

Of course, it could well be that none of these methods suits your problem.  If no methods are suitable within Mathcad Prime itself, it might be possible to use JScript within an Advanced Control or some external program that calls the Mathcad Prime API (there are plenty of examples within the Mathcad Prime Help; search for Automation or API).

 

Stuart

 

Sorry, I don't have my Mathcad Prime 8 laptop to hand at the moment, so the attached worksheet is in Mathcad Prime 10 format.