How to find roots of a quartic function with unknown constant coefficients?

3 ビュー (過去 30 日間)
Hrinay
Hrinay 2023 年 11 月 27 日
編集済み: Walter Roberson 2023 年 11 月 29 日
The polynomial is:
x^4 + 10.1ax^3 + 1.81x^2 + 9ax + 0.81 = 0
where a is an unkown constant coefficient.
I have to find the corresponding x values to further solve an ODE.

回答 (2 件)

James Tursa
James Tursa 2023 年 11 月 28 日
編集済み: James Tursa 2023 年 11 月 28 日
You can look here:
But the nature of the roots is going to depend on the value of a. Do you know anything at all about a? What is the context of the overall problem you are solving? What is the ODE?
  1 件のコメント
Hrinay
Hrinay 2023 年 11 月 28 日
No it just represents a dampening coefficient for a spring mass system. The ode models the movement of a building. Essentially a fbd with 2 masses, 2 springs, and 2 dampeners. I get two odes that model the forces on the mass block. I am trying to solve the simultaneous set of ODE's using cramers rule than MUC because the odes all have constant coefficients of which we have a value for every constant except the dampening coefficients C1 and C2.
The FBD:

サインインしてコメントする。


Torsten
Torsten 2023 年 11 月 28 日
編集済み: Torsten 2023 年 11 月 28 日
syms x a
p = x^4 + 10.1*a*x^3 + 1.81*x^2 + 9*a*x + 0.81;
sol = solve(p==0,'MaxDegree',4)
sol = 
vpa(subs(sol,a,1)) % E.g. for a = 1
ans = 
  1 件のコメント
Walter Roberson
Walter Roberson 2023 年 11 月 29 日
編集済み: Walter Roberson 2023 年 11 月 29 日
The roots get complicated and fragile
filename = fullfile(tempdir, 'sol.m');
addpath(tempdir);
syms x a
p = x^4 + 10.1*a*x^3 + 1.81*x^2 + 9*a*x + 0.81;
sol = solve(p==0);
solF = matlabFunction(sol, 'file', filename)
solF = function_handle with value:
@sol
A = linspace(-1/2,1/2,200);
Y = cell2mat(arrayfun(solF, A, 'uniform', 0));
figure();
plot(A, real(Y(1,:)), A, real(Y(2,:)), A, real(Y(3,:)), A, real(Y(4,:)));
legend({'1 real', '2 real', '3 real', '4 real'})
figure();
plot(A, imag(Y(1,:)), A, imag(Y(2,:)), A, imag(Y(3,:)), A, imag(Y(4,:)));
legend({'1 imag', '2 imag', '3 imag', '4 imag'})

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by