Вы находитесь на странице: 1из 9

Spring 2017

CEE - 572: Earthquake Engineering


Simulink Tutorial

1. Introduction:
This tutorial aims to present a method to integrate equation of motion using Simulink toolbox.

2. Problem formulation:
We start with a single degree of freedom equation of motion of form:
+ + =

Where m is the mass, c is the damping, k is the stiffness, , , and are the displacement,
velocity, acceleration, and ground acceleration respectively.
Since this equation is 2nd order ordinary differential equation in time, solving it isnt entirely
trivial, the solution is much easier if it can be transformed to 1st order ode. State-space
representation is a mathematical model that represents a physical system, the system is modeled
as set of inputs, state variables related by 1st order odes, and output variables.
State-space representation:
We start by defining a state vector x(t), let: = [1 2 ] where 1 = and 2 = , then:

() = [ ]

Taking the derivative of time:


1
() = [ ] = [ ]
2

From the equation of motion:



=

Using some algebra and writing in matrix format:
() = () + ()
Where () is the input vector, in this case () = , , are as following:
0 1 0
=[ ], =[ ]
/ / 1
Spring 2017

Also, we have:
() = () + ()
Where () is called the output vector, it depends on the required output. Lets say all
displacement, velocity and acceleration are required, thus:

() = [ ]

And hence:
1 0 0
=[ 0 1 ], =[ 0 ]
/ / 1
Note that C and D can be changed based on the required output, for example if only displacement
is required as output, only the first row is considered, if displacement and acceleration, both first
and third rows are considered, and so on.
Example:
Consider the 2 dof system in the homework, the modal system is

+ + =

Where i=1,2 represents the two modes of the 2 dof system. , , are the modal mass,
damping, and stiffness, and is the modal displacement.
In this case:
0 1 0
=[ ] , =[ ]
/ /
And since only displacement is required:
= [1 0] , = [0]
Spring 2017

3. MATLAB/Simulink implementation:
First, the system should be decomposed to get 2 decoupled equations of motions, the values of
, , , should be known for both modes.
You can go to http://www.vibrationdata.com/elcentro.htm and download the N-S component
as .dat file. If acceleration is given as a ratio of g, you need to scale it first (multiply acceleration
column by g).

1. load the earthquake data file to MATLAB, use:

Load( name file )

Note, if the MATLAB file and the .dat file are in different directories, you should provide the
directory inside load.

2. Form A, B, C, and D for both modes as shown below, here Mmod is the diagonal modal mass
matrix and Kmod is the diagonal modal stiffness matrix, P_1 and P_2 re the participation
factors for mode 1 and 2 respectively.

3. You should run the file and have elcentro_NS and all matrices in the workspace.

4. Run Simulink, you can do this by just typing simulink in the command window.

Load the data

Both files in
the same dir.

Make sure to
Define A,B,C,D run and have
the variables
in workspace

Run simulink
Spring 2017

5. When simulink opens, select blank model, now you should add the three main component,
input, state-space, and output.

6. Open the library browser, under Simulink Sources, drag from workspace block to the work
area, double click and input the name of input variable, in this case elcentro_NS.

Open library browser


Spring 2017

7. From the library browser, under Simulink Continous, drag State-space block to the work
area, connect to input, double click and input Variables corresponding to A,B,C,D and initial
conditions ( 0 in this case).
Spring 2017

8. From the library browser, under Simulink Sinks, drag To Workspace block to the work
area, connect to state-space, double click and input output variable name, change format to
array.
Spring 2017

9. You can add scope from Simulink commonly used blocks, to plot either the input acceleration
or out parameter or both.
Spring 2017

10. Before running, change the simulation time, make sure to cover the total earthquake time at
least, you may also go to settings, change to fixed step and ode8 (Dormand-Prince) solver and
set time step to 0.1 to get convergence.
Spring 2017

11. Run the simulation, you can either view the plots by double-clicking scope, or you can post-
process your arrays using MATLAB command (you should find an array called U1 in your
workspace).

12. Do the same for the second mode using the corresponding values of A, B, C, D, or you can
run both simulations in the same time.

13. Hint: Dont forget that what we calculated is the modal responses, you should transfer them
back to get the actual responses.

Вам также может понравиться