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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Is Mathcad gone crazy??!

ptc-4724578
1-Newbie

Is Mathcad gone crazy??!

Dear PTC comuinty members

I was trying to solve a simple equation in mathcad 15 and I get two different solutions for the same problem, one of them

is right but the other one is kinda weird (I think).

My question is: am I making something wrong or is there something that I should know why mathcad is giving such a result.

I've attached the file.

Thank you for any reply.

P.S. If this question is in the wrong place then I apologize for that and feel free to remove it anytime.

1 ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:ptc-4724578)

It does look weird, but it's explainable. You have a singularity at x=4 (divide by zero on the rhs), so the numeric solver heads downhill until it finds a solution that is acceptable to within the defined tolerance, which is the huge number you get as answer (to within the tolerance, it finds 0=0). It's a good example of why you should look at the function, and why guess values are so important for numeric solvers.

View solution in original post

8 REPLIES 8
RichardJ
19-Tanzanite
(To:ptc-4724578)

It does look weird, but it's explainable. You have a singularity at x=4 (divide by zero on the rhs), so the numeric solver heads downhill until it finds a solution that is acceptable to within the defined tolerance, which is the huge number you get as answer (to within the tolerance, it finds 0=0). It's a good example of why you should look at the function, and why guess values are so important for numeric solvers.

this is the right place.

At x = 4 the right hand side of your equality blows up. The numeric solver can't sort that out, sot finds a number large enough to make the error less than TOL.

Try changing the Find solver function (right-click on "Find" to get the menu).

Is Mathcad gone crazy??!

Welcome to the group "Mathcad Mad House":

http://communities.ptc.com/groups/mathcad-paradoxes

Thanks for your answers guys.

I didn't know that it is so important to make a good guss, our teacher and in about all the books i've seen it says:

"Make a guess value, it doens't have to be very good but it is necessary for the algorithm to start calculating".

It seems like it is very important to be careful with guess values just like Mr. Richard said.

Mr. Fred, I'm sorry but I didn't understand what you meant. What exactly should I change?

Thank you once again.

RichardJ
19-Tanzanite
(To:ptc-4724578)

How good the guess has to be depends on the function. Sometimes you can get away with almost any guess, and it will converge to the correct solution. Sometimes it's more important though, and sometimes it's critical. All non-linear numeric solvers are iterative. You can think of them as simply heading "downhill" on the function (actually, they can be more sophisticated than that, but it's a good way to think of it). Some functions have only one minimum, in which case the guess is not so important. Other functions have multiple minima, and which one you find depends on where you start. Some functions, as in this case, have sigularities or discontinuities, and iterative solvers do not like those.Then guess values can also be important.

Richard Jackson wrote:

...Then guess values can also be important.

See please this animation - http://communities.ptc.com/videos/2418

Hekri Dushi wrote:

I didn't know that it is so important to make a good guss, our teacher and in about all the books i've seen it says:

"Make a guess value, it doens't have to be very good but it is necessary for the algorithm to start calculating".

It seems like it is very important to be careful with guess values just like Mr. Richard said.

I don't know who said that or what books you've been reading, but it's almost always important to choose an initial value close to where you think the final answer should be.

A good way to do this is to make a graph and look at it.

Unfortunately, there are many people who feel that this step is unnecessary or beneath them. That's usually the first mistake.

A good way to do this is to make a graph and look at it.

It will be good to create an animation too.

See for example -

http://communities.ptc.com/videos/1460

and

http://communities.ptc.com/videos/1472

Top Tags