In: Mechanical Engineering
Use the Saturation block to create a Simulink model to plot the solution of the following equation for 0 ≤ t ≤ 6.
Type simulink in MATLAB command window or click the simulink icon on the toolbar to launch simulink.
Click on the new model icon or press ctrl+N to create the new model. The simulink model is shown in Figure 1.
Procedure to make the simulink model,
• From the simulink library, select a Sine wave block, a saturation block, a Subtract block, a Gain block, an Integrator block, and a To workspace block.
• Connect these blocks and assign their values by double-clicking them using Figure 1.
• Double-click the Sine wave block and enter the value of amplitude as 10 and frequency as 3.
• Double-click the saturation block and enter the value of upper limit as 8 and lower limit as –8.
• Double-click the Gain for ydot block and enter the value of gain as 1/3.
• Double-click the Integrator for y(0) block and enter the initial condition as 2.
• Rename each block according to convenience.
• Double-click the To workspace block and change the save format to array.
• Run the simulink model for 6 seconds and switch to command windows.
• Type the following command in MATLAB command window:
plot(tout,simout),xlabel('t'),ylabel('x')
• Press enter. The output plot is shown in Figure 2.
Thus, the simulink model to plot the equation t versus x is modeled and the output is shown in Figure 2 for 6 seconds.
Thus, the simulink model to plot the equation t versus x is modeled and the output is shown in Figure 2 for 6 seconds.