Lab Session 09 Objective 1. Simulink: 1.1 A Coil and Its Magnetic Field
Lab Session 09 Objective 1. Simulink: 1.1 A Coil and Its Magnetic Field
Objective
Applications of Simulink in Engineering
1. Simulink
Simulink is a time based software package that is included in Matlab and its main task is to
solve Ordinary Differential Equations (ODE) numerically. The need for the numerical
solution comes from the fact that there is not an analytical solution for all DE, especially for
those that are nonlinear. The whole idea is to break the ODE into small time segments and to
calculate the solution numerically for only a small segment. The length of each segment is
called “step size”. Since the method is numerical and not analytical there will be an error in
the solution. The error depends on the specific method and on the step size (usually denoted
by h).
1.1 Example 1 A Coil and its Magnetic Field
Consider the coil shown in the next figure,
Step 2
We will use as many integrators as the order of the DE that we want to solve: The integrator
block is in:
Page 1 of 11
Figure 2 Simulink library browser
Step 3
Now drag the all the basic components such as sum block, gain, integrator etc. as shown
below,
Page 2 of 11
Step 6
Now we must add an input signal to simulate the voltage change and something to see the
response of the current. For the voltage change we chose to use a step input of amplitude 1
and for the output we can use a scope:
Page 3 of 11
Step 6:
To run the simulation we must give values to L, R. In the workspace we type: R=0.01; L=0.01
Step 7
To see the solution we must run the simulation and then double click on the Scope:
Page 4 of 11
2. Spring mass system
The second example is a classical mass-spring system:
Page 5 of 11
Page 6 of 11
In the command window type the following parameters such as,
Page 7 of 11
Now click on the scope to see the simulation which is shown below,
Page 8 of 11
3.1 Simulation
Slip
1
0.9
0.8
Normalized Relative Slip
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 5 10 15
Time(sec)
60
50
Speed(rad/sec)
40
30
20
10
0
0 5 10 15
Time(sec)
Page 9 of 11
When the desired relative slip is 0.5 then the results obtained are shown below,
60
Speed(rad/sec)
50
40
30
20
10
0
0 2 4 6 8 10 12 14 16 18
Time(sec)
Slip
1
0.5
Normalized Relative Slip
-0.5
-1
-1.5
-2
0 5 10 15 20
Time(sec)
Page 10 of 11
Lab Rubrics
Page 11 of 11