Question 5.5.3: Simulink Model of a Nonlinear Pendulum The pendulum shown in...
Simulink Model of a Nonlinear Pendulum The pendulum
shown in Figure 5.5.11 has the following nonlinear equation of motion, if there is viscous friction in the pivot and if there is an applied moment M(t) about the pivot.
I\ddot{θ} + c\dot{θ} + mgL \sin θ = M(t) (1)
where I is the mass moment of inertia about the pivot. Create a Simulink model for this system for the case where I = 4, mgL = 10, c = 0.8, and M(t) is a square wave with an amplitude of 3 and a frequency of 0.5 Hz. Assume that the initial conditions are θ(0) = π/4 rad and \dot{θ}(0) = 0.

Learn more on how we answer questions.
To simulate this model in Simulink, define a set of variables that lets you rewrite the equation as two first-order equations. Thus let ω = θ˙. Then the model can be written as
\dot{θ} = ω
\dot{ω} = \frac{1}{I} [−cω − mgL \sin θ + M(t)] = 0.25 [−0.8ω − 10 \sin θ + M(t)]
Integrate both sides of each equation over time to obtain
θ = \int {ω dt}
ω = 0.25 \int {[−0.8ω − 10 \sin θ + M(t)] dt}
We will introduce four new blocks to create this simulation. Obtain a new model window and do the following.
1. Select and place in the new window the Integrator block from the Continuous category, and change its label to Integrator 1 as shown in Figure 5.5.12. You can edit text associated with a block by clicking on the text and making the changes. Double-click on the block to obtain the Block Parameters window, and set the Initial condition to 0 [this is
the initial condition \dot{θ}(0) = 0]. Click OK.
2. Copy the Integrator block to the location shown and change its label to Integrator 2. Set its initial condition to π/4 by typing pi/4 in the Block Parameters window. This is the initial condition θ(0) = π/4.
3. Select and place a Gain block from the Math Operations category, double-click on it, and set the Gain value to 0.25. Click OK. Change its label to 1/I. Then click on the block, and drag one of the corners to expand the box so that all the text is visible.
4. Copy the Gain box, change its label to c, and place it as shown in Figure 5.5.12.
Double-click on it, and set the Gain value to 0.8. Click OK. To flip the box left to right, right-click on it, select Format, and select Flip Block.
5. Select and place the Scope block from the Sinks category.
6. For the term 10 sin θ, we cannot use the Trig function block in the Math Operations category without using a separate gain block to multiply the sin θ by 10. Instead we will use the Fcn block under the User-Defined Functions category (Fcn stands for function).
Select and place this block as shown. Double-click on it, and type 10*sin(u) in the expression window. This block uses the variable u to represent the input to the block.
Click OK. Then flip the block.
7. Select and place the Sum block from the Math Operations category. Double-click on it, and select round for the Icon shape. In the List of signs window, type + − −. Click OK.
8. Select and place the Signal Generator block from the Sources category. Double-click on it, select square wave for the Wave form, 3 for the Amplitude, and 0.5 for the Frequency, and Hertz for the Units. Click OK.
9. Once the blocks have been placed, connect arrows as shown in the figure.
10. Set the Stop time to 10, run the simulation, and examine the plot of θ(t) in the Scope. This completes the simulation
