Community Tip - You can change your system assigned username to something more personal in your community settings. X

Translate the entire conversation x

Problems with "solve" Mathcad 10

VY_12844664
3-Newcomer

Problems with "solve" Mathcad 10

Hi everyone, when i got a new laptop and donwloaded mathcad again, im suddenly having different issues with it i didnt before. Like when using the solve function it cant give me the answer if i use units in 1 scenario. In the other it gives me the answer as "cos(30deg). Anyone knows if its something i can fix?

VY_12844664_1-1738507801555.png

The one above is supposed to give around 673N.

 

VY_12844664_0-1738507695135.png

This one is supposed to give 0,87kN.

 

5 REPLIES 5
LucMeekes
23-Emerald III
(To:VY_12844664)

The symbolic solver normally doesnt know about units, treats them as undefined variables.

You may want to switch on the Calculation Option "Units/Constants in symbolics".

 

 

Success!

Luc

I did switch it on, didn't really change anything.

But I used to be able to solve on my old laptop no problem, these issues only came up after I started again from beginning on a new computer 

LucMeekes
23-Emerald III
(To:VY_12844664)

As an alternative (since you're only interested in a numerical solution) use the root() function.

 

Success!
Luc

LucMeekes
23-Emerald III
(To:VY_12844664)

And if you really do want to solve this symbolically, here's what you could (should) do:

Define

LucMeekes_0-1738620367401.png

Then you can calculate the result for any L, h and m. Example:

LucMeekes_1-1738620420458.png

Likwise, with:

LucMeekes_2-1738620849774.png

You can calculate:

LucMeekes_3-1738620868831.png

(Unitless!)

 

Success!
Luc

Werner_E
25-Diamond I
(To:VY_12844664)

Turning on the option "Units/Constants in Symbolics" sure is a good idea and you should have turned on on per default.

But it doesn't tell the symbolics the meaning of predefined constants and relationship between units, it just lets the symbolics retain the labels "Unit" and "Constants".

 

Without this option enabled:
Werner_E_0-1738542081052.png

Note on the right hand side that the symbolics turned the unit m to a  normal variable m (its not set in bold blue anymore).

That way you would run into troubles if you try to evaluate the 'result' numerically:

Werner_E_1-1738542251890.png

This is what turning on the option cures:

Werner_E_2-1738542308269.png

Note that the 'm' on the right hand side now is still correctly labeled as unit and so the numerical evaluation works OK:

Werner_E_3-1738542362516.png

But even with the option active, the symbolics knows nothing about the relationship between different units or the definition of constants.

Werner_E_4-1738542545044.png

You see that the symbolics does not know how seconds and minutes are related or how the gravitational constant is defined. It regards all these quantities as independent unknown variables. But since the labelling as a unit is not lost when the appropriate  option is activated, the result expression can at least still be evaluated numerically (or saved in a variable).

 

The shortcoming that the symbolics cannot handle units is not new in Prime 10. It was exactly the same in all previous versions and was no different in real Mathcad (version 15 and before)!

 

So concerning your problem #1 it should be now clear that the symbolics is not able to come up with 672 N as result, but you simply could numerically evaluate the symbolic result to get the desired display

Werner_E_5-1738543000414.png

or assign the result to a variable and evaluate it numerically

Werner_E_6-1738543079097.png

And of course you don't need the symbolics at all for this simple equation and can use either a solve bock with "find" or the "root" function as already suggested by Luc.

You may use the "root" function either by providing an initial guess value

Werner_E_9-1738543338966.png

or by providing two values, one to the left and the other to the right of the expected zero

Werner_E_8-1738543317440.png

 

Of course you could also teach the symbolics how to handle the constant of gravity and how different units are related so that it could arrive at the desired result, but I would consider this too much effort for a a very modest achievement:

Werner_E_10-1738543936278.png

 

According your problem #2:


VY_12844664_0-1738507695135.png

This one is supposed to give 0,87kN


No! Sure not! Where should the unit kN stem from? The unit meter cancels, no other unit is in play and so of course the result must be a dimensionless number!

 

The symbolics does not know anything about the definition of "deg" or its alias "°".

So either define your angle in radians

Werner_E_11-1738544257411.png

Or you may also (re)define the 'unit' "deg" before you use it the first time, so that the symbolics knows how to deal with it:

Werner_E_12-1738544348319.png

The symbolics returns an exact result if possible and if you rather prefer a numeric result from the symbolics you have to use the modifier "float,...".

 

If you wish to see the result as a force, you would have to define the first factor "3" as being a force

Werner_E_13-1738544424527.png

There is also one way to get the desired result without having to use radians or redefine "deg". You may use a numeric inline evaluation when defining the angle. That way the variable is assigned that numeric value and the symbolics will use it. But doing so you won't get the exact result.

Werner_E_0-1738567781371.png

 

 

And as you are just dealing just with numeric results, you also could do without the symbolics at all and use Primes numeric methods, e.g. again the "root" function

Werner_E_14-1738544608755.png

Using the symbolic engine most of the the times is not necessary when just dealing with numeric results.
Advantage of the symbolics is that it can handle unknowns, undefined variables.
So you could set up a function for B.y which depends on the force (3kN), the two lengths involved and the angle. This should be done before any of these variables are defined.
You can now use this function (numerically evaluated) to immediately see the effect different input values may have:

Werner_E_0-1738568341175.png

 

 

But to make it clear once more, both problems you experienced aren't new - its the very same in older versions as well.
It has nothing to do with a new version of Prime or with the new computer you are using now.

 

 

 

Announcements

Top Tags