Matlab & Structural Dynamics

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 34

Matlab

&
structural Dynamics
Introduction to Matlab
What is MATLAB?
􀂆 high-performance software
􀂄 Computation
􀂄 Visualization
􀂄 Easy-to-use environment.
􀂆 high-level language
􀂄 Data types
􀂄 Functions
􀂄 Control flow statements
􀂄 Input/output
􀂄 Graphics
􀂄 Object-oriented
programming capabilities
Workspace

Command window

Command
History
Calculations at the Command Line
MATLAB as a calculator Assigning Variables
Matrices
􀂆 Entering and Generating Matrices
􀂆 Subscripts
􀂆 Scalar Expansion
􀂆 Concatenation
􀂆 Deleting Rows and Columns
􀂆 Array Extraction
􀂆 Matrix and Array Multiplication
Entering Numeric Arrays

Row separator
semicolon (;)

Column separator
space / comma (,)
The Matrix in MATLAB
Entering Numeric Arrays
Generating basic matrices

Matrix with ZEROS: Matrix with Random numbers


>> Z = zeros (r, c) >> R = rand (r, c)

Matrix with ONES:


>> O = ones (r, c)

IDENTITY Matrix:
>> I = eye (r, c)

r  Rows
c  Columns
zeros, ones, eye, rand  Matlab functions
Operation on Arrays
Operation on Arrays
Addition:
>> C = A + B

Subtraction:
>> D = A – B

Multiplication:
>> E = A * B (Matrix multiplication)
>> E = A .* B (Element wise multiplication)

Division:
Left Division and Right Division
>> F = A . / B (Element wise division)
>> F = A / B (A * inverse of B)
>> F = A . \ B (Element wise division)
>> F = A \ B (inverse of A * B)
Operation on Arrays
Solution of equations

3 x 1  2 x 2  x 3  11
2 x 1  x 2  2 x 3  1
4 x 1  x 2  x 3  12

3 2 1   x 1   11 
2  1 2   x    1
  2  
4 1  1  x 3  12 

AX=B X = A-1 B
EigenValues & EigenVectors
Symbolic operations
Graphics
in Matlab
Introduction to
Structural Dynamics
Define structure (System)
m x  c x  k x  F
y1  x
Assume
y 2  x

m x  F  k x  c x
k c F
x   x  x 
m m m
k c F y1  x
x   x  x 
m m m y 2  x

x  x
y 1  y 2
k c F
y 2   y1  y 2 
m m m
y 1  y 2
k c F
y 2   y1  y 2 
m m m

 1
y
  0 1   1
y  0 

 y    k c      1 F
 2   m    y2   
m m
Y  A Y  Bf
 1
y
  0 1   1
y  0 

 y   k c      1 F
 2   m    y2   
m m
  A Y  Bf
Y

 y1   0 1  0
Y   , A   k c , B   1 
y
 2      
 m m m
y1  x
y 2  x

 x  1 0   y 1   0 
 x   0 1  y   0 F
    2  
X  CY  Df
x  1 0 0 
X   , C    ,D 
 x  0 1  0 
State Space Form
m x  c x  k x  F

  A Y  Bf
Y
X  CY  Df
 1
y  0 1   0 
Y   , A   k c , B   1 
y
 2 
 m    
m m
x  1 0  0 
X   , C    ,D 
 x  0 1  0 
In Matlab

Sys = ss (A, B, C, D)

Application :

Response x = initial (Sys, xo, t)

System Time
Initial Condition
In Matlab

Sys = ss (A, B, C, D)

Application :

Response x = lsim (Sys, f, t)

System Time
Force
Example :
Single story structure :

K = 250 t/m
m = 10 t/m.sec2
xo=0.1 m vo = 0

 0 1   0 1
A k c 

 m    25 0
m

You might also like