Van der pol Equation Simulation in Simulink

Click For Summary
SUMMARY

The discussion focuses on implementing the Van der Pol differential equations in Simulink, specifically using blocks such as Integrator, Sum, Product, Gain, and To Workspace. The user initially struggled with setting up the model and later faced issues with obtaining output graphs after running the simulation from a MATLAB M-file. The equations involved are dot{x_{1}}=x_{2} and dot{x_{2}}=-x_{1}+\mu(1-x^{2}_{1})x_{2}, with \mu=5 as a parameter. The user successfully initialized variables and executed the simulation but encountered an empty figure when plotting the results.

PREREQUISITES
  • Familiarity with Simulink block diagram modeling
  • Understanding of differential equations, specifically the Van der Pol equation
  • Basic knowledge of MATLAB scripting and M-files
  • Experience with data visualization in MATLAB
NEXT STEPS
  • Learn how to troubleshoot empty plots in MATLAB by checking signal outputs
  • Explore the use of the To Workspace block in Simulink for data export
  • Study the configuration of simulation parameters in Simulink
  • Investigate advanced plotting techniques in MATLAB for better visualization of results
USEFUL FOR

This discussion is beneficial for engineering students, researchers, and practitioners working with dynamic systems modeling in Simulink, particularly those focusing on differential equations and MATLAB integration.

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);
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
1K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
2K
Replies
6
Views
2K