Question 5.5.2: A Simulink Model of Response with a Dead Zone Create and run...
A Simulink Model of Response with a Dead Zone
Create and run a Simulink simulation of a mass-spring-damper system (5.5.1) using the parameter values m = 1, c = 2, and k = 4. The forcing function is the function f(t) = \sin 1.4t . The system has the dead-zone nonlinearity shown in Figure 5.5.6.
m\ddot{y} + c \dot{y} + ky = f(t) (5.5.1)

Learn more on how do we answer questions.
To construct the simulation, do the following steps.
1. Start Simulink and open a new model window as described previously.
2. Select and place in the new window the Sine Wave block from the Sources category.
Double-click on it, and set the Amplitude to 1, the Bias to 0, the Frequency to 1.4, the Phase to 0, and the Sample time to 0. Click OK.
3. Select and place the Dead Zone block from the Discontinuities category, double-click on it, and set the Start of dead zone to −0.5 and the End of dead zone to 0.5. Click OK.
4. Select and place the Transfer Fcn block from the Continuous category, double-click on it, and set the Numerator to [1] and the Denominator to [1, 2, 4]. Click OK.
5. Select and place the Scope block from the Sinks category.
6. Once the blocks have been placed, connect the input port on each block to the outport port on the preceding block. Your model should now look like that shown in Figure 5.5.7.
7. Click on the Simulation menu, then click the Configuration Parameters item. Click on the Solver tab, and enter 10 for the Stop time. Make sure the Start time is 0. Then click OK.
8. Run the simulation by clicking on the Simulation menu, and then clicking the Start item.
9. You will hear a bell sound when the simulation is finished. Then double-click on the Scope block and then click on the binoculars icon in the Scope display to enable autoscaling.
You should see an oscillating curve.
It is informative to plot both the input and the output of the Transfer Fcn block versus time on the same graph. To do this,
1. Delete the arrow connecting the Scope block to the Transfer Fcn block. Do this by clicking on the arrow line and then pressing the Delete key.
2. Select and place the Mux block from the Signal Routing category, double-click on it, and set the Number of inputs to 2. Click Apply, then OK.
3. Connect the top input port of the Mux block to the output port of the Transfer Fcn block.
Then use the same technique to connect the bottom input port of the Mux block to the arrow from the outport port of the Dead Zone block. Just remember to start with the input port. Simulink will sense the arrow automatically and make the connection. Your model should now look like that shown in Figure 5.5.8.
4. Set the Stop time to 10, run the simulation as before, and bring up the Scope display. You should see what is shown in Figure 5.5.9. This plot shows the effect of the dead zone on the sine wave.
You can bring the simulation results into the MATLAB workspace by using the To Workspace block. For example, suppose we want to examine the effects of the dead zone by comparing the response of the system with and without a dead zone. We can do this with the model shown in Figure 5.5.10. To create this model,
1. Copy the Transfer Fcn block by right-clicking on it, holding down the mouse button, and dragging the block copy to a new location. Then release the button. Copy the Mux block in the same way.
2. Double-click on the first Mux block and change the number of its inputs to 3.
3. In the usual way, select and place the To Workspace block from the Sinks category and the Clock box from the Sources category. Double-click on the To Workspace block. You can specify any variable name you want as the output; the default is simout. Change its name to y. The output variable y will have as many rows as there are simulation time steps, and as many columns as there are inputs to the block. The fourth column in our simulation will be time, because of the way we have connected the Clock to the second Mux. Specify the save format as Array. Use the default values for the other parameters (these should be inf, 1, and -1 for Maximum number of rows, Decimation, and Sample Time, respectively). Click on OK.
4. Connect the blocks as shown, and run the simulation.
5. You can use the MATLAB plotting commands from the Command window to plot the columns of y; for example, to plot the response of the two systems and the output of the Dead Zone block versus time, type




>>plot(y(:,4),y(:,1),y(:,4),y(:,2),y(:,4),y(:,3))