フィルターのクリア

Solution of swing equation which is a 2nd order differential equation.

6 ビュー (過去 30 日間)
Ebraheem Menda
Ebraheem Menda 2020 年 11 月 24 日
編集済み: Ebraheem Menda 2020 年 11 月 26 日
This is my system.
I Need to solve it by using ode45.
P, M and D are constants.
Thanks for help in advance !!!

採用された回答

Ebraheem Menda
Ebraheem Menda 2020 年 11 月 26 日
It can be solved using ode45 like this.
create 1 function file with the following instructions.
function dydt = swingeqn(~,del,pmax,M,D)
dydt=zeros(2,1);
dydt(1)=del(2);
dydt(2)=-(pmax/M)*sin(del(1))-D*del(2);
Now call it from script file
clc
clear all
pmax=-5;
M=1;
D=0.1;
tspan=[0,10];
del0=[0 1];
[t,del]= ode45(@(t,del) swingeqn(t,del,pmax,M,D),tspan,del0); % Calling the function swingeqn
plot(t,del(:,2));
xlabel('Time in Sec');
ylabel('Delta, Omega');

その他の回答 (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