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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

OD_9907400
2-Guest

solve

Hi,

I'm straggling to understand why with solve block i get accurate solution, whereas  writing down the expression i don't get the right answer with arrow and "solve" function..

Thanks in advance.

 

OD_9907400_0-1690550525118.png

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Always attach the worksheet itself, not just a picture.

It looks like your equation has more than just one solution.

The solve block will give you the one based on your guess value.

The symbolic solve chose one of the solutions at its own will and it happens to be a different one.

 

You may try to put both solutions into your equation and see if they satisfy it (up to a certain inaccuracy)

Chances are that the solution of the symbolics will end up in an overflow (number exceeds 10^308)

 

You may try to add the modifier "assume, T2>100". It should help, but usually it doesn't and the symbolics will ignore it.

Guess you will have to stay with the numeric solve block.

BTW, using the numeric root() function in one of its two flavors instead of the solve block  might be an option, too.

View solution in original post

5 REPLIES 5

Always attach the worksheet itself, not just a picture.

It looks like your equation has more than just one solution.

The solve block will give you the one based on your guess value.

The symbolic solve chose one of the solutions at its own will and it happens to be a different one.

 

You may try to put both solutions into your equation and see if they satisfy it (up to a certain inaccuracy)

Chances are that the solution of the symbolics will end up in an overflow (number exceeds 10^308)

 

You may try to add the modifier "assume, T2>100". It should help, but usually it doesn't and the symbolics will ignore it.

Guess you will have to stay with the numeric solve block.

BTW, using the numeric root() function in one of its two flavors instead of the solve block  might be an option, too.

Thanks for the comment.

the file attached to the original post.

Root works perfects in this case... thanks

 

LucMeekes
23-Emerald III
(To:OD_9907400)

The general solution to your problem is:

LucMeekes_0-1690565743370.png

It contains the Lambert W 'function', that consists of two branches, for negative arguments.

The W function occurs in solutions of the problem x=z*exp(-x):

LucMeekes_6-1690566430063.png

To get an impression of the upper branch:

LucMeekes_8-1690566617291.png

The negative limit for z is -1/e, lower (more negative) values of z, the function has no real solutions (but may have complex solutions). The lower branch starts at the point (-1/e , -1) and turns downward and towards the y-axis where it stops.

Now with:

LucMeekes_1-1690565816858.png

we get:

LucMeekes_2-1690565844970.png

And the argument to the W function is:

LucMeekes_3-1690565871369.png

negative, and within -1/e and 0, so there are two solutions.

One of them is:

LucMeekes_4-1690565900436.png

Success!
Luc

 

Thanks!

how did you get the second solution, which it the expected one? "1008.4"

thanks

Luc is using an older Mathcad version (11) which has a symbolic engine (Maple) thats much more capable than what PTC  had built into Prime (Axiom/friCAS). So you can't duplicate what he had done.

 

I rewrote your equation and defined a function

Werner_E_0-1690627828204.png

and we are now looking at its zeros. A plot shows the zero at around 1000

Werner_E_1-1690627894215.png

which is what your solve block had found and which easily could be found, too, by using the root function

Werner_E_2-1690627933089.png

 

But if we zoom in we see that there is another solution, too, at approx. 90

Werner_E_3-1690627972257.png

Your solve block sure would be able to find it using a different guess value and of course the roor function succeeds, too

Werner_E_4-1690627993057.png

 

Upon further zooming we get the impression that there is a third zero at T2=0,

Werner_E_5-1690628168724.png

but the function is not defined for T2=0 because of a division by zero. Nonetheless the limit when we approach zero from the right actually is zero

Werner_E_6-1690628184314.png

and this is the (only) wrong solution the symbolic in Prime is willing to deliver.

Werner_E_7-1690628282046.png

Its wrong twofold  because its inaccurate (it should be exactly zero) and because the function is not defined at x=0.

 

So why not stay with numeric methods?

If your goal was to derive a closed expression for T2 you can't do so in Prime as the symbolic engine is not capable enough.

But if you intended to compare the solutions when you vary certain input values, you can do so using the numeric methods as well as you can turn the solve block as well as the root function into a fucntion of the desired input variables.

As an example the pic below shows the value of T2 for various values of n

Werner_E_8-1690628883130.png

 

BTW, I also tried in Mathcad 15 which had muPad implemented for symbolic operations (less capable than Maple in MC11, but probably a bit more powerful compared to the new engine in Prime)

It can't solve the equation symbolically, but when provided values for the variables it delivers at first a non-real solution.
But we can tell the symbolics that all variables (including T2) are positive (and therefore real). Now we get the first solution 90.6.
Unfortunately the modifier "assume, T2>500" is ignored so it could not be talked into returning the second real solution.

Werner_E_0-1690630117653.png

 

Top Tags