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

13-Aquamarine

## solve block/ function

Hello All.

Within my program, there is a solve block that finds some parameters with given guess values. For repeating the calculations, the guess values must be changed according to the new set of inputs.

Is there any way to define a local function that automatically change the guess values and use this local function inside the main body of my program?

the attached file contains the solve block that I need to express as a local function.

1 ACCEPTED SOLUTION

Accepted Solutions
4-Participant
(To:payman)

attached shows a simple way to use the function within a program loop,

Hope it helps

any questions , please let me know

Regards

Andy

4 REPLIES 4
24-Ruby I
(To:payman)

May by so:

f(r1, r2, r3, n0, n1, n2, n3):=Find(...

4-Participant
(To:payman)

You cannot use a solve block within a program. However you may be able to use a 'while loop'.

24-Ruby IV
(To:payman)
 PAYMAN RAJAI wrote:Hello All. Within my program, there is a solve block that finds some parameters with given guess values. For repeating the calculations, the guess values must be changed according to the new set of inputs.Is there any way to define a local function that automatically change the guess values and use this local function inside the main body of my program?the attached file contains the solve block that I need to express as a local function.

Don't use a vector index 0 for n0 unless you really want n0 to be a 1x1 vector.

You have already turned the solve block into a function of r1,r2,r3. Why not simply add n0 to the argument list?

You call n0 a (variable) guess value, but you dont use n0 when you call Find. So n0 is not a variable you want to solve for but, like r1..r3 just a constant.

If you would use n0 additionally in Find you would run into troubles as you would have four variables to solve for but just three equations.

So what is it you really are after?

4-Participant
(To:payman)

attached shows a simple way to use the function within a program loop,

Hope it helps

any questions , please let me know

Regards

Andy

Announcements
Check out the latest