Question

Matlab Code Please

The van der Pol equation is a second order ODE which is written as follows: 91 where μ > 0 is a scalar parameter. Rewrite thi

0 0
Add a comment Improve this question Transcribed image text
Answer #1

mu=1;
dydt = @(t,y)[y(2); mu*(1-y(1)^2)*y(2)+y(1)];
%y(1) is y1, y(2) is d(y1)/dt
h=.1;%step size,change it accordingly
t=0:h:2;%from 0 to 2
n=length(t);
y=zeros(length(t),2);
y(1,:)=[1,0];%initial conditions put in the first index
for i=2:n
    term=y(i-1,:)+h*dydt(t(i-1),y(i-1,:))';%euler method
    y(i,:)=term;
end
figure
plot(t,y(:,1),t,y(:,2))
legend('y_1','y_1''(t)')
fprintf(' t           y(t)            dy/dt\n')
fprintf('%5.2f%15.5f%15.4f\n',[t;y'])

2 0 t00 6 8 8 2 8 4 1 8 4 6 1 9 7 1 1 195 d0000-2276460193928443 /000000098627986169372 yo-2345667899999987766 00006424267595

Add a comment
Know the answer?
Add Answer to:
The van der Pol equation is a second order ODE which is written as follows: 91 where μ > 0 is a s...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT