Problem with discrete state space equation
7 次查看(过去 30 天)
显示 更早的评论
hello guys, so i have problem with state space model where the value of element matrix phi and gamma between blue circle and red circle are different.
this is my code
Cf = 20e-6;
Rf = 0.022;
Lf = 4e-3;
Ts = 10e-6;
Ai = [0 1/Cf; -1/Lf -Rf/Lf];
Bi = [0 1/Cf; 1/Lf 0];
Ii = [1 0;0 1];
phi = exp(Ts*Ai);
gamma = inv(Ai)*(J - Ii)*Bi;
p = sqrt(Lf/Cf);
q = Ts/(sqrt(Lf*Cf));
p11 = cos(q);
p12 = p*sin(q);
p21 = (1/p)*sin(q);
p22 = cos(q);
g11 = 1-cos(q);
g12 = p*sin(q);
g21 = (1/p)*sin(q);
g22 = 1-cos(q);
phi1 = [p11 p12; p21 p22];
gamma1 = [g11 g12; g21 g22];
![1.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/219424/1.png)
![2.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/219425/2.png)
0 个评论
采纳的回答
darova
2019-5-14
Use expm() for matrix exponent (exp() ony returns exponent of each element in matrix):
phi = expm(Ts*Ai);
gamma = inv(Ai)*(phi - Ii)*Bi;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gamma Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!