MATLAB Answers

0

Numerical Solution of 3rd order nonlinear differential equation

Hodan Gesod さんによって質問されました 2019 年 10 月 13 日 3:16
最新アクティビティ darova
さんによって コメントされました 2019 年 10 月 15 日 12:12
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 件のコメント

サインイン to comment.

2 件の回答

Steven Lord
回答者: Steven Lord
2019 年 10 月 13 日 3:36

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 2019 年 10 月 13 日 17:23
Thanks for the refferal. Come in handy :)

サインイン to comment.


回答者: Hodan Gesod 2019 年 10 月 15 日 11:22

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
2019 年 10 月 15 日 12:12
Check your equations

サインイン to comment.



Translated by