- #1
jcsolis
- 38
- 1
Hello, I have been trying to solve this problem and the only thing I got is errors and errors. Also I need to plot y versus t, y' versus t and y' versus y??
The system of ODEs
y1'= y2
y2'= -2y1-0.03y13
The time span is [0:0.1:5]
and there are no initial conditions!
Need to be solved using ODE45 solver
None
I created this m-file
function yprime = syst1(t, y)
yprime = [y(2); -2*y(1)-0.03*(y(1))^3];
then in the command window
tspan=[0:01:5]
[t y]=oder45 ('syst1', tspan)
and then nothing comes out. I have found many examples of solving systems of ODEs but all of them with initial conditions which is not my case. Can someone explain me waht I am doing wrong?
Than You
Homework Statement
The system of ODEs
y1'= y2
y2'= -2y1-0.03y13
The time span is [0:0.1:5]
and there are no initial conditions!
Need to be solved using ODE45 solver
Homework Equations
None
The Attempt at a Solution
I created this m-file
function yprime = syst1(t, y)
yprime = [y(2); -2*y(1)-0.03*(y(1))^3];
then in the command window
tspan=[0:01:5]
[t y]=oder45 ('syst1', tspan)
and then nothing comes out. I have found many examples of solving systems of ODEs but all of them with initial conditions which is not my case. Can someone explain me waht I am doing wrong?
Than You