0% found this document useful (0 votes)
7 views2 pages

Matlab Dynamic System Simulations

This document demonstrates Matlab simulations of step responses for mass-damper and mass-spring-damper dynamic systems using two techniques: 1) state space equations and 2) transfer functions. Two systems are modeled - a mass-damper system and a mass-spring-damper system. The response plots for each system and technique are shown.
Copyright
© All Rights Reserved
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)
7 views2 pages

Matlab Dynamic System Simulations

This document demonstrates Matlab simulations of step responses for mass-damper and mass-spring-damper dynamic systems using two techniques: 1) state space equations and 2) transfer functions. Two systems are modeled - a mass-damper system and a mass-spring-damper system. The response plots for each system and technique are shown.
Copyright
© All Rights Reserved
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

Matlab Simulation Examples

3/2/01

Step Response
Mass-Damper system, Technique 2

0.8

0.8
Amplitude

Amplitude

Step Response
Mass-Damper system, Technique 1

0.6
0.4
0.2

0.6
0.4
0.2

0
0

Time (sec.)

Time (sec.)

Step Response
MSD System, Technique 1

Step Response
MSD System, Technique 2
0.2
Amplitude

0.2
Amplitude

0.1
0
-0.1

0.1
0
-0.1

Time (sec.)

10

12

Time (sec.)

10

12

%
%
%
%
%
%

Examples of simulations using Matlab


Two methods of simulting dynamic systems are demonstrated:
1. Technique 1 uses state equations
2. Technique 2 uses transfer functions
Two systems are considered: a mass-damper and mass-spring-damper system.
M.A. Minor - 3/02/01 - ME3210

clear all
% MASS-DAMPER VELOCITY SIMULATIONS (First order system)
% Technique #1 - Using state space matrices: xdot=Ax+Bu, y=Cx+Du
% Defining system variables
m=1;
b=1;
% Defining the A,B,C,D matrices
A=-b/m;
B=1/m;
C=1;
D=0;
sys=ss(A,B,C,D)
subplot(2,2,1) %figure(1)
% The step command simulates the response of the system to a step input and plots the
result.
step(sys);
title('Mass-Damper system, Technique 1')
% Technique #2 - Using the coefficients of the transfer function, V(s)/F(s)=(1/(ms+b))
num=1;
den=[m b]
sys=tf(num,den)
subplot(2,2,2) %figure(2)
step(sys);
title('Mass-Damper system, Technique 2')
% MASS-SPRING-DAMPER VELOCITY SIMULATIONS (Second order system)
% Simulating a second order system is very similar. Consider a MSD system:
k=10;
% First by technique 1:
subplot(2,2,3) %figure(3)
A=[-b/m -1/m
k
0]
B=[1/m 0]'
C=[1 0]
D=[0]
sys=ss(A,B,C,D);
step(sys);
title('MSD System, Technique 1')
% Technique 2: transfer function,
subplot(2,2,4) %figure(4)
num=[1 0];
den=[m b k];
sys=tf(num,den);
step(sys)
title('MSD System, Technique 2')

You might also like