how to solve 4 state equation ?

1 次查看(过去 30 天)
tomer polsky
tomer polsky 2017-10-23
编辑: Birdman 2017-10-24
A_a=[0 0 0 1/(C1);0 -1/(R*C) 0 0;0 0 -R1/(L1) 0;-1/(L2) 0 0 0]
B_a=[0;0;(1/L1);0]
u=12
dx/dt=(A_a)*x+B*u
% dx/dt is differential of x
% of course R1,C1,C,R,L1,L2 are constants
how do i solve this equation?

回答(2 个)

Birdman
Birdman 2017-10-23
This system has a transfer function of
X(s)/U(s)=B/sI-A;
This means that this differential equation's solutions will be the root of the following equation.
sI-A=0;
In this situation, you can easily find the solution for this differential equation by typing
eig(A)
The code will be as follows:
syms C1 R C R1 L1 L2
A=[0 0 0 1/(C1);0 -1/(R*C) 0 0;0 0 -R1/(L1) 0;-1/(L2) 0 0 0];
B=[0;0;(1/L1);0];
u=12;
eig(A)
You will have four solutions depending on the values of C1, R, C, R1, L1 and L2. Hope this helps.
  2 个评论
tomer polsky
tomer polsky 2017-10-24
this is not what i am asking for , u are telling me how to find the roots . i dont need the roots i need to find vector x
Birdman
Birdman 2017-10-24
编辑:Birdman 2017-10-24
syms C1 R C R1 L1 L2 t
x1=sym('x1(t)');x2=sym('x2(t)');x3=sym('x3(t)');x4=sym('x4(t)');
x=[x1;x2;x3;x4];clc;
A=[0 0 0 1/C1;0 -1/(R*C) 0 0;0 0 -R1/L1 0;-1/L2 0 0 0];
B=[0;0;1/L1;0];
u=12;
eqn=diff(x,t)==A*x+B*u;
sol=dsolve(eqn);
disp(sol.x1)
disp(sol.x2)
disp(sol.x3)
disp(sol.x4)
x=[sol.x1;sol.x2;sol.x3;sol.x4]

请先登录,再进行评论。


Torsten
Torsten 2017-10-24
编辑:Torsten 2017-10-24
syms a(t) b(t) c(t) d(t) C1 R C R1 L1 L2 u
eqns = [diff(a,t)==d/C1 , diff(b,t)=-b/(R*C) , diff(c,t)=-R1*c/L1+u/L1 , diff(d,t)=-a/L2];
[asol(t) bsol(t) csol(t) dsol(t)] = dsolve(eqns)
Best wishes
Torsten.

类别

Help CenterFile Exchange 中查找有关 Formula Manipulation and Simplification 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by