MATLAB For Automobile and Mechanical Engineering
MATLAB For Automobile and Mechanical Engineering
Engineering
1
This Lab Consists of Modules
1. STATIC ANALYSIS
2. KINEMATIC ANALYSIS
3. DYNAMIC ANALYSIS
4. VIBRATION ANALYSIS MODULE
5. CONTROL SYSTEM ANALYSIS
6. MECHANISMS SIMULATION MODULE
7. HYDRAULIC SYSTEM SIMULATION
MODULE
2
3
4
List of Experiments
5
COURSE LEARNING OBJECTIVES
• To realize the importance of Computational efficiency in
simulation of Real time Mechanical systems.
• To Implement Statics, kinematics, dynamics and control
problems.
• To Implement Dynamics and control problems in Vibratory
systems.
• To learn vibration pattern in vibratory systems with damping and
without damping for programming effectively differential equation
problems with Ode solvers.
• To learn the simulation of Hydraulic systems.
• To learn the simulation of mechanism systems.
• To implement automation systems by virtual simulation and
analysis of Real Time systems.
6
Expected Course Outcome
• Students should be able to understand and implement the
statics, kinematics and dynamics problems.
• Students should be able to understand the vibratory systems
motion parameters and undamped and damped vibratory
systems.
• Students should be able to implement control systems
methodology to control vibrations.
• Students should be able to learn the simulation of hydraulic
and mechanical systems.
7
BOOKS FOR REFERENCE
8
What is Matlab?
MATLAB (Matrix Laboratory) is basically a high level language which has
many specialized toolboxes for making things easier for us.
MATLAB is a software for doing numerical computation. It was originally
designed for solving linear algebra type problems using matrices. It’s name is
derived from Matrix Laboratory.
MATLAB has since been expanded and now has built-in functions for
solving problems requiring data analysis, signal processing, optimization, and
several other types of scientific computations.
It also contains excellent GUI features of functions for 2-D and 3-D
graphics and animation.
Powerful, extensible, highly integrated
computation, programming, visualization, and simulation package.
Widely used in engineering, mathematics, and science.
Why?
9
What are we interested in?
10
Need to Perform Vibration
analysis
11
Human Vibration
12
Resonance Frequency Ranges of Human body sections
• Eyeball, Intraocular Structure (20-90 Hz)
• Head (axial mode) (20-30 Hz)
• Shoulder Girdle (4-5 Hz)
• Chest wall (50-100 Hz)
• Arm (5-10 Hz)
• Hand (30-50 Hz)
• Abdominal Mass (4-8 Hz)
• Spinal column (axial mode) (10-12 Hz)
It may be noted that the abdominal mass mode (around 5 Hz)
makes us nauseating and is avoided in automotive design.
Top gun pilots had problem with a particular maneuver when the eyeball
socket went into resonance.
13
BASICS
Displacement
distance D
35 Metres
Time
Speed Velocity
65 m/s V
Time
0-60 m/s
in 8.6 Acceleration
second A
Time
14
Undamped free vibration
Displacement
Displacement
d = D sinnt
D
Time
T Frequency
1
T
m
Period, Tn in [sec]
k
Frequency, fn= T1n in [Hz = 1/sec]
k
n= 2 fn =
m
15
Continued
…
Natural frequency of a simple single degree of freedom
undamped system is given by the equation
ωN = square root of (stiffness / mass)
16
AREAS WHERE MECHANICAL ENGINEERS USE MATLAB
• Solving kinematics, kinetics and complete
dynamic systems control of Automotive
suspension , Thermal systems etc.,
17
Aero plane Suspension of landing gear
M
M
M g F s F c
Yo
d2
M ydt2 o Mg Fc
Ys
Fs
Y in
18
Components of a car
19
How about Shock absorber
20
Let us look at a quarter bus/truck/car model
xs
ms
ks cs
xu
mu
kt u
26
M
Mg
y
ys
Suspensi ystem
yin
22
Suspension Mechanism
23
CONTINUED…
24
CONTINUED…
25
CONTINUED
…
26
Conventional passive suspension
zs
sprung mass
(body) Ms
zu
unsprung mass
(wheel, axle) Mu
zr
tyre stiffness K t
27
CONTINUED
…
28
CONTINUED…
29
CONTINUED…
30
Active suspension
31
MatLab MODEL FOR
Bus suspension
Designing an automatic suspension system for a bus
32
Simulation Model for Robot
34
Variables
>>x=5;
>>x1=2;
35
Array, Matrix
36
Long Array, Matrix
37
Generating Vectors from functions
38
Matrix Index
39
Operators (arithmetic)
40
MatriX Operations
41
Matrixes and vectors
• x = [1,2,3] , vector-row,
• y=[1;2;3], vector-column,
• x=0:0.1:0.8 , vector x=[0,0.1,0.2,0.3....0.8],
• A = [1,3,5;5,6,7;8,9,10], matrix,
• A(1,2), element of matrix, 1. row, 2. column,
• A(:,2), second column of matrix,
• A(1,:), first row of matrix ,
• C=[A;[10,20,30]] matrix with additional row,
• B=A(2:3,1:2), part of matrix,
• x’, transpose.
42
46
Matrixes and vectors
• size(A), matrix size,
• det(A), determinant,
• inv(A), inverse matrix,
• eye(3), unit matrix,
• zeros(3,4), matrix of zeros,
• rand(3,5), matrix of random values,
• sum(A), sum of elements,
• A*x, matrix-vector product (if dimensions are
corresponding),
• A.*B, element multiplication of two matrixes.
• help sqrt, looking for known command,
• help, help topics are shown,
43
47
The use of “.” -Operation
(Element by element operation)
44
To find eigen values and eigen vectors of matrices
45
Introduction to M-files programming
Type-2
Programming
Type-1 programming Program:-
clc;
Program:- clear all;
clc; clear p=input('enter the value of p:');
t=input('enter the value of t:');
all; r=input('enter the value of r:');
p=10,000; I=(p*t*r)/100
Solution:-
t=2;
Input:
r=11; enter the
value of
I=(p*t*r)/1 p:10000
00; enter the value of t:2
Solution:- enter the value of r:11
Output:
I = 2200 I = 2200
46
Solving Nonlinear Equations by Function
nle.m (function of the program)
function f = nle(x)
f(1) = x(1)-4*x(1)*x(1)-x(1)*x(2);
f(2) = 2*x(2)-x(2)*x(2)+3*x(1)*x(2);
48
Performing Integration
49
Numerical Integration
• Numerical integration of the integral f (x) dx is called quadrature. MATLAB
provides the following built-in functions for numerical integration:
quad:
• It integrates the specified function over specified limits, based on adaptive
Simpson's rule.
• The general call syntax for both quad and quadl is as follows:
Syntax:-
integral = quad(‘function’, a, b)
50
51
52
Common math functions
53
Built-in functions for handling arrays
54
MATLAB built-in array functions
55
Random numbers generation
56
Complex numbers handling functions
57
GRAPHICS USER INTERFACE (gui) IN
MATLAB
Example:-
» x = 1:2:50;
» y = x.^2;
» plot(x,y,'*-')
» xlabel('Values of x')
» ylabel('y')
58
LINE SPECIFIERS IN THE plot()
COMMAND
plot(x,y,‘line specifiers’)
59
Graphics and Data Display
60
Basic function sin(x) between 0≤x≤4πTask: Plot the
61
Plot the function e-x/3sin(x) between 0≤x≤4π
62
Plot the function e-x/3sin(x) between 0≤x≤4π
63
Contd..
64
Plot of the sine function from limits of 0 to (2* pi).
Graph of sine function in 0 to (2*pi) range
1
sin(x)
0.8
Program:-
0.6
clear all; % clear all variables
0.4
clc; % clear screen
0.2
N=30;
sin(x)
0
h=pi/
-0.2
N;
x=0:h:(2*pi); -0.4
y=sin(x); -0.6
plot(x,y) -0.8
xlabel('x') -1
0 1 2 3 4 5 6 7
ylabel('sin(x') x
figure
6
plot(x,y)
y=f(x)
xlabel('x') 4
ylabel('y=f(
x)') 2
grid on
0
title('plot of function f_1(x)');
legend('f_1(x)');
-2
axis([-2 4 -2 12]) -2 -1 0 1 2 3 4
x
66
Plotting multiple plots in same window, for example plotting
sine curve and cosine curve in single window.
Test of multi-plot option in Matlab
1
sine
0.
Program:- 8 cosine
0.
clc; clear 6
0.
all; 4
N=15; 0.
2
functions
h=pi/N; 0
x=0:h:2*pi; -
0.2
plot(x,sin(x),'r- -
',x,cos(x),'g-- 0.4
') -
0.6
legend('sine',' -
0.8
cosine'); -1
0 1 2 3 4 5 6 7
grid x
xlabel('x');
title('Test of multi-plot option in Matlab');
ylabel('functi
ons'); 67
Comparing multiple plots in single window for example
y1 = 2 cos(x), y2 = cos(x), and y3 =0.5* cos(x), in the interval 0≤ x≤ (2*pi)
Typical example of multiple plots
3
2*cos(x)
Program:- 2
cos(x)
0.5*cos(x)
x = 0:pi/100:2*pi;
1
y1 = 2*cos(x);
Cosine functions
y2 = cos(x); 0
y3 = 0.5*cos(x);
-1
plot(x,y1,'--',x,y2,'-'
,x,y3,':'); -2
0.5
grid on;
0.4
hold on;
0.3
plot(x, exp(-x), 'r:*');
0.2
axis([0 2*pi 0 1]);
0.1
title('2-D Plot');
xlabel('Time'); 0
0 1 2 3 4 5 6
Tim e
ylabel('Sin(t) ');
text(pi/3, sin(pi/3), '<--sin(\pi/3) ');
legend('Sine Wave','Decaying Exponential');
69
Multiple Plots
t=0:pi/100:2*pi;
y1=sin(t); 1 1
subplot(2,2,1) 0 0
grid on -1 -1
0 2 4 6 8 0 2 4 6 8
subplot(2,2,2)
plot(t,y2);
grid on
subplot(i,j,k)
•i is the number of rows of subplots in the
plot
•j is the number of columns of subplots in the
plot 70
• k is the position of the plot
For the given data plot the variation of x with y.
x 1 2 3 5 7 7.5 8 10
y 2 6.5 7 7 5.5 4 6 8
Program:
clc; Clear
all;
x=[1 2 3 5
7 7.5 8
10];
y=[2 6.5 7
7 5.5 4 6
71
8];
For the given data plot the variation of x with y.
Year 1988 1989 1990 1991 1992 1993 1994
Program:
clc;
Clear all;
year =
[1988:1:
1994];
sales =
[127,
72
130,
To plot Three dimensional spiral curve
Program:
4
- clc; 0
clear all; 3
0
z= 2
z
0
0:0.1:10* 1
0
pi; 0
1
x = exp(- 0.
5
1
0 0.
z/20).*co - -
0 5
0.5
s(z); y -1 -1 0.5
x
y = exp(-
z/20).*sin
(z);
plot3(x,y,z,'LineWidth',2)
grid on 73
To plot Three dimensional Helix curve
Program:-
clc; 4
0
clear all; 3
0
2
t=0:pi/50:10*pi; 0
1
plot3(sin(t),cos(t),t); 0
0
1
0. 1
5 0 0.
0 5
- -
0. - - 0.
5 1 1 5
74
Plot the surface defined by the function
f(x,y)= (x-3)2 – (y-2)2 on the domain -2 ≤ x ≤ 4 and 1 ≤ y ≤ 3.
Program:-
clc;
2
clear all; 5
2
0
1
[X,Y] = meshgrid(-2:0.2:4,1:0.2:3); 10
5
Z = (X-3).^2 - (Y-2).^2; 5
mesh(X,Y,Z); 0
xlabel('x'); -
5
ylabel('y'); 3
2. 4
5 2 2
1. 0
y 5 1 - x
2
75
Curve Fitting and interpolation
Curve fitting is the process of constructing a curve, or mathematical function,
that has the best fit (in a least square sense) to a series of data points,
possibly subject to additional constraints. Interpolation is the method of
constructing new data points within the range of a discrete set of known
data points. Extrapolation is the process of constructing new data points
outside a discrete set of known data points. Matlab has many utilities for
curve fitting and interpolation.
Interpolation:-
Given the data points (xi, yi), find yj at desired xj ≠ xi from yj = f(xj), where
f is
a continuous function to be found from interpolation.
Syntax:- ynew = interp1(x,y,xnew, method ).
’nearest’->
’linear’ ->Nearest neighbor interpolation
Linear interpolation (default)
-> Cubic spline interpolation
’spline -> Piecewise cubic Hermite interpolation
’ -> Same as ’pchip’
’pchip’ 76
Generate a sine curve and interpolate with Curve generation by nearest
interpolation method
nearest interpolation
Program:- 1
nearest
clc; 0.
8
clear all; 0.
6
x= 0.
4
0:10; 0.
2
y=
sin(x)
0
sin(x); -
0.2
xi = -
0:.25:10 0.4
-
; 0.6
-
yi = interp1(x,y,xi,'nearest'); 0.8
-1
plot(x,y,'o',xi,yi) 0 1 2 3 4 5 6 7 8 9 10
x
xlabel('x');
ylabel('sin(x)');
77
title('nearest interpolation ');
Generate a sine curve and interpolate with Curve generation by linear
interpolation method
nearest
Program:- 1 interpolation
nearest
x = 0:10; 0.
8
y = sin(x); 0.
6
0.
xi = 0:.25:10; 4
0.
yi = interp1(x,y,xi,'linear'); 2
sin(x)
0
plot(x,y,'x',xi,yi) -
0.2
xlabel('x'); -
0.4
ylabel('sin(x)'); -
0.6
title('linear interpolation '); -
0.8
-1
legend('linear') 0 1 2 3 4 5 6 7 8 9
x 10
78
Generate a sine curve and interpolate with Curve generation by Spline
interpolation method
Program:- spline
1 interpolation
x = 0:10; spline
0.
8
y = sin(x); 0.
6
xi = 0.
4
0:.25:10; 0.
2
sin(x)
0
yi = interp1(x,y,xi,'spline'); -
0.2
plot(x,y,'o',xi,yi); xlabel('x'); -
0.4
ylabel('sin(x)'); -
0.6
-
title('spline interpolation '); 0.8
-
10 1 2 3 4 5 6 7 8 9
legend('spline'); x 10
79
Generate a sine curve and interpolate with Curve generation by
Piecewise cubic Hermite interpolation method.
Program:- x cubic interpolation
1
= 0:10; cubi
0. c
y = sin(x); 8
0.
6
xi = 0.
4
0:.25:10; 0.
2
yi = interp1(x,y,xi,'cubic');
sin(x)
0
plot(x,y,'o',xi,yi); xlabel('x'); -
0.2
ylabel('sin(x)'); -
0.4
-
0.6
title('cubic interpolation '); -
0.8
legend('cubic'); -1
0 1 2 3 4 5 6 7 8 9 10
x
80
To Find the solution to the following set of linear equations by Matrix
method:
2x-3y+4z = 5
x+y+4z = 10
3x+4y-2z = 0
Program:-
clc;
clear all;
A=[2 -3 4; 1 1 4; 3 4 -2];
B=*5 10 0+’;
X=inv(A)*B;
(or)
X=A\B;
81
Write program to calculate the average of the given parameters.
Program:
clc;
clear all;
game1 = input('Enter the points scored in the first game ');
game2 = input('Enter the points scored in the second game ');
game3 = input('Enter the points scored in the third game ');
average = (game1+game2+game3)/3
Solution:
Input:
Enter the points scored in the first game
Enter the points scored in the second game
Enter the points scored in the third game
Output:
average =
82
Write program to calculate the value of the ‘y’ given value of
‘n’
Program:
clc;
clear all;
close
all;
x=
1:1:10;
term = 1./sqrt(x);
y = sum(term);
Solution
: y= 83
Control Structures
84
Control Structures
85
Control Structures
86
Example Program to understand
if statement
% Program to find whether roots are imaginary or not%
clc;
clear all;
a=input('enter value of a:');
b=input('enter value of b:');
c=input('enter value of c:');
discr = b*b - 4*a*c;
if discr < 0
disp('Warning: discriminant is negative, roots are imaginary');
end
Solution:-
Input:
enter value of
a:1 enter value
of b:2 enter
value of c:3
Output:
Warning:
discriminant is
negative, roots 87
are imaginary
Continued…
Program:-
clc;
clear all;
a=input('enter value of a:');
b=input('enter value of b:');
c=input('enter value of c:‘);
discr = b*b - 4*a*c;
if discr < 0
disp('Warning: discriminant is negative, roots are imaginary');
else
disp('Roots are real, but may be repeated')
end
Solution:-
Input:
enter
value of
a:1
enter value of b:3
enter value of c:2
Output:
Roots are real,
but may be
repeated 88
Finding out the roots of quadratic equation ax2+bx+c=0.
Program:-
clear all;
clc;
a=input('Enter values for a:');
b=input('Enter values for b:');
c=input('Enter values for c:');
delta = b^2 - 4*a*c;
if delta < 0
fprintf('\nEquation has no real roots:\n\n')
disp(['discriminant = ', num2str(delta)])
elseif delta == 0
fprintf('\nEquation has one real root:\n')
xone = -b/(2*a)
else
fprintf('\nEquation has two real roots:\n') x(1)
= (-b + sqrt(delta))/(2*a);
x(2) = (-b -sqrt(delta))/(2*a);
fprintf('\n First root = %10.2e\n\t Second root = %10.2f', x(1),x(2)) end
Algorithm:-
Read in values of a, b, c
Calculate Δ
IF Δ < 0
Print message ‘ No real roots’→ Go END
ELSEIF Δ = 0
Print message ‘One real root’→ Go END
ELSE
Print message ‘Two real roots’
END
Solution
:- Input:
Enter values for
a: Enter values for
b: Enter values for
c: Output:
89
Example
Program :-
n = input(‘Enter the upper limit:
‘); if n < 1
disp (‘Your answer is
end meaningless!’) Jump to here if TRUE
term = sqrt(x);
y=
sum(term)
90
Example
Program:-
clc;
clear all;
A=input(‘e
nter the
value of
A: ’);
B=input(‘enter the value of B:’);
if A > B
'A is bigger'
elseif A < B
'B is bigger'
elseif A == B
'A equals B'
else
error('So
mething odd
is
happening')
end
Solutio
n:-
Input:
enter the value of A: 4
91
enter the value of B:
Example of for loop
b.)
Problem: Draw graphs of sin(nπ x) on the interval −1 ≤ x ≤ 1 for n = 1,2,....,8.We could do this by
giving 8 separate plot commands but it is much easier to use a loop.
Program:-
x=-1:0.05:1; 1 1
for n=1:8
0 0
subplot(4,2,n);
-1 -1
plot(x, sin(n*pi*x)); -1 -0.5 0 0.5 1 -0.5 0 0.5 1
-1
end 1 1
0 0
-1 -1
-1 -0.5 0 0.5 1 -0.5 0 0.5 1
-1
1 1
0 0
-1 -1
-1 -0.5 0 0.5 1 -0.5 0 0.5 1
-1
1 1
0 0
-1 -1
-1 -0.5 0 0.5 1 -0.5 0 0.5 1
-1
92
Example of for & while loop
% example of for loop%
Program:-
for ii=1:5
x=ii*ii end
Solution:
1 4 9 16 25
%example of
while loop%
Program:- x
=1
while x <=
10
x = 3*x nd
Solution:
x=1 x=3 x=
9 x=27
93
While Loop EXAMPLES
Program:-
S = 1;
n = 1;
while S+(n+1)^2 < 100
n = n+1;
S = S + n^2;
end
Solution:-
[n,S] = 6 91
94
switch Statement
EXAMPLE
Program:-
n=input(‘enter the value of n: ’);
switch(rem(n,3))
case 0
m = 'no remainder'
case 1
m = ‘the
remainder is one'
case 2
m = ‘the remainder is two'
otherwise
error('not possible')
end
Solution:-
enter the value of
n: 8 m =the remainder
95
is two
Plotting user defined observations of the
theoretical and Experimental
observations
FORMATTING PLOTS
1. Formatting commands.
In this method commands, that make changes or additions to the
plot, are entered after the plot() command. This can be done in
the Command Window, or as part of a program in a script file.
97
FORMATTING COMMANDS
title(‘string’)
Adds the string as a title at the top of the plot.
xlabel(‘string’)
Adds the string as a label to the x-axis.
ylabel(‘string’)
Adds the string as a label to the y-axis.
98
FORMATTING COMMANDS
legend(‘string1’,’string2’,’string3’)
Creates a legend using the strings to label various curves (when
several curves are in one plot). The location of the legend is
specified by the mouse.
text(x,y,’string’)
Places the string (text) on the plot at coordinate x,y relative to the
plot axes.
gtext(‘string’)
Places the string (text) on the plot. When the command executes
the figure window pops and the text location is clicked with the
mouse.
99
Example Program
Light Intensity as a Function of Distance
1200
clc; Theory
clear all; Experiment
1000
x=[10:0.
1:22]; 800
INTENSITY (lux)
y=95000 Comparison between theory and experiment.
./x.^2; 600
xd=[10:
2:22]; 400
yd=[950
200
640 460
340 250
0
180 8 10 12 14 16 18 20 22 24
DISTANCE (cm)
140];
plot(x,y,'-','LineWidth',1.0)
title('\fontname{Arial}Light Intensity as a Function of Distance','FontSize',14)
hold
axis([8on24 0 1200])
plot(xd,yd,'ro--','linewidth',1.0,'markersize',10)
text(14,700,'Comparison between theory and experiment.','EdgeColor','r','LineWidth',2)
hold off
legend('Theory','Experiment',0)
xlabel('DISTANCE (cm)')
ylabel('INTENSITY (lux)')
100
Consider a particle moving in a straight line, and assume that its position is defined by the
equation, where x is expressed in meters and t in seconds. Write a program in MATLAB to
determine the displacement, velocity and acceleration variation with respect to time interval
from 0 to 120 seconds.
Program:-
clc;
clear all;
syms t;
t=0:0.1:
120;
x=6.*t.^
2-t.^3;
v=12.*t-3.*t.^2;
a=12-6.*t;
plot(t,x);
xlabel(‘time in
seconds’);
ylabel(‘displace
ment in m’);
title(‘displacem
ent of a
particle along
its motion’);
%plot(t,v);
%xlabel(‘time 101
in seconds’);
A particle moves along a straight line with variable acceleration. If the displacement is
measured in m, and given by the relation interms of time taken t, as below, determine the
displacement, velocity and acceleration of the particle
S=t3 +2t2+7t+3
Program:-
clc;
clear all;
syms t;
t=0:0.1:120;
x=t.^3+2*t.^2+7.*t+3;
v=3.*t.^2+4.*t+7;
a=6.*t+4;
plot(t,x);
xlabel(‘time in
seconds’);
ylabel(‘displacement
in m’);
title(‘particle behavior
along its motion’);
%plot(t,x,'.'t,v,'o',t,a,'+
'); 102
%xlabel(‘time in
Spring/Mass/Damper system
example
103
107
PROBLEM
SOLV
ED BY
USIN
G
MATL
AB
AND
SIMU
104
LINK
INTRODUCTION
105
PROBLEM
106
PROBLEM
107
Function of the Program
3
displacement in mm
-1
-2
-3
0 5 10 15
time in seconds
110
SIMULINK
112
113
GENERAL FLOW IN SIMULINK
115
119
Simulink- libraries
117
121
Simulink- configuration parameters
118
122
An Introduction to Simulink
Configuration Parameters
Simulink is designed to be a front-
end tool for integrating ordinary
differential equations (ODEs).
119
Connecting blocks
120
Displaying Output
121
122
SIMULINK DESIGN PROCEDURE
123
SIMULINK DESIGN PROCEDURE
124
SIMULINK DESIGN
125
Single degree of freedom system in SIMULINK
126
RESULT
127
DESIGN PROBLEM
129
DEMONSTRATION WITH SIMPLE EXAMPLE
130
SIMULINK DESIGN
131
Test to identify the level of understanding Problem:- By considering nonlinear damping
132
Simulink design
133
STATE SPACE ANALYSIS
m=1;k=2;c=0.5;
134
Continued…
135
Continued…
136
CONVERSIONS IN MATLAB
Transfer function to state space [A,B,C,D]=tf2ss([num],[den]);
137
SOLUTION ATTINMENT MADE EASY BY
LAPLACE TRANSFORM
138
EXAMPLE
139
SIMULINK DESIGN
140
PROBLEM FOR EXAM
141
FIRST STEP
142
SIMULINK DESIGN
143
Problem2
144
Simulink design
145
UNDERSTANDING CONTROL PROBLEM
146
UNDERSTANDING CONTROL PROBLEM
147
PROBLEM (OSCILLATOR)
148
SIMULINK DESIGN
149
EXAMPLE
MODELLING COMPOUND PENDULUM
150
SIMULINK DESIGN
151
UNDERSTANDING STATE SPACE TRANSFORM
152
CONTINUED
…
153
APPLYING STATE SPACE TRANSFORM FOR M-C-K SYSTEM
154
PROCEDURE
155
CONTINUED…
156
SIMULINK DESIGN
157
EXAMPLE
CASCADED M-C-K SYSTEM
158
EXAMPLE
MODEL OF MECHANICAL ACCELEROMETER
159
REAL TIME CHALLENGING PROBLEM Landing gear Suspension schematic
dyin
y yo ys yin
Ys
Y in 160
Force balance
M
Mg Fs Fc
F y Ma Mg Fc
Fs d yo Mg F
2
M dt 2 c
Fs 161
Simulink design
v g
Fc Fs k(y 0 yin ys )
M MF dt
s
dyo
Fc C
dyin
yo dt dt
vdt
1
Y o-Y Fs
in
Yin Ks
1 1
.5
s Mv v =dY s Y0
du/dt .5 o/dt
dY Fc Integrator1 1/M Integrator2 Scope
in/dt
Derivative C
0
Mg
Mg
v =dY
o/dt
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
SELF PRACTISE-1
200
SELF PRACTISE-2
201
INTRODUCTION
TO
SimMechanics
202
Introduction
203
204
NOT JUST
ANIMATION….!
IT DOES LOT OF BACK GROUND
COMPUTATIONAL MECHANICS
WORK
205
Four bar mechanism
206
CONTINUED…
207
SLIDER CRANK MECHANISM
208
Simulation of four cylinder engine
209
Stewart platform simulation
210
Simulink design of stewart platform
211
Landing gear system
212
CONTINUED….
213
simmechanics
CAD models should be saved in STL format
214
Demonstration
of
fou
r
bar
me
ch
ani
sm
215
Sim mechanics design
216
MODELING SIMPLE PENDULUM
217
Sim mechanics design
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
SIMULINK DESIGN
234
235
SIMULINK DESIGN WITH SENSOR @ JOINT
236
237
238
239
240
241
MODELING FOUR BAR MECHANISM
242
243
244
245
SIMULINK DESIGN
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
CONTINUED…
265
266
267
268
SOLUTION OF THE
TEST
PROBLEM
(FOUR BAR
MECHANISM)
269
TEST OF UNDERSTANDING
270
CHALLENGING MINI PROJECT OPEN
TO ALL
271
Hint-1 for designing
s
i
m
u
l
i
n
k
d
e
s
i
g
n
272
Hint-2 for designing simulink design
273
SIMULINK DESIGN
274
SOLUTION
275
CHALLENGING
MINI PROJECT
OPEN
PENDULUM ON
CART
276
Solving by matlab
277
Simulink design
for forward dynamics
278
Forward dynamics By simmechanics
279
Inverse dynamics by
sim mechanics
280
Implementation of control system models with simulink design
281
SIMULATION OF
SIN
GLE
LIN
K
ROB
OT
AR
M
282
283
SIMULINK DESIGN
284
285
286
287
288
289
Elevator system
290
291
292
293
294
295
296
OPEN WEB
RESOURCES
www.mathworks.com/
www.mathtools.net/MATLAB
www.math.utah.edu/lab/ms/matlab/matlab.html
web.mit.edu/afs/athena.mit.edu/software/matlab/
www.utexas.edu/its/rc/tutorials/matlab/
www.math.ufl.edu/help/matlab-tutorial/
www.indiana.edu/~statmath/math/matlab/links.html
www.eng.cam.ac.uk/help/tpl/programs/matlab.html
297
OPEN WEB
RESOURCES
Messner and Tilbury, “Controls Tutorial for MATLAB and SIMULINK: A Web-based
approach,” Prentice-Hall, 1999.
Sigmon and Davis, MATLAB Primer, 6th Edition, CRC Press, 2001
http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/
http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/getstart.pdf
http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/using_ml.pdf
http://www.mathworks.com/access/helpdesk/help/toolbox/control/control.shtml
http://www.mathworks.com/academia/student_version/
http://www.mathworks.com/academia/student_version/companion.html
http://travis.eng.man.ac.uk/barry/control2/lab/SIMULINK.htm
http://matlab.kimhua.co.kr/digest/dec98/nonlinear.html
298
OPEN WEB
RESOURCES
http://www.scsolutions.com/feedback.html
http://www.math.mtu.edu/~msgocken/intro/intro.html
http://www-personal.engin.umich.edu/~tilbury/tutorials/matlab_tutorial.html
http://www.eng.fsu.edu/~cockburn/matlab/matlab_help.html
http://www.engin.umich.edu/group/ctm/working/mac/simulink_basics/
http://www.messiah.edu/acdept/depthome/engineer/Resources/tutorial/matlab/simu.html
http://rclsgi.eng.ohio-state.edu/courses/me780/handouts/simulink.pdf
http://www.mae.ncsu.edu/homepages/buckner/simulink2.pdf
http://www.tutorgig.com/showurls.jsp?group=896&index=0
http://www.rpi.edu/dept/chem-eng/WWW/faculty/bequette/lou/simtut/simtut_html.html
http://www.math.siu.edu/matlab/tutorials.html
299
OPEN WEB
RESOURCES
http://wolfman.eos.uoguelph.ca/~jzelek/matlab/ctms/
http://www.engin.umich.edu/group/ctm/
http://www.me.cmu.edu/matlab/html/
http://www.math.utah.edu/lab/ms/matlab/matlab.html
http://www.indiana.edu/~statmath/math/matlab/
http://spicerack.sr.unh.edu/~mathadm/tutorial/software/matlab/
http://www.math.ufl.edu/help/matlab-tutorial/matlab-tutorial.html
http://www.cs.ubc.ca/spider/cavers/MatlabGuide/guide.html
http://www.class.umd.edu/enme/403/0101/t1.html
http://www.math.mtu.edu/~msgocken/intro/intro.html
http://www.engin.umich.edu/group/ctm
300
OPEN WEB RESOURCES
• Mathworks Information
• Mathworks: http://www.mathworks.com
• Mathworks Central: http://www.mathworks.com/matlabcentral
• http://www.mathworks.com/applications/controldesign/
• http://www.mathworks.com/academia/student_center/tutorials/l
aunchpad.html
• Matlab Demonstrations
• Matlab Overview: A demonstration of the Capabilities of Matlab
http://www.mathworks.com/cmspro/online/4843/req.html?13616
• Numerical Computing with Matlab
http://www.mathworks.com/cmspro/online/7589/req.html?16880
• Select Help-Demos in Matlab
301
OPEN WEB RESOURCES
• Matlab Help
• Select “Help” in Matlab. Extensive help about Matlab, Simulink and toolboxes
• Matlab Homework Helper
http://www.mathworks.com/academia/student_center/homework/
• Newsgroup: comp.soft-sys.matlab
• Matlab/Simulink student version (program and book ~£50)
http://www.mathworks.com/academia/student_center
• Other Matlab and Simulink Books
• Mastering Matlab 6, Hanselman & Littlefield, Prentice Hall
• Mastering Simulink 4, Dabney & Harman, Prentice Hall
• Matlab and Simulink Student Version Release 14
• lots more on mathworks, amazon, …. It is important to
have one reference book.
302
Thank
You…
Any Queries ?
303