I want to add

1 次查看(过去 30 天)
sang un jung
sang un jung 2020-6-4
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)

采纳的回答

Ameer Hamza
Ameer Hamza 2020-6-4
编辑:Ameer Hamza 2020-6-4
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 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by