How to convert odetovectorfield results to A,B matrices?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi.
I would like to know how to convert odetovectorfield results to A,B matrices in a state space model.
The following is the code and the results of that code.
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)
SS =
Y[2]
Y[3]
6*u(t) - 6*Y[1] - 11*Y[2] - 6*Y[3]
Sbs =
y
Dy
D2y
The A matrix is supposed to be [0 1 0; 0 0 1; -6 -11 -6] and the B matrix is supposed to be B= [0; 0; 6] by the way. Can the matlabFunction of symbolic math toolbox help?
Thanks.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!