Effacer les filtres
Effacer les filtres

Solve symbolic equation in order to get parameters of an equation

2 vues (au cours des 30 derniers jours)
naga240
naga240 le 28 Juil 2023
Commenté : Sam Chak le 28 Juil 2023
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 commentaire
Sam Chak
Sam Chak le 28 Juil 2023
Do you want to get the state I from an initial value to a steady value at a specific time t?

Connectez-vous pour commenter.

Réponses (1)

Torsten
Torsten le 28 Juil 2023
Modifié(e) : Torsten le 28 Juil 2023
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.

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by