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

parametric solution and TOL

SOLVED
Highlighted

parametric solution and TOL

I am using a parametric solution of a solve block within another solve block. I would like to use a smaller TOL for the parametric solution (i.e. the inner problem) than for the outer block. If I set the TOL before creating the solve block for the parametric solution, does the TOL get set permanently for the parametric solution? Or, will the current value of TOL be used whenever a parametric solve block solution is encountered?

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: parametric solution and TOL

If I set the TOL before creating the solve block for the parametric solution, does the TOL get set permanently for the parametric solution?

Yes, I think that happens.

So you could turn your inner solve block into a function, precede its definition by a lower TOL value and thereafter change TOL to a higher value and then define your outer block. Guess this should work. TOL always has to be set at worksheet level, it cannot be set within a program.

As TOL is always taken as an absolute value (unfortunately), one additional method could be to define the lower value for TOL and modify the equations in the inner solve block so that they work with and return values with lower magnitude, divided by 10^3 for instance. I'm not sure about this method, though.

WE

View solution in original post

8 REPLIES 8
Highlighted

Re: parametric solution and TOL

If I set the TOL before creating the solve block for the parametric solution, does the TOL get set permanently for the parametric solution?

Yes, I think that happens.

So you could turn your inner solve block into a function, precede its definition by a lower TOL value and thereafter change TOL to a higher value and then define your outer block. Guess this should work. TOL always has to be set at worksheet level, it cannot be set within a program.

As TOL is always taken as an absolute value (unfortunately), one additional method could be to define the lower value for TOL and modify the equations in the inner solve block so that they work with and return values with lower magnitude, divided by 10^3 for instance. I'm not sure about this method, though.

WE

View solution in original post

Highlighted

Re: parametric solution and TOL

Werner Exinger wrote:

As TOL is always taken as an absolute value (unfortunately), one additional method could be to define the lower value for TOL and modify the equations in the inner solve block so that they work with and return values with lower magnitude, divided by 10^3 for instance. I'm not sure about this method, though.

I am already trying the method above, but I think you meant to say the following:

...define the higher value for TOL and modify the equations in the inner solve block...and return values with higher magnitude, divided by 10^-3...

This magnifies errors. So if TOL = 0.001, the effective TOL is 10^-6 for the inner block.

I guess I'll have to do some tests and compare results to see if the TOL gets "attached" to the parametric solution. It would be my preferred option if it works.

Highlighted

Re: parametric solution and TOL

I am already trying the method above, but I think you meant to say the following:

...define the higher value for TOL and modify the equations in the inner solve block...and return values with higher magnitude, divided by 10^-3...

Yes, sorry - thats what I meant.

Highlighted

Re: parametric solution and TOL

You can use normalization factors for each equation!

Highlighted

Re: parametric solution and TOL

It only gets more interesting. I was trying to test the TOL permanency and I find that when I set TOL in the worksheet with TOL:= , it does not appear to change in the system variables. As the figure shows, I have set TOL = 10^-5, but the TOOLS window shows 10^-4. Could it be that the TOL variable expects a certain font, because I am using a template that may have a different font for the variables?TOL_error.png

Highlighted

Re: parametric solution and TOL

You can look at the value set in the options dialog box as if its an (invisible) assignment (a normal one, not a global) right at the top of your worksheet. As with any other variable, this definition can be overwritten in the midst of the sheet but this does not change the definition at the top and so does not change the value in the options menu.

You see 10^-4 in the menu and this is the valid value of TOL in your sheet up to the line where you define the new value 10^-5. You can't change the intitial default value in the options menu from within the sheet. But if you want to be sure that a specific value is valid from the very beginning and don't want to bother with the menu, you could either place a normal assignment to the very top of the sheet yourself or use a global assignment anywhere els in your sheet. You can override a global assignment anywhere in your sheet by a normal or another global assignment. If you use multiple global assignments then the last one is the one which is valid at the top of the sheet.

In other words, no, no special font necessary to change system variables. They behave exactly the same as normal variables. The only difference ist that they are invisibly defined at the very top.

WE

Highlighted

Re: parametric solution and TOL

Thanks for the explanation Werner. I didn't realize that the window only shows the initial values for the sheet. Back to my test.

Highlighted

Re: parametric solution and TOL

I have run the tests and the parametric solution does retain the value of CTOL (and I presume TOL) that was active at the time the solve block was computed. It turns out that my solve block is only affected by CTOL.

Announcements