I want to add

1 回表示 (過去 30 日間)
sang un jung
sang un jung 2020 年 6 月 4 日
編集済み: 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 Center および File ExchangeOrdinary Differential Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by