Skip to main content
1-Visitor
May 25, 2017
Solved

How to set the condition for the solution of a 4th order equation?

  • May 25, 2017
  • 4 replies
  • 6769 views

Hi All, I have a 4th order equation for an unknown parameter. The equation includes some constants whose number depends on the external setting.

4th.JPG

The parameter must be a positive real number. In the attachment, I listed two possible symbolic solutions k2_1 and k2_2.


How can I set the if else condition correctly to achieve the following requirement?

(1) if both k2_1 and k2_2 are real and positive, show both of them as the solution of k2

(2) if only one of k2_1 and k2_2 is real and positive show this real number

(3) if neither k2_1 or k2_2 can satisfy the positive real condition, show an error message

Thank you!

Best answer by Werner_E

Maybe something like the attached.

As you can see, as so often the symbolics ignores some constraints given via "assume".

4 replies

23-Emerald IV
May 25, 2017

Introduce a new variable, e.g. 'x' with as definition:

x=k2^2, then your equations turns into:

       (4/9)*x^2 - constant7*x + constant5 = 0

You can use simple school mathematics to solve x.

Then k2 values are found by taking the positive or negative square root of x.

Success!
Luc

23-Emerald IV
May 25, 2017

There are only 4 possible solutions (because it is a 4th order problem)

They are found with:

Success!

Luc

23-Emerald IV
May 25, 2017

The other option is to ask Mathcad to solve the 4th order straight away:

Success!
Luc

Werner_E25-Diamond IAnswer
25-Diamond I
May 25, 2017

Maybe something like the attached.

As you can see, as so often the symbolics ignores some constraints given via "assume".

yhuang-31-VisitorAuthor
1-Visitor
May 26, 2017

Hi Werner, I have a similar but more complicated calculation.

Now I have three variables with several constant numbers (depending on external setting). How can I get the symbolic solution of three equations?

My variables are k2, QE1 and QE2. Are are real numbers, and k2 must be positive. Would you teach me how to solve it symbolically?

4th-2.JPG

It seems like I am not allowed to upload another worksheet in this thread. If you want me to open a new thread to upload the worksheet, I can do that.

Thank you!

23-Emerald IV
May 26, 2017

You should not be limited in uploading worksheets. But the option to attach a worksheet is only available when you use the 'advanced editing' mode, or when you edit your entry (lower left corner: choose 'actions', the 'edit').

Luc