Skip to main content
1-Visitor
August 5, 2022
Solved

Symbolic solve

  • August 5, 2022
  • 3 replies
  • 2283 views

A simple equation solved symbolically for an unknown variable returns two results, - as expected.

However I know the result lies in the range 0 - 1.

If I add an 'assume' modifier to limit the result to the value <1, I get quite an unexpected result.

The units are obviously causing all sorts of mayhem.

What's going on here?

Best answer by Werner_E

Primes symbolic doesn't know about units and so it can help (and is often necessary) to tell the symbolic engine that the used unit (meter in your case) is real and positive. This is often necessary even if you turn on "Units/Constants in symbolic" in the calculation options and sometimes it doesn't help at all (which is unfortunately also true for the modifier "assume").

 

But there is no need to use the symbolic "solve" if you are just after one numeric answer - especially if you know the range the solution is to be expected.

You may use a numeric solve block or the "root" function to do the job, the latter being more compact, does not need a guess value if you provide a range and doesn't look that ugly:

Werner_E_0-1659670604836.png

 

 

Werner_E_0-1659670033438.png

 

3 replies

15-Moonstone
August 5, 2022

Hello,

 

I agree... 

 

"m" is "variable" or "unit"  ? 

 

ssato_0-1659666736105.png

 

1-Visitor
August 5, 2022

m is a unit (metre).

The V terms all have the units of velocity m/s

Sent from Mail for Windows

15-Moonstone
August 5, 2022

Hello,

 

I have mistakes.

 

UNIT  "m"  has  polarity ?

I think this Is bug.

 

ssato_0-1659668949716.png

 

Werner_E25-Diamond IAnswer
25-Diamond I
August 5, 2022

Primes symbolic doesn't know about units and so it can help (and is often necessary) to tell the symbolic engine that the used unit (meter in your case) is real and positive. This is often necessary even if you turn on "Units/Constants in symbolic" in the calculation options and sometimes it doesn't help at all (which is unfortunately also true for the modifier "assume").

 

But there is no need to use the symbolic "solve" if you are just after one numeric answer - especially if you know the range the solution is to be expected.

You may use a numeric solve block or the "root" function to do the job, the latter being more compact, does not need a guess value if you provide a range and doesn't look that ugly:

Werner_E_0-1659670604836.png

 

 

Werner_E_0-1659670033438.png

 

1-Visitor
August 5, 2022

Thank you all for your responses.

My take-away from this is the symbolics don’t like units, and there are other (better) ways of solving for the variable.

Thanks.

Sent from Mail for Windows

23-Emerald IV
August 5, 2022

If you do want a symbolic result, then you can do as follows:

LucMeekes_0-1659700882231.png

And a numeric evaluation of that function gives you:

LucMeekes_1-1659700913821.png

Success!
Luc