Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
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.
thank you in advance.
Solved! Go to Solution.
attached shows a simple way to use the function within a program loop,
Hope it helps
any questions , please let me know
Regards
Andy
May by so:
f(r1, r2, r3, n0, n1, n2, n3):=Find(...
You cannot use a solve block within a program. However you may be able to use a 'while loop'.
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?
attached shows a simple way to use the function within a program loop,
Hope it helps
any questions , please let me know
Regards
Andy