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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Solving in a loop ??

ptc-2665983
1-Newbie

Solving in a loop ??

Hello Everybody, Please have a look at the file in attachment. For privacy reasons, that's not the file I am having problems with. But this simplified file explains quite well this issue. I want to use the solving functions of Mathcad into any kind of loop. And I cannot manage to do so. (see test2 calculation in my file) I think that is simply impossible for Mathcad. Am I right ? In the attached file, I use 2 different workarounds but in my real file I cannot use them: Well, in my real file I have used the Maximize function. Whose result is then used again by another solving function (Find). That means I have to solving functions imbricated, and that works. But then, I need to use these calculations in a while loop... And I really do not know how to do so in Mathcad... Thanks in advance for your help
2 REPLIES 2

You are correct that you cannot use given/find in a program structure. The solve block is a special construct that exists only at the worksheet level. But your file shows the correct procedure, defining a function based on the solve block and then using that function in a program structure. I do not know why you are not able to do that with your real problem. If you look in the collaboratory there are lots of examples of parameterized solve blocks, including some with solve blocks including functions defined by other solve blocks. Other than possible performance problems (as with iterated integrals) it works fine.
RichardJ
19-Tanzanite
(To:TomGutman)

What you want to do is possible, but it's certainly not obvious how to do it. Parameterizing solve blocks in Mathcad is inconsistent, with different solve block types having different rules and quirks. I think the attached file shows you how to do what you want. Richard
Top Tags