Solve symbolic equation in order to get parameters of an equation
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
le 28 Juil 2023
Hi @naga240
Do you want to get the state I from an initial value to a steady value at a specific time t?
Réponses (1)
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)
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.
0 commentaires
Voir également
Catégories
En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!