0% found this document useful (0 votes)
102 views

Simulink Tutorial

The document describes building a Simulink model to solve a second order mass-spring-damper differential equation. It provides step-by-step instructions for creating the simulation diagram, including adding blocks, setting parameters, and connecting everything. The results of the simulation are presented and verified against hand calculations.
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 PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

Simulink Tutorial

The document describes building a Simulink model to solve a second order mass-spring-damper differential equation. It provides step-by-step instructions for creating the simulation diagram, including adding blocks, setting parameters, and connecting everything. The results of the simulation are presented and verified against hand calculations.
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 PDF, TXT or read online on Scribd
You are on page 1/ 18

Example 2

Build a Simulink model that solves the following differential equation


2nd order mass-spring-damper 2nd-order mass spring damper system zero ICs input f(t) is a step with magnitude 3 parameters: m = 0.25, c = 0.5, k = 1

m x cx kx f (t )

Create the simulation diagram

On the following slides:

The simulation diagram for solving the ODE is created step p by y step. p After each step, elements are added to the Simulink model. model

Optional exercise: first, sketch the complete l t diagram di (5 min.) i )

m x cx kx f (t )

(continue)

First, solve for the term with highestorder derivative m x f (t ) cx kx Make the left-hand side of this equation the h output of f a summing i block bl k
m x
summing block

Drag a Sum block from the Math library

Double-click Double click to change the block parameters to rectangular and + - -

(continue)

Add a gain (multiplier) block to eliminate the coefficient and produce g alone the highest-derivative
m x
summing i block

1 m

Drag a Gain block from the Math library

The g gain is 4 since 1/m=4. /

Double-click Double click to change the block parameters. Add a title.

(continue)

Add integrators to obtain the desired output variable


m x
summing block

1 m

1 s

1 s

Drag Integrator blocks from the Continuous library

ICs on the integrators are zero.

Add a scope from the Sinks library. Connect output ports to input ports. Label the signals by double-clicking on the leader line line.

(continue)

Connect to the integrated signals with gain bl k to blocks t create t th the t terms on th the right-hand i ht h d side of the EOM
m x
summing bl k block

1 m

x cx
kx

1 s
c

1 s

Drag new Gain blocks from the Math library


To flip the gain block, select it and choose Flip Block in the Format pull-down menu.

Double-click Double click on gain blocks to set parameters Connect from the gain block input backwards up to the branch point. Re-title the gain blocks.

c=0.5

k=1.0

Complete the model

Bring all the signals and inputs to the summing i block. bl k Check signs on the summer.
+ -

f(t) input

m x 1 m

x cx kx

1 s
c

x x k

1 s

x(t) output

Double-click on Step block to set parameters. For a step t i input t of f magnitude it d 3 3, set Final value to 3

Final Simulink model

Run the simulation

Results

Underdamped response. response Overshoot of 0.5. Final value of 3. Is this expected?

Paper-and-pencil P d il analysis l i based on the equations of motion

Standard form k Natl freq. freq Damping ratio Static g gain

x m

1 c x x f (t ) k k

k n 2.0 m c 0.5 n k K
1 1 k 2

Check simulation results

Damping ratio of 0.5 is less than 1.


Expect the system to be underdamped. Expect p to see overshoot. Expect output magnitude to equal input magnitude. Input has magnitude 3, 3 so does output. output

Static gain is 1.

Simulation results conform to expectations.

End of tutorial

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy