Solve symbolic equation in order to get parameters of an equation

22 ビュー (過去 30 日間)
naga240
naga240 2023 年 7 月 28 日
コメント済み: Sam Chak 2023 年 7 月 28 日
Greetings.
I have a system of the form :
I have written the equations individually in order to get them inside matlab as such:
syms phi real
syms p real
syms R real
syms K real
syms L real
syms J real
syms V real
syms b real
syms s [2 2]
phi_dot=-R/L*phi-K/J*p+V
p_dot=K/L*phi-b/J*p
Now, I'd like to get the matrix [-R -K; K -b] from an eqn. My idea was to use this:
eqn = [phi_dot; p_dot]==s*[phi;p]+[1;0]*V
solve(eqn,s)
But it only solves the first row. All parameter s should be in terms of the other parameters and not in terms of phi or p. Does anybody has experience with something like this?
  1 件のコメント
Sam Chak
Sam Chak 2023 年 7 月 28 日
Do you want to get the state I from an initial value to a steady value at a specific time t?

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

回答 (1 件)

Torsten
Torsten 2023 年 7 月 28 日
編集済み: Torsten 2023 年 7 月 28 日
syms phi(t) p(t)
syms R L K J V b phi0 p0 real
eqn1 = diff(phi,t) == -R/L * phi - K/J * p + V;
eqn2 = diff(p,t) == K/L * phi -b/J * p;
eqns = [eqn1,eqn2];
conds = [phi(0) == phi0, p(0) == p0];
sol = dsolve(eqns,conds)
sol = struct with fields:
p: exp(-(t*(L*b + (J^2*R^2 - 4*J*K^2*L - 2*J*L*R*b + L^2*b^2)^(1/2) + J*R))/(2*J*L))*((K^2*p0*(J^2*R^2 - 4*J*K^2*L - 2*J*L*R*b + L^2*b^2)^(1/2) - 2*J*K^3*phi0 + R*b*p0*(J^2*R^2 - 4*J*K^2*L -… phi: - exp(-(t*(L*b - (J^2*R^2 - 4*J*K^2*L - 2*J*L*R*b + L^2*b^2)^(1/2) + J*R))/(2*J*L))*((K^2*p0*(J^2*R^2 - 4*J*K^2*L - 2*J*L*R*b + L^2*b^2)^(1/2) + 2*J*K^3*phi0 + R*b*p0*(J^2*R^2 - 4*J*K^2*L…
Now if you have data for phi, p, phi_dot and p_dot depending on t and you know L,J and V, you might be able to estimate the parameters R, K and b of the matrix.

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by