Second order to first order system
18 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi, How this second order system can be converted to a first order system:?
not really sure how to get this solution?
any help will be appreciated. Thanks
3 commentaires
Star Strider
le 1 Oct 2022
There is an error in the first equation.
It should be:
The Symbolic Math Toolbox can get part way there using odeToVectorField, however it would require effort to get the ‘A’ matrix from the vector field (first output) result. The other vectors you would simply have to create.
Réponses (1)
Star Strider
le 2 Oct 2022
One approach (that involves doing an interim Laplace transform on the differential equation) —
omega = 2;
zeta = sqrt(3)/4;
sympref('AbbreviateOutput', false);
syms s t u(t) U X x(t) y(t)
eqn = diff(x, 2) + 2*zeta*omega*diff(x) + (omega^2)*x
inp = (omega^2)*u
[V, S] = odeToVectorField(eqn)
Leqn = laplace(eqn == inp,t,s)
Leqn = subs(Leqn, {laplace(x(t),t,s), x(0) subs(diff(x(t),t),0), laplace(u(t),t,s)}, {X, 0, 0, U})
X = solve(Leqn,X)
[n,d] = numden(X)
np = sym2poly(n/U)
dp = sym2poly(d)
systf = tf(np, dp)
sysss = ss(systf)
The input is defined as (or ), and the Control System Toolbox normalises the numerator and denomminator. Setting the input to 1 instead of 4 and then substituting appropriately later may give you the essential duplicate of the state space system you described.
I will leave that for you to experiment with. This code does the ‘heavy lifting’ to get your differential equation into a state space realisation. Tweak it to get the result you want.
.
0 commentaires
Voir également
Catégories
En savoir plus sur State-Space Control Design and Estimation 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!