Message Boards Message Boards

0
|
5585 Views
|
3 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Solve symbolic cubic equation and select specific solution

Posted 4 years ago

Hello,

I try to solve some equations and automatically select the right solution when assuming certain parameter properties. enter image description here How can I automatically select the right of those three solutions when assuming the result must always be a Real number and that the parameters a & b are both Reals and both are bigger than 0.

Thanks a lot for your help,

Bernd

Attachments:
POSTED BY: Bernd Sprenger
3 Replies

Rohit's solution gives a Root object, which may not be desirable.

To do the selection after the fact, use

    In[1]:= soln = Solve[a t^3 == b, t]

    Out[1]= {{t -> b^(1/3)/a^(
       1/3)}, {t -> -(((-1)^(1/3) b^(1/3))/a^(1/3))}, {t -> ((-1)^(2/3)
         b^(1/3))/a^(1/3)}}

    In[2]:= Select[soln, 
       Simplify[Element[(t /. #), Reals], Assumptions -> {a > 0, b > 0}] &]

    Out[2]= {{t -> b^(1/3)/a^(1/3)}}
POSTED BY: Robert Nachbar
Posted 4 years ago

Another option

Solve[a*t^3 == b && a > 0 && b > 0, t, Reals] // ToRadicals // Normal

(* {{t -> ((-1)^(2/3) b^(1/3))/a^(1/3)}} *)
POSTED BY: Updating Name
Posted 4 years ago

Hi Bernd,

Try

Solve[a*t^3 == b && a > 0 && b > 0, t, Reals]
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract