I want to add
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
sang un jung
le 4 Juin 2020
Modifié(e) : sang un jung
le 4 Juin 2020
syms s
ode = matlabFunction(ilaplace(134/(s^2 + 16*s + 134)),'Vars',{'t','y'})
[t, y] = ode45(ode,[0 1],0);
subplot(1,2,2)
plot(t,y)
0 commentaires
Réponse acceptée
Ameer Hamza
le 4 Juin 2020
Modifié(e) : Ameer Hamza
le 4 Juin 2020
Based on your comment on other question for expression of ea(t): https://www.mathworks.com/matlabcentral/answers/541922-please-tell-me-how-to-use-ode45-code#comment_883106 the following shows how to use ode45 to solve this ODE with input saturation
[t, y] = ode45(@odeFun, [0 1], [0; 0]);
plot(t, y(:,1), 'o-')
function dxdt = odeFun(t, x)
% transfer function is equivalent to following ODE
% x'' = 4/9(-16x'+ea(t))
ea = (1-x(1))*303;
if ea > 100
ea = 100;
elseif ea < -100
ea = -100;
end
dxdt = zeros(2, 1);
dxdt(1) = x(2);
dxdt(2) = 4/9*(-16*x(2)+ea);
end
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Ordinary Differential Equations 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!