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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Return value of ERR from a parameterized solve block

JohnBriant
1-Newbie

Return value of ERR from a parameterized solve block

Anyone know how to read both the variable values (i.e. the solution) and the ERR variable generated by a parameterized solve block, short of solving the solve block twice?

Example sheet shows how you can either get the solution by calling the function <solution(parameters)=>, or the ERR variable, by calling <ERR(parameters)=>. Simply typing <ERR=> does you no good because ERR is a function.

This involves solving the equations twice, which isn't a problem until you want to run a monte carlo simulation with many data points.

Thanks,

John

4 REPLIES 4

Since ERR is just the sum of squared deviations, one way might be to calculate it explicitly within the solve block; then you'll get a distribution of errors along with your distribution of x's and y's.

Alan

Hi Alan,

Thanks for the reply, which does work. It doesn't quite address my problem because I don't think it saves any time in a long monte carlo simulation because there is still alot of computation- it is set up to calculate the err once for every iteration of the solver and also adding an extra variable is likely to mean more iterations.

However, the calculation of err can be carried out after the solve block using the solver solution for x and y. This way should save a pile of computation.

Thanks again, I will perhaps do all my solve blocks this way in future.

John

John Briant wrote:

...

However, the calculation of err can be carried out after the solve block using the solver solution for x and y. ...

Yes - a much more efficient way of doing it.

Alan

Thanks - very interesting work with a solve block!

If you have an interest you can see me work with solve block - Solving of algebraic equations and system or Vincent Van Gogh in Mathcad

Top Tags