Numerical Solution of 3rd order nonlinear differential equation

2 ビュー (過去 30 日間)
Hodan Gesod
Hodan Gesod 2019 年 10 月 13 日
コメント済み: darova 2019 年 10 月 15 日
oppgave.JPG
This is a excerise that was given. Completely new to matlab, and dont know how to put this in a matrix form?

回答 (2 件)

Steven Lord
Steven Lord 2019 年 10 月 13 日
See this documentation page and this other documentation page for the techniques you'll need to use to solve this assignment. If you're completely new to MATLAB and what's written on those pages doesn't make sense, you may want to take the free MATLAB Onramp tutorial first.
  1 件のコメント
Hodan Gesod
Hodan Gesod 2019 年 10 月 13 日
Thanks for the refferal. Come in handy :)

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


Hodan Gesod
Hodan Gesod 2019 年 10 月 15 日
Hey- to Dariva, kind of deleted the wrong comment. What was the mistake I made in the code I'd written?
y0 = [10; 10; 10]; %initial conditions
h= 0.0001; %sampling time
t0=0; %start time
tfinal= 20; %final time
function dydt = f(t,y)
dydt = [ (10*y(2)-10*y(1))
(28*y(1)-y(3)-y(2))
(y(1)*y(2)-(8/3)*y(3)) ];
function yout = ode1(f,t0,h,tfinal,y0);
y=y(0);
yout=y;
for t=t0:h:tfinal-h
s= f(t,y); %slope
y= y+h*s; %euler step
yout= [yout; y];
plot(t,y)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by