Skip to main content
1-Visitor
October 23, 2015
Solved

"Find" Solve Block - How to change the guess values for a solve block

  • October 23, 2015
  • 8 replies
  • 3997 views

I use "Find" in a Solve Block in order to solve a system of non linear equations. I would like to change in auto-mode the guess values in order to solve the system for different values of the model parameters. How could I change the solution guess values for the solutions? Is for instance possible to include a solve block in the for loop of a code? Could you suggest a possible method?

Best answer by AlanStevens

This illustrates how to use the function argument to supply a guess value:

root.PNG

Alan

8 replies

23-Emerald V
October 23, 2015

Massimiliano Nori wrote:

I use "Find" in a Solve Block in order to solve a system of non linear equations. I would like to change in auto-mode the guess values in order to solve the system for different values of the model parameters. How could I change the solution guess values for the solutions? Is for instance possible to include a solve block in the for loop of a code? Could you suggest a possible method?

Yes, it is possible to change the parameters from within a loop.  To do this, you need to make a function from the Find.

Let's say that you have a parameter a that you wish to alter on each call to the solve block and you want to find a variable x.  Instead of result:=Find(x) you would type f(a):Find(x) and then assign the results as you would any other function result, eg result:=f(2) (where 2 is a particular value of a).

Look up Solve blocks and parameters in Help.

Stuart

mnori1-VisitorAuthor
1-Visitor
October 23, 2015

Hi Stuart,

thank you for your answer. I knew about the possibility to recall the function for different values of the parameter as you shown. My question is about the guess value for the solution. To my understanding , the solve block guess ( or initial ) values for the solution.are defined only before the solve block.

19-Tanzanite
October 23, 2015

This illustrates how to use the function argument to supply a guess value:

root.PNG

Alan