Van der pol Equation Simulation in Simulink

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 5K views
engineer_stud
Messages
8
Reaction score
0

Homework Statement



As the title says, I am trying to implement two differential equations into Simulink. I don't know how to start. How do I know what to start with, which block goes where? when do I add something and when do I know to subtract something using the sum block. When I got my model ready, how do I know what I have done is right?

The system should be realized using the following blocks :

Integrator, sum, product, gain and To Workspace.


Homework Equations



Code:
\begin{align}
\dot{x_{1}}=x_{2}\\
\dot{x_{2}}=-x_{1}+\mu(1-x^{2}_{1})x_{2}
\end{align}

where
Code:
\mu>0

The Attempt at a Solution



 
Physics news on Phys.org
Alright boys, thank you for the help on the Simulink part (NOT). I have now managed to set up the model in simulink. Now I am suppose to run the model from a MATLAB M-file (script). I initialize the variables and run the simulation from the script, plotting x1 and x2 against each other.

The problem is that I don't get any graph? Just an empty figure.

mu = 5;
t_sim = 10;
x_10 = 1;
x_20 = 2;

sim('vanderpol');

time1 = x1.time;
x1 = x1.signals.values;

time2 = x2.time;
x2 = x2.signals.values;

figure(1);
grid on;
plot(x1,x2);