Matlab
The initial conditions are and . The file VdP with the resulting right hand side has been coded up for the given equation. Solve the equation for using ode45. Is this the right code to solve for ?
y0 = [2; 0];
[t,y1]=ode45(@VdP,[0:0.01:32],y0);
A4 = y1(:,1);Yes, this code is right if code in the VdP-file is correct.
Here is an example of these two files for solving simple equation (with 0 initial cond.):
VdP:
function du=VdP(t,u)
du=zeros(2,1);
du(1)=u(2);
du(2)=1;Solution:
[t,h]=ode45(@VdP,[0 300],[0,0]);
Solution = h(:,1)