0% found this document useful (0 votes)
44 views4 pages

EGSAN

This document describes how to simulate a mass-spring-dashpot system in Simulink. It involves connecting blocks like Step, Gain, Sum, Integrator and Scope to model the system's dynamic behavior. Parameters like mass, damping and spring stiffness are set for each block. Running the simulation produces an output graph of the system response over time in the Scope block. The 'To Workspace' block allows saving the output arrays for additional analysis and plotting in MATLAB.

Uploaded by

babunapi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views4 pages

EGSAN

This document describes how to simulate a mass-spring-dashpot system in Simulink. It involves connecting blocks like Step, Gain, Sum, Integrator and Scope to model the system's dynamic behavior. Parameters like mass, damping and spring stiffness are set for each block. Running the simulation produces an output graph of the system response over time in the Scope block. The 'To Workspace' block allows saving the output arrays for additional analysis and plotting in MATLAB.

Uploaded by

babunapi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Example 2.

Mass-Spring-Dashpot System Simulation

Consider a mass-spring-dashpot system as shown in Figure E2-1.


The mathematical model for this system is described by

(2)
where m is the equivalent mass of the system, c is the damping
ratio, k is the spring stiffness, and f(t) is the forcing function in
the x-direction.

Figure E2-1 In this example I will illustrate how to use Simulink to simulate
the response of this system to unit step input.

STEP 1 In Simulink, create a new model window (CTRL+N) and drag the
following blocks from the Simulink library window:

Blocks to be dragged to Where located in Simulink library


the model window browser
Step Sources
Gain Math Operation
Sum Math Operation
Integrator Continuous
Scope Sinks
To Workspace Sinks
 
STEP 2 By re-arranging Eqn 2 to yield an expression for the acceleration term,
Eqn (2) becomes

(3)
Based on Eqn 3, we connect the blocks in the diagram as shown in
Figure E2-2. Use CTRL+I and CTRL+R to flip and rotate the blocks as
necessary (select the block first then execute the key sequence). Note
that you can use CTRL+right mouse button to create branches of the
connecting lines. Don't worry about the parameter values and the signs
for these blocks at this point as we'll take care of this in STEP 3. Just
get them connected first.

Figure E2-2

 
STEP 3 Enter the values of the parameters for each block. In this example, we
will set m = 2.0; c=0.7; k=1. You are encouraged to try different values
and observe the system's response to step input.

To show that you may obtain different form of output, I included


another block (in addition to the scope block) called "simout". This
block can be found in the Sinks group from the Simulink Library
browser. The output from this block is used in Matlab workspace. To
illustrate how this block works, I will select a name for the output
called "simout" as the variable name in the block's parameter setting
(double click on the "simput" block to bring up the parameter dialog
window). In additon, I will need a time array from the simulation. This
can be specifed as a parameter in the Simulation Parameter window
(CTRL+E) under the Workspace I/O tab as shown in Figure E2-3.
Figure E2-3

 
STEP 4 Run the simulation by clicking on the button (alternately you may
use keyboard command CTRL+T ). The screenshot of the output from
the Scope block is show in Figure E2-3.

Figure E2-3

That's it! You have successfully modeled and simulated a second-order


under-damped dynamic system. To exam different responses, feel free
to change different values for m, c, and k in the gain blocks.

To see how you can use the output from the "simout" block (by the
way, you may name the block whatever you wish), go to Matlab
Command window and typ

>> who

You should receive an echo from Matlab listing the following


variables: "simout" and "time" (and perhaps others variables in the
current workspace memory).

Now, you may create a plot of the system response identical to that
shown in the Scope output. The command for creating this plot is:
>>plot(time,simout);grid

Note that the outout format used in the example above is matrix type.
The output sent to workspace can be used for further analysis and
storage in ascii format. Output to workspace allows more options in
plot presentation and further data analysis as the arrays are in ascii
format.
   

You might also like