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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

solve of equation with combination of coefficients

Marius_P
6-Contributor

solve of equation with combination of coefficients

Hello,

I would like to know if you could help me please with some idea how could I solve the following 3rd degree equation:

- equation is of type ax^3+bx^2+cx+d=0

- each of the coefficients has a max and min value:

    • a ->(amin, amax)
    • b -> (bmin, bmax)
    • c-> (cmin, cmax)
    • d-> (dmin, dmax)

It results a high number of 3rd equations to be solved from all the possible combinations of the min and max values of the coefficients.

Solving each combination in part takes lot of time, so I would like to know if there is any possible way to get the solutions from all the equations obtained from all the possible combinations of coefficients?

Thank you,

Marius 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Yes, you are right.  I used the order used by polyroots which is coefficient of x^0 as first value.

Werner_E_0-1674520775799.png

Actually I hadn't noticed that thats differently from the function definition the IP used in his question.

 

If thats an issue it can easily be changed

Werner_E_1-1674521275470.png

 

View solution in original post

11 REPLIES 11

Here's one way:

 

polyroots.png

Alan

(the attached file is M15 format)

> get the solutions from all the equations

ALL equations? For sure?

There is an infinite(!) number of possible coefficients "a" from amin to amax and the same goes for b, c and d.

Every equation will have 3 solutions. So you have to expect 3*infinity^4 values. No matter which method you may chose to calculate them, it will take infinity time and if you are using Prime it even may take much longer 😉

So maybe you may reconsider what you really are looking for.

I took the question as meaning just use the two extreme values for each coefficient.  Of course, if the requirement is for all values in between the extremes, then, as you say, there is an infinite number of possible solutions!

 

Alan

Marius_P
6-Contributor
(To:AlanStevens)

No, my question is referring only to the max & min values of each coefficient. I am using PTC Mathcad Prime 7 for worst case calculations.

Could you tell me please how to build the matrix of coefficients?

Here is one way to do it

Werner_E_0-1674481565853.png

 

Marius_P
6-Contributor
(To:Werner_E)

Hello Werner,

Thank you for your help. I followed your solution but it seems to not work for me. Could you tell me please why?

 

error message.png

LucMeekes
23-Emerald III
(To:Marius_P)

You should attach the worksheet, not (just) a small picture.

 

Success!
Luc

What do you expect us to see at the picture you posted?

Werner_E_0-1674520037971.png

You hardly can expect us to read the error message to get a clue as to what went wrong.

From what hardly can be seen at vector A is that the first entry seems to be positive and the second is negative. While in ,my sheet i had chosen the opposite order (lowest value first), this should actually be no problem at all. Actually you can put even more values in each vector at any order at all and you may also chose to use vectors of different length. The method should work equally well.

You will have to attach the sheet for further help.

 

Addon

I don't experience any errors when I use the values you might have used. No matter if I use them with my original function (wher the order of a,b,c,d was reversed compared with your initial posting, nor with the "correct" order as seen here:

Werner_E_2-1674521725547.png

 

LucMeekes
23-Emerald III
(To:Werner_E)

Hmm, so -4 (second row of the table, x1) should be a solution for

LucMeekes_4-1674513718499.png

Let's see:

LucMeekes_5-1674513737698.png

Is it polyroots, or did you place the a...d in the wrong order?

Guess it should be:

LucMeekes_2-1674513557421.png

(This is the full solution for any a,b,c and d)

Now we can build the table with:

LucMeekes_3-1674513566116.png

Now:

LucMeekes_6-1674513781886.png

That's close enough to 0.

 

Success!
Luc

 

P.S. Checked. You did change the order of the coefficients:

LucMeekes_0-1674514372918.png

 

 

Yes, you are right.  I used the order used by polyroots which is coefficient of x^0 as first value.

Werner_E_0-1674520775799.png

Actually I hadn't noticed that thats differently from the function definition the IP used in his question.

 

If thats an issue it can easily be changed

Werner_E_1-1674521275470.png

 

Top Tags