Problem with discrete state space equation
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Trio Pamungkas
le 14 Mai 2019
Commenté : Trio Pamungkas
le 14 Mai 2019
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 commentaires
Réponse acceptée
darova
le 14 Mai 2019
Use expm() for matrix exponent (exp() ony returns exponent of each element in matrix):
phi = expm(Ts*Ai);
gamma = inv(Ai)*(phi - Ii)*Bi;
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Gamma Functions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!