I wish to solve the equations v'=v^3/3-w+I, w'=g(v+a-bw) with a=0.8, b=0.7, g=0.08, I=0.5 using ode23/45
I googled this but for one unfamiliar with the code, it is hard to fathom what they are solving
I also would like the code to show the plots of both variables changing with time and the phase plots of both variables.
Thanks

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 7 月 20 日
編集済み: Azzi Abdelmalek 2014 年 7 月 20 日

0 投票

Write this function and save it as myode.m
function dy=myode(t,y)
dy=zeros(2,1)
a=0.8
b=0.7
g=0.08
I=0.5
dy(1)=y(1)^3/3-y(2)+I
dy(2)=g*(y(1)+a-b*y(2))
Call the above function
tspan=[0 10];
v0=0;
w0=0;
y0=[v0;w0]; % Initials consitions
[t,y]=ode45(@myode,tspan,y0)

2 件のコメント

Andrew
Andrew 2014 年 7 月 20 日
Hi, thanks. It says the variable y is undefined
Azzi Abdelmalek
Azzi Abdelmalek 2014 年 7 月 20 日
Did you do the two steps
  1. Save the first part of the code I posted as myode.m
  2. create a new script with the second part of the code I posted. Then run it

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

タグ

タグが未入力です。

質問済み:

2014 年 7 月 20 日

コメント済み:

2014 年 7 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by