Problem with discrete state space equation

2 ビュー (過去 30 日間)
Trio Pamungkas
Trio Pamungkas 2019 年 5 月 14 日
コメント済み: Trio Pamungkas 2019 年 5 月 14 日
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
2.PNG

採用された回答

darova
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;
  1 件のコメント
Trio Pamungkas
Trio Pamungkas 2019 年 5 月 14 日
wow thanks sir, its working now

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGamma Functions についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by