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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Symbolic solve

TB_10343934
3-Newcomer

Symbolic solve

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?

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:TB_10343934)

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

 

View solution in original post

6 REPLIES 6
ssato
15-Moonstone
(To:TB_10343934)

Hello,

 

I agree... 

 

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

 

ssato_0-1659666736105.png

 

TB_10343934
3-Newcomer
(To:ssato)

m is a unit (metre).

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

Sent from Mail for Windows

ssato
15-Moonstone
(To:TB_10343934)

Hello,

 

I have mistakes.

 

UNIT  "m"  has  polarity ?

I think this Is bug.

 

ssato_0-1659668949716.png

 

Werner_E
25-Diamond I
(To:TB_10343934)

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

 

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

LucMeekes
23-Emerald III
(To:TB_10343934)

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

Announcements

Top Tags