Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Re: parametric solution and TOL

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-01-2015
06:41 PM

09-01-2015
06:41 PM

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?

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-02-2015
04:40 AM

09-02-2015
04:40 AM

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

8 REPLIES 8

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-02-2015
04:40 AM

09-02-2015
04:40 AM

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-02-2015
10:27 AM

09-02-2015
10:27 AM

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
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-02-2015
01:00 PM

09-02-2015
01:00 PM

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
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-02-2015
12:30 PM

09-02-2015
12:30 PM

Re: parametric solution and TOL

You can use normalization factors for each equation!

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-04-2015
11:16 AM

09-04-2015
11:16 AM

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?

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-04-2015
11:56 AM

09-04-2015
11:56 AM

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
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-04-2015
12:08 PM

09-04-2015
12:08 PM

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
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-04-2015
12:29 PM

09-04-2015
12:29 PM

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.