State Space modelling from an ODE
조회 수: 34 (최근 30일)
이전 댓글 표시
How would I find the state variable description and transfer function of the 3rd order system of the following on MATLAB?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/208581/image.png)
댓글 수: 0
채택된 답변
Star Strider
2019년 3월 15일
The easiest way is to let the Symbolic Math Toolbox do the heavy lifting:
syms y(t) u(t) t
Dy = diff(y);
D2y = diff(y,2);
D3y = diff(y,3);
DEq = D3y + 6*D2y + 11*Dy + 6*y == 6*u;
[SS,Sbs] = odeToVectorField(DEq)
producing:
SS =
Y[2]
Y[3]
6*u(t) - 6*Y[1] - 11*Y[2] - 6*Y[3]
Sbs =
y
Dy
D2y
The ‘Sbs’ output simply tells you the substitutions the solver made, so for example ‘Y[1]=y’.
I’m sure you can take it from there.
댓글 수: 2
jokn buntue
2019년 12월 12일
Can you please explain how to convert the results of odeToVectorField to the A,B,C,D matrices?
Thanks.
Star Strider
2019년 12월 12일
@jokn buntue — The ‘SS’ matrix is essentially a companion-form matrix, so eliminating the ‘6*u(t)’ term, it is the ‘A’ matrix. The ‘6*u(t)’ term becomes part of the ‘B’ matrix (vector here, since this is a SISO system).
That should get you started.
추가 답변 (1개)
djedoui Nassim
2019년 3월 15일
Hey
You can follow this mathematical changement using your example,
![State space.gif](https://www.mathworks.com/matlabcentral/answers/uploaded_files/208595/State%20space.gif)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!