MATLAB Answers

Numerical Solution of 3rd order nonlinear differential equation

7 ビュー (過去 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?

  0 件のコメント

Sign in to comment.

回答 (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 :)

Sign in to comment.


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)

  1 件のコメント

darova
darova 2019 年 10 月 15 日
Check your equations

Sign in to comment.


Translated by