Vous êtes sur la page 1sur 73

Coimbatore-642 107

ME2404
COMPUTER AIDED SIMULATION
AND ANALYSIS LABORATORY
LAB MANUAL
VII - SEMESTER
MECHANICAL ENGINEERING

NAME

ROLL NO.

CLASS

CONTENTS
SL.
NO
1

NAME OF THE EXPERIMENT

PAGE
NO.

DATE

SIGN

INTRODUCTION
ANALYSIS

Stress analysis of a plate with a circular hole.

Stress analysis of rectangular L bracket

Stress analysis of an axi-symmetric component

a) Stress Analysis On Cantilever Beam Subjected


To Point Load
b) Stress analysis of simply supported beam.
c) Stress analysis of fixed beam.

Model frequency analysis of 2D component


a) Mode Frequency Analysis Of Cantilever Beam
b) Mode frequency analysis of simply supported
beam
c) Model frequency analysis of fixed beam

Harmonic analysis of a 2D component

Thermal stress analysis of a 2D component

10

Conductive heat transfer analysis of a 2D component

11

Convective heat transfer analysis of a 2D component


SIMULATION

12

Simulation- Introduction

13

Simulation of Hydraulic / Pneumatic cylinder using C


/MAT Lab.
Simulation of Air conditioning system with condenser
temperature and evaporator temperatures as input to get
COP using C /MAT Lab
Simulation of cam and follower mechanism using C
/MAT Lab.

14
15

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

INTRODUCTION to FEA and ANSYS


What is FEA?
Finite Element analysis is a way to simulate loading conditions on a design and
determine the designs response to those conditions.
The design is modeled using discrete building blocks called elements.
Each element has exact equations that describe how it responds to a certain load.
The Sum of the response of all elements in the model gives the total response of
the design.
The elements have a finite number of unknowns, hence the name finite elements.
The finite element model, which has a finite number of unknowns, can only
approximate the response of the physical system which has infinite unknowns.
How good is the approximation?
Unfortunately, there is no easy answer to this question, it depends entirely on what
you are simulating and the tools you use for the simulation.
Why is FEA needed?
To reduce the amount of prototype testing.
Computer Simulation allows multiple what ifscenarios to be tested quickly and
effectively.
To simulate designs those are not suitable for prototype testing. E.g. Surgical Implants
such as an artificial knee.
About ANSYS:
ANSYS is a complete FEA software package used by engineers worldwide in
virtually all fields of engineering. ANSYS is a virtual Prototyping technique used to
iterate various scenarios to optimize the product.
General Procedure of Finite Element Analysis:
1.
2.
3.
4.
5.
6.

Creation of geometry or continuum using preprocessor.


Discretization of geometry or continuum using preprocessor.
Checking for convergence of elements and nodes using preprocessor.
Applying loads and boundary conditions using preprocessor.
Solving or analyzing using solver
Viewing of Results using postprocessor.

Build Geometry:
Construct a two (or) three dimensional representation of the object to be modeled and
tested using the work plane co-ordinate system in Ansys.
Define Material Properties:
Define the necessary material from the library that composes the object model which
includes thermal and mechanical properties.
Generate Mesh:
Now define how the model system should be broken down into finite pieces.
ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

Apply Loads:
The last task in preprocessing is to restrict the system by constraining the
displacement and physical loading.
Obtain Solution:
The solution is obtained using solver available in ANSYS. The computer can
understand easily if the problem is solved in matrices.
Present the Result:
After the solution has been obtained there are many ways to present Ansys result
either in graph or in plot.
Specific Capabilities of ANSYS Structural Analysis:
Structural analysis is probably the most the common application of the finite element
method such as piston, machine parts and tools.
Static Analysis:
It is the used to determine displacement, stress etc. under static loading conditions.
Ansys can compute linear and non-linear types (e.g. the large strain hyper elasticity
and creep problems).
Transient Dynamic Analysis:
It is used to determine the response of a structure to time varying loads.
Buckling Analysis:
It is used to calculate buckling load and to determine the shape of the component after
applying the buckling load. Both linear buckling and non linear buckling analysis
are possible.
Thermal Analysis:
The steady state analysis of any solid under thermal boundary conditions calculates
the effect of steady thermal load on a system (or) component that includes the
following.
a) Convection.
b) Radiation.
c) Heat flow rates.
d) Heat fluxes.
e) Heat generation rates.
f) Constant temperature boundaries.

Fluid Flow:
The ANSYS CFD offers comprehensive tools for analysis of two-dimensional and
three dimensional fluid flow fields.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

Magnetic:
Magnetic analysis is done using Ansys / Electromagnetic program. It can calculate the
magnetic field in device such as power generators, electric motor etc. Interest in
magnetic analysis is finding magnetic flux, magnetic density, power loss and
magnetic forces.
Acoustic / Vibrations:
Ansys is the capable of modeling and analyzing vibration system. Acoustic is the
study of the generation, absorption and reflection of pressure waves in a fluid
application.
Few examples of acoustic applications are
a) Design of concert house, where an even distribution of sound pressure is
possible.
b) Noise cancellation in automobile.
c) Underground water acoustics.
d) Noise minimization in machine shop.
e) Geophysical exploration.
Coupled Fields:
A coupled field analysis is an analysis that takes into account the interation
between two (or) more fields of engineering analysis. Pressure vessels,
Induction heating and Micro electro mechanical systems are few examples.

Result: Thus the basics of FEA and ANSYS are studied.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

Ex.No:1

STRESS ANALYSIS OF A PLATE WITH A CIRCULAR HOLE

Aim
To perform stress analysis of a plate with a circular hole.
Procedure
1. Utility Menu > Change Job Name > Enter Job Name.
Utility Menu > File > Change Title > Enter New Title.
2. Preference > Structural > OK.
3. Preprocessor > Element Type > Add/Edit/Delete > Solid Quad 4Node 42 >
Select > Options > Plane Stress/Thickness.
4. Preprocessor > Material Properties > Material Model > Structural > Linear >
Elastic > Isotropic > EX = 2E5, PRXY = 0.3.
5. Preprocessor > Real Constant > Add/Edit/Delete > plane 42> thickness = 10
6. Preprocessor > Modeling > Create > Areas > Rectangular by Dimension >
X1, X2 = 0, 50
Y1, Y2 = 0, 50.
7. Preprocessor > Modeling > Create > Areas > Circle > Solid circle > WP X = 0, WP
Y = 50 & Radius = 10 > OK.
8. Preprocessor > Modeling > Create > Subtract > Areas > Select rectangle >Apply >
Select Circle > Ok.
9. Preprocessor > Meshing > Element Edge Length = 2 > Mesh > Areas > Free.
10. Solution > Analysis Type > New Analysis > Static > OK.
11. Solution > Define Load > Apply > Structural > Displacement > On lines > Select
Bottom Line > UY > Displacement value = 0 > OK.
10. Solution > Define Load > On Lines > Select left line > Ok > UX > Displacement
value = 0 > OK.
11. Solution > Pressure > On Line > Select Right line > Ok > Value [100] > Ok.
12. Solution > Solve > Current LS > Ok.
13. Utility menu > Plot control > Style > Symmetry Expansion > Periodic > Reflect
about XY.
14. Plot control > Animate > deformed shape > Ok.
13. General Postprocessor > Plot Result > Deformed shape > Ok.
14. Plot Result > Plot Result > Contour Plot > Nodal Solution > Stress > Von Mises >
Ok.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

Result:
Thus the stress analysis of a plate with a circular hole is performed.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

EX.NO:2

STRESS ANALYSIS OF RECTANGULAR L - BRACKET

Aim
To perform stress analysis of rectangular L- bracket and to determine the maximum stress
and maximum deflection.
Procedure
1. Utility Menu > Change Job Name > Enter Job Name.
Utility Menu > File > Change Title > Enter New Title.
2. Preference > Structural > OK.
3. Preprocessor > Element Type > Add/Edit/Delete > Solid Quad 8Node 42 >
Select > Options > Plane Stress/Thickness.
4. Preprocessor > Material Properties > Material Model > Structural > Linear >
Elastic > Isotropic > EX = 2E5, PRXY = 0.3.
5. Preprocessor > Real Constant > Add/Edit/Delete > plane 42> thickness = 12.

6. Preprocessor > modeling > create > Area > rectangle > centre & corner
WP X = 25
WP Y = 0
Width = 150
Height = 50
Apply
WP X = 125
WP Y = -75
Width = 50
Height = 100
Ok
7. Preprocessor > modeling > create > Areas > circle > solid circle >
WP X = 0
WP Y = 0
Radius = 25
Apply
WP X = 125
WP Y = -75, Radius = 25 > Ok
8. Preprocessor > modeling > operate > Booleans > Add > Areas > pick all
9. Preprocessor > modeling > create > line > line fillet > select 2 lines > fillet radius =
10 > Ok.
10. Preprocessor > modeling > create > Areas > Arbitrary > By lines > select the three
lines.
11. Preprocessor > modeling > create > Area > circle > solid circle >
WP X = 0
ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

WP Y = 0
Radius = 10
Apply
WP X = 125
WP Y = -75
Radius = 10
Ok.
12. Preprocessor > modeling > operate > Booleans > Subtract > Areas > Select the
rectangle > Apply > select two circles > Ok.
13. Preprocessor > meshing > mesh tool > size control > Areas > Element edge length
= 2 mm > Ok > mesh > Areas > free> pick all.
14. Solution > define loads > apply > Structural > displacement > online > select the
left hole (Inside) > apply > All DOF > Displacement value = 0 > ok.
15. Solution > pressure > on line > pick all (Select bottom left of the circle> apply.
Load value = 50; optional value = 25 > apply
16. Solution > pressure > on line > pick all (Select bottom right of the circle> apply.
Load value = 25; optional value = 50 > apply
17. Solution > solve current LS > ok
18. General post processor > plot result > Deformed shaped > Deformed +
Undeformed > Ok.
18. General post processor > plot result > contour plot > nodal solution > stress > von
mises > Ok.
19. List result > reaction solution > Ok

Result:
Thus the stress analysis of rectangular L-bracket with circular hole is obtained.
(i)
Maximum stress = 851.518 N/mm2
(ii)
Maximum deflection = 1.359 mm.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

EX.NO:3

STRESS ANALYSIS OF AN AXI SYMMETRIC COMPONENT

Aim
To obtain the stress distribution of an axisymmetric component. The model will be that of a
closed tube made from steel. Point loads will be applied at the centre of the top and bottom plate.
Procedure
1. Utility Menu > Change Job Name > Enter Job Name.
Utility Menu > File > Change Title > Enter New Title.
2. Preference > Structural > OK.
3. Preprocessor > Element type > Add/Edit/ delete > solid 8node 183 > options>
axisymmetric.
4. Preprocessor > Material Properties > Material Model > Structural > Linear >
Isotropic > EX = 2E5, PRXY = 0.3.

Elastic >

5. Preprocessor>Modeling>create>Areas>Rectangle> By dimensions
Rectangle
1
2
3

X1
0
15
0

X2
20
20
20

Y1
0
0
95

Y2
5
100
100

6. Preprocessor > Modeling > operate > Booleans > Add > Areas > pick all > Ok.
7. Preprocessor > meshing > mesh tool > size control > Areas > Element edge length = 2 mm
> Ok > mesh > Areas > free> pick all.
8. Solution > Analysis Type>New Analysis>Static
9. Solution > Define loads > Apply .Structural > displacement > symmetry B.C > on lines.
(Pick the two edger on the left at X = 0)
10. Utility menu > select > Entities > select all
11. Utility menu > select > Entities > by location > Y = 50 >ok.
(Select nodes and by location in the scroll down menus. Click Y coordinates and type 50 in to
the input box.)
12. Solution > Define loads > Apply > Structural > Force/Moment > on key points > FY >
100 > Pick the top left corner of the area > Ok.
13. Solution > Define Loads > apply > Structural > Force/moment > on key points > FY >
-100 > Pick the bottom left corner of the area > ok.
14. Solution > Solve > Current LS
15. Utility Menu > select > Entities
16. Select nodes > by location > Y coordinates and type 45, 55 in the min., max. box, as
shown below and click ok.
ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

17. General postprocessor > List results > Nodal solution > stress > components SCOMP.
18. Utility menu > plot controls > style > Symmetry expansion > 2D Axisymmetric >
expansion

Result:
Thus the stress distribution of the axisymmetric component is studied.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

10

Ex. No: 4 (a)

STRESS ANALYSIS ON CANTILEVER BEAM SUBJECTED TO POINT LOAD

Aim:
To obtain stress analysis of cantilever beam subjected to point load and to determine max. stress and
max. deflection.
Procedure:
1. Utility Menu > Change Job Name > Enter Job Name.
Utility Menu > File > Change Title > Enter New Title.
2. Preference > Structural > OK.
3. Preprocessor > Element type > Add/Edit/ delete > beam > 2D elastic 3 > close.
4. Preprocessor > Real Constant > Add/Edit/Delete > Area = 100, Izz = 833.33 &
Height = 10 > Ok
5. Preprocessor > Material Properties > Material Model > Structural > Linear >
Elastic > Isotropic > EX = 2E5, PRXY = 0.3.
6. Preprocessor > Modeling > create > nodes > Inactive CS
Node 1
X=0
Y=0
Node 2
X= 20
Y=0
Node 3
X= 40
Y=0
Node 4
X= 60
Y=0
Node 5
X= 80
Y=0
Node 6
X= 100
Y=0
7. List > nodes > coordinate only > ok
8. Preprocessor > modeling > create > elements > Auto numbered thru nodes > select
Node 1 & 2
Node 2 & 3
Node 3 & 4
Node 4 & 5
Node 5 & 6 > ok.
ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

11

9. Solution > define loads > apply > structural > displacement > on nodes > select node 1 >
apply > all DOF > displacement = 0 > ok.
10. Solution > Force/moment > on nodes > node 6 > apply > FY > -100 > ok.
11. Solution > solve > current L.S > ok.
12. General post processor > plot result > deform shape > Deformed + Undeformed > ok.
13. General post processor > element table > define table > add > user table for item
Smax I > by sequence num > NMISC 1 > apply
Smax J > by sequence num > NMISC 3 > apply
Smin I > by sequence num > NMISC 2 > apply
Smin J > by sequence num > NMISC 4 > Ok.
14. Plot result > line element result > Smax I > Smax J > first result >Evaluate table data > Smax
I, Smax J, Smin I, Smin J > Ok.
15. General postprocessor > list result > nodal solution > DOF solution > UY > displacement
result ( Table 2)
16. General postprocessor > contour plot > line element res. > Ok.

Table 1: Element Stresses


S.No.
1
2
3
4
5

SMAXI
N/mm2
600
480
360
240
120

SMAXJ
N/mm2
480
360
240
120
0.1746e-11

SMINI
N/mm2
-600
-480
-360
-240
-120

SMINI
N/mm2
-480
-360
-240
-120
0.1746e +11

Table 2: Displacement Deflection


Nodes
1
2
3
4
5
6

UY
0
-1.0667 e-01
-0.39619 e-01
-0.82286 e-01
-0.13410
-0.19048

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

12

Result:
Thus the stress analysis on cantilever beam subjected point load is performed.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

13

Ex. No: 4(b)

STRESS ANALYSIS OF SIMPLY SUPPORTED BEAM.

Aim:
To perform Stress analysis of simply supported beam.
Procedure:
1. Utility Menu > Change Job Name > Enter Job Name.
Utility Menu > File > Change Title > Enter New Title.
2. Preference > Structural > OK.
3. Preprocessor > Element type > Add/Edit/ delete > beam > 2D elastic 3> close.
4. Preprocessor > Real Constant > Add/Edit/Delete > Area = 100, Izz = 833.33 & Height =
10 > Ok
5. Preprocessor > Material Properties > Material Model > Structural > Linear >
Isotropic > EX = 2E5, PRXY = 0.3.

Elastic >

6. Preprocessor > Modeling > create > nodes > Inactive CS


Node 1
X=0
Y=0
Node 2
X= 25
Y=0
Node 3
X= 50
Y=0
Node 4
X= 75
Y=0
Node 5
X= 100
Y=0
17. List > nodes > coordinate only > ok
18. Preprocessor > modeling > create > elements > Auto numbered thru nodes > select
Node 1 & 2
Node 2 & 3
Node 3 & 4
Node 4 & 5
Node 5 & 6 > ok.
Solution > define loads > apply > structural > displacement > on nodes > select node 1 & node 5
> apply > UY > displacement = 0 > ok.
19. Solution > Force/moment > on nodes > node 3 > apply > FY > -100 > ok.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

14

20. Solution > solve > current L.S > ok.


21. General post processor > plot result > deform shape > Deformed + Undeformed > ok.
22. General post processor > element table > define table > add > user table for item
Smax I > by sequence num > NMISC 1 > Apply
Smax J > by sequence num > NMISC 3 > Apply
Smin I > by sequence num > NMISC 2 > apply
Smin J > by sequence num > NMISC 4 > Ok.
23. Plot result > line element result > Smax I > Smax J > first result >Evaluate table data >
Smax I, Smax J, Smin I, Smin J > Ok.
24. General postprocessor > list result > nodal solution > DOF solution > UY > displacement
result ( Table 2)
25. General postprocessor > contour plot > line element res. > Ok.
Table 1: Element Stresses
S.No.
1
2
3
4
5

SMAXI
N/mm2
0.5457 e-14
7.5
15
15
7.5

SMAXJ
N/mm2
7.5
15
7.5
7.5
0

SMINI
N/mm2
- 0.5457 e-14
-7.5
-15
-15
-7.5

SMINI
N/mm2
-7.5
-15
-7.5
-7.5
0

Table 2: Displacement Deflection


Nodes
1
2
3
4

UY
0
-0.81846 e-2
-0.11905 e-1
-0.81846 e-2

Result:
Thus the stress analysis of simply supported beam is obtained.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

15

Ex. No: 4(c)

STRESS ANALYSIS OF FIXED BEAM

Aim:
To perform stress analysis of fixed beam subjected to point load.
Procedure:
1. Utility Menu > Change Job Name > Enter Job Name.
Utility Menu > File > Change Title > Enter New Title.
2. Preference > Structural > OK.
3. Preprocessor > Element type > Add/Edit/ delete > beam > 2D elastic 3> close.
4. Preprocessor > Real Constant > Add/Edit/Delete > Area = 100, Izz = 833.33 & Height =
10 > Ok
5. Preprocessor > Material Properties > Material Model > Structural > Linear >
Isotropic > EX = 2E5, PRXY = 0.3.

Elastic >

6. Preprocessor > Modeling > create > nodes > Inactive CS


Node 1
X=0
Y=0
Node 2
X= 25
Y=0
Node 3
X= 50
Y=0
Node 4
X= 75
Y=0
Node 5
X= 100
Y=0
7. List > nodes > coordinate only > ok
8. Preprocessor > modeling > create > elements > Auto numbered thru nodes > select
Node 1 & 2
Node 2 & 3
Node 3 & 4
Node 4 & 5
Node 5 & 6 > ok.
9. Solution > define loads > apply > structural > displacement > on nodes > select node 1 &
node 5 > apply > all DOF > displacement = 0 > ok.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

16

10. Solution > Force/moment > on nodes > node 3 > apply > FY > -100 > ok.
11. Solution > solve > current L.S > ok.
12. General post processor > plot result > deform shape > Deformed + Undeformed > ok.
13. General post processor > element table > define table > add > user table for item
Smax I > by sequence num > NMISC 1 > apply
Smax J > by sequence num > NMISC 3 > apply
Smin I > by sequence num > NMISC 2 > apply
Smin J > by sequence num > NMISC 4 > Ok.
14. Plot result > line element result > Smax I > Smax J > first result >Evaluate table data >
Smax I, Smax J, Smin I, Smin J > Ok.
15. General postprocessor > list result > nodal solution > DOF solution > UY > displacement
result ( Table 2)
16. General postprocessor > contour plot > line element res. > Ok.

S.No.
1
2
3
4

SMAXI
N/mm2
7.503
0.104 e-14
7.503
0

Table 1: Element Stresses


SMAXJ
SMINI
N/mm2
N/mm2
0
-7.503
7.503
-0.104 e-14
0
-7.503
7.503
0

SMINI
N/mm2
0
-7.503
0
-7.503

Table 2: Displacement Deflection


Nodes
UY
1
0
2
-0.14887 e-2
3
-0.20174 e-2
4
-0.14887 e-2
5
0
Result:
Thus the stress analysis of fixed beam is obtained.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

17

Ex. No: 5

MODE FREQUENCY ANALYSIS OF 2D PLATE

Aim:
To perform the model frequency analysis on 2D plate.
Procedure:
1. Utility Menu > Change Job Name > Enter Job Name.
Utility Menu > File > Change Title > Enter New Title.
2. Preference > Structural > OK.
3. Preprocessor > Element type > Add/Edit/ delete > Solid 8node 82 > options > plane stress
with thickness > close.
4. Preprocessor > Real Constant > Add/Edit/Delete > thickness = 1 > Ok
5. Preprocessor > Material Properties > Material Model > Structural > Linear >
Isotropic > EX = 2.068 E5, PRXY = 0.3 & Density = 7.83E-6.

Elastic >

6. Preprocessor>Modeling>create>Areas>Rectangle> By dimensions
0, 250
0, 75
7. Preprocessor > meshing > mesh tool > size control > Areas > Element edge length = 15
mm > Ok > mesh > Areas > free> pick all.
8. Solution > Analysis Type > New Analysis > modal > OK.
9. Solution > Analysis option > sub space > Ok.
5, 5
10. Solution > define load > apply > structural > displacement > on lines > select left side
line > all DOF > Ok.
11. Solve > current L.S > close
12. General postprocessor > result summary.
13. General postprocessor > first set > plot result > deform shape > deformed + undeformed
> next set > plot result > deformed + undeformed > Ok.
Table :
Load Sub
S.No. Time/Frequency
Cumulation
Shape step
1
0.93693
1
1
1
2
4.4734
1
2
2
3
5.1535
1
3
3
4
9.9837
1
4
4
5
15.345
1
5
5
Result:
Thus the modal frequency analysis on 2D element is performed.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

18

Ex. No: 6(a)

MODE FREQUENCY ANALYSIS OF CANTILEVER BEAM

Aim:
To obtain the mode frequency analysis on Cantilever beam and to determine its natural
frequency.
Procedure:
1. Utility Menu > Change Job Name > Enter Job Name.
Utility Menu > File > Change Title > Enter New Title.
2. Preference > Structural > OK.
3. Preprocessor > Element type > Add/Edit/ delete > beam > 2D elastic 3> close.
4. Preprocessor > Real Constant > Add/Edit/Delete > Area = 100, Izz = 833.33 & Height =
10 > Ok.
5. Preprocessor > Material Properties > Material Model > Structural > Linear > Elastic >
Isotropic > EX = 2.068 E5, PRXY = 0.3 & Density = 7.83E-6.
6. Preprocessor > Modeling > create > key points > inactive CS
Key point no.1 = (0, 0)
Key point no.2 = (1000, 0)
7. Preprocessor > Modeling > create > lines > straight lines > select 1&2.
8. Meshing > mesh tool > lines > Element edge length > = 100 mm > mesh > pick all
9. Solution > analysis type > new analysis > modal > ok > analysis options > subspace = 5 >
ok.
10. Solution > define loads > apply > structural > displacement > on key points > select first
point > apply > all DOF > displacement = 0 > Ok.
11. Solve > current L.S > close
12. General postprocessor > result summary.
13. General postprocessor > read result > first set > Ok.

14. General postprocessor > plot result > deform shape > deformed + undeformed > Ok.
15. General postprocessor > plot control > animate > modal shape.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

19

Table :
S.No.

Time/Frequency

1
2
3
4
5

8.3
52.011
145.64
285.51
427.54

Load Sub
Cumulation
Shape step
1
1
1
1
2
2
1
3
3
1
4
4
1
5
5

Result:
Thus the mode frequency analysis of Cantilever beam is obtained.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

20

Ex. No: 6(b) MODE FREQUENCY ANALYSIS OF SIMPLY SUPPORTED BEAM


Aim:
To perform the model frequency analysis on simply supported beam.
Procedure:
1. Utility Menu > Change Job Name > Enter Job Name.
Utility Menu > File > Change Title > Enter New Title.
2. Preference > Structural > OK.
3. Preprocessor > Element type > Add/Edit/ delete > beam > 2D elastic 3 > close.
4. Preprocessor > Real Constant > Add/Edit/Delete > Area = 100, Izz = 833.33 & Height =
10 > Ok.
5. Preprocessor > Material Properties > Material Model > Structural > Linear > Elastic >
Isotropic > EX = 2.068 E5, PRXY = 0.3 & Density = 7.83E-6.
6. Preprocessor > Modeling > create > key points > inactive CS
Key point no.1 = (0, 0)
Key point no.2 = (1000, 0)
7. Preprocessor > Modeling > create > lines > straight lines > select 1&2.
8. Meshing > mesh tool > lines > Element edge length > = 100 mm > mesh > pick all
9. Solution > analysis type > new analysis > modal > ok > analysis options > subspace
> ok.

=5

10. Solution > define loads > apply > structural > displacement > on key points > select first
point & second point > apply > UY > displacement = 0 > Ok.
11. Solve > current L.S > close
12. General postprocessor > result summary.
13. General postprocessor > read result > first set > Ok.

14. General postprocessor > plot result > deform shape > deformed + undeformed > Ok.
15. General postprocessor > plot control > animate > modal shape.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

21

Table :

S.No.

Time/Frequency

1
2
3
4
5

0
23.298
93.191
209.73
373.16

Load Sub
Cumulation
Shape step
1
1
1
1
2
2
1
3
3
1
4
4
1
5
5

Result:
Thus the mode frequency analysis of simply supported beam is obtained.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

22

Ex. No: 6(c)

MODEL FREQUENCY ANALYSIS OF FIXED BEAM.

Aim:
To perform the model frequency analysis on Fixed beam.
Procedure:
1. Utility Menu > Change Job Name > Enter Job Name.
Utility Menu > File > Change Title > Enter New Title.
2. Preference > Structural > OK.
3. Preprocessor > Element type > Add/Edit/ delete > beam > 2D elastic 3> close.
4. Preprocessor > Real Constant > Add/Edit/Delete > Area = 100, Izz = 833.33 & Height =
10 > Ok.
5. Preprocessor > Material Properties > Material Model > Structural > Linear > Elastic >
Isotropic > EX = 2.068 E5, PRXY = 0.3 & Density = 7.83E-6.
6. Preprocessor > Modeling > create > key points > inactive CS
Key point no.1 = (0, 0)
Key point no.2 = (1000, 0)
7. Preprocessor > Modeling > create > lines > straight lines > select 1&2.
8. Meshing > mesh tool > lines > Element edge length > = 100 mm > mesh > pick all
9. Solution > analysis type > new analysis > modal > ok > analysis options > subspace
> ok.

=5

10. Solution > define loads > apply > structural > displacement > on key points > select first
point & second point > apply > all DOF > displacement = 0 > Ok.
11. Solve > current L.S > close
12. General postprocessor > result summary.
13. General postprocessor > read result > first set > Ok.

14. General postprocessor > plot result > deform shape > deformed + undeformed > Ok.
15. General postprocessor > plot control > animate > modal shape.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

23

Table:
S.No.

Time/Frequency

1
2
3
4
5

52.815
145.60
282.58
427.71
708.05

Load Sub
Cumulation
Shape step
1
1
1
1
2
2
1
3
3
1
4
4
1
5
5

Result:
Thus the mode frequency analysis on fixed beam is performed.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

24

Ex. No: 7

HARMONIC ANALYSIS ON 2D PLATE

Aim:
To perform the harmonic analysis on 2D plate. We conduct a harmonic forced response test
by applying a cyclic load at the end of the plate.
Procedure:
1. Utility Menu > Change Job Name > Enter Job Name.
Utility Menu > File > Change Title > Enter New Title.
2. Preference > Structural > OK.
3. Preprocessor > Element type > Add/Edit/ delete > Solid 8node 82 > options > plane stress
with thickness > close.
4. Preprocessor > Real Constant > Add/Edit/Delete > thickness = 1 > Ok
5. Preprocessor > Material Properties > Material Model > Structural > Linear >
Isotropic > EX = 2.068 E5, PRXY = 0.3 & Density = 7.83E-6.

Elastic >

6. Preprocessor>Modeling>create>Areas>Rectangle> By dimensions
0, 250
0, 75
7. Preprocessor > meshing > mesh tool > size control > Areas > Element edge length = 15
mm > Ok > mesh > Areas > free> pick all.
8. Solution > Analysis Type > New Analysis > harmonic > OK > analysis options > real +
imaginary (full solution method).
9. Solution > define loads > apply > structural > force/moment > on nodes > click right
corner > FY real value = 100 & Imaginary value = 0 > Ok.
10. Solve > current L.S > ok.
11. Load step option > time frequency > frequency & sub steps > 0,200 > 200 > stepped >
Ok.
12. Time history postprocessor > variable viewer > add > nodal solution > DOF solution > Ycomponent of displacement > click right corner > ok > graph data > Ok.
13. Utility Menu > plot controls > style > graphs > modify axis ( change the Y-axis scale to
logarithmic)
14. Utility menu > plot > replot.
Result:
Thus the harmonic analysis on 2D plate is performed.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

25

Ex. No: 8

THERMAL STRESS ANALYSIS OF A 2D COMPONENT

Aim:
To perform the thermal stress analysis of a 2D component.
Procedure:
1. Preference > thermal > Ok.
2. Preprocessor > Element type > Add/edit /delete > LINK33 (Thermal Mass Link 3D
conduction) > close.
3. Preprocessor > real constant > add > Area = 4e-4
4. Preprocessor > material properties > Material Models > Thermal conductivity > Isotropic
> KXX: 60.5
5. Preprocessor > Modeling > Create > Keypoints > In Active CS...
Keypoint Coordinates (x, y)
1
(0,0)
2
(1,0)
6. Preprocessor > modeling > create > lines > lines > In active coordinate system > select 1
& 2.
7. Preprocessor > Meshing > Mesh tool > Size Controls > Manual Size > element edge
length = 0.1 > mesh > Areas > Free > Pick All
8. Preprocessor > Physics > Environment > Write In the window that appears, enter the
TITLE Thermal and click OK.
9. Preprocessor > Physics > Environment > Clear > OK
10. Preprocessor > Element Type > Switch Elem Type (Choose Thermal to Structural
from the scroll down list.)
11. Preprocessor > Material Properties > Material Models > Structural > Linear > Elastic >
Isotropic > EX: 200e9, PRXY: 0.3
12. Preprocessor > Material Props > Material Models > Structural > Thermal Expansion
Coefficient > Isotropic > ALPX = 12e-6
13. Preprocessor > Physics > Environment > Write > In the window that appears, enter the
TITLE Struct.
14. Solution > Analysis Type > New Analysis > Static
15. Solution > Physics > Environment > Read > Choose thermal and click OK.
(If the Physics option is not available under Solution, click Unabridged Menu at the bottom of the
Solution menu. This should make it visible).

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

26

16. Solution > Define Loads > Apply > Thermal > Temperature > On Keypoints > Set the
temperature of Keypoint 1, the left-most point, to 348 Kelvin.
17. Solution > Solve > Current LS
18. Main Menu > Finish
The thermal solution has now been obtained. If you plot the steady-state temperature on the
link, you will see it is a uniform 348 K, as expected. This information is saved in a file
labelled Jobname.rth, were .rth is the thermal results file. Since the jobname wasn't changed
at the beginning of the analysis, this data can be found as file.rth. We will use these results in
determining the structural effects.
19. Solution > Physics > Environment > Read
Choose struct and click OK.
20. Solution > Define Loads > Apply > Structural > Displacement > On Keypoints > Fix
Keypoint 1 for all DOF's and Keypoint 2 in the UX direction.
21. Solution > Define Loads > Apply > Structural > Temperature > From Thermal Analysis
As shown below, enter the file name File.rth. This couple the results from the
solution of the thermal environment to the information prescribed in the structural
environment and uses it during the analysis.
22. Preprocessor > Loads > Define Loads > Settings > Reference Temp
For this set the reference temperature to 273 degrees Kelvin
23. Solution > Solve > Current LS
24. General Postprocessor > Element Table > Define Table > Add > CompStr > By Sequence
Num > LS > LS, 1.
25. General Postprocessor > Element Table > List Elem Table > COMPSTR > Ok.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

27

1. Hand Calculations
Hand calculations were performed to verify the solution found using ANSYS:

As shown, the stress in the link should be a uniform 180 MPa in compression.

Result:
Thus the thermal stress analysis of 2D component is performed and the stress in each element ranges
from -0.180e9 Pa, or 180 MPa in compression.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

28

Ex. No: 9

CONDUCTIVE HEAT TRANSFER ANALYSIS OF 2D COMPONENT

Aim:
This tutorial was created to solve a simple conduction problem. The thermal conductivity (k)
of the material is 10 w/m C and the block is assumed to be infinitely long.
Procedure:
1. Preference > thermal > Ok.
2. Preprocessor > Element type > Add/edit /delete > Select thermal mass solid, Quad 4 node
55 (Plane 55) > close.

3. Preprocessor > material properties > Material Models > Thermal conductivity > Isotropic
> KXX = 10 (thermal Conductivity )
4. Preprocessor > modeling > create > Areas > Rectangle > By 2 Corners > X = 0, Y = 0,
width = 1, Height = 1 > Ok.
5. Preprocessor > Meshing > Mesh tool > Size Controls > Manual Size > element edge
length = 0.05 > mesh > Areas > Free > Pick All
6. Solution > Analysis type > New analysis > steady state > Ok.
7. Solution > Define loads > Apply > Thermal > Temperature > On nodes
a. Click the box option and draw a box around the nodes on the top line.
b. Fill the window in as shown to constrain the side to a const. temperature of 500.
c. Using the same method, constrain the remaining 3 sides to a constant value of
100.
8. Solution > solve > Current LS.
9. General Preprocessor > Plot results > Contour Plot > Nodal Solution > DOF solution >
nodal temperature (TEMP) > Ok.

Result:
Thus conductive heat transfer analysis is performed.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

29

Ex. No: 10

CONVECTIVE HEAT TRANSFER ANALYSIS OF 2D COMPONENT

Aim:
To perform the thermal analysis on a given block with convective heat transfer coefficient (h)
of 10 W/m C and the thermal conductivity (k) of the material is 10 W/m C.
Procedure:
1. Preference > thermal > Ok.
2. Preprocessor > Element type > Add/edit /delete > Select thermal mass solid, Quad 4 node
55 (Plane 55) > close.

3. Preprocessor > material properties > Material Models > Thermal conductivity > Isotropic
> KXX = 10 (thermal Conductivity )
4. Preprocessor > modeling > create > Areas > Rectangle > By 2 Corners > X = 0, Y = 0,
width = 1, Height = 1 > Ok.
5. Preprocessor > Meshing > Mesh tool > Size Controls > Manual Size > element edge
length = 0.05 > mesh > Areas > Free > Pick All
6. Solution > Analysis type > New analysis > steady state > Ok.
7. Solution > Define loads > Apply > Thermal > Temperature > on lines > click the top of
the rectangular box > temperature > 500 > apply > click the left side of the rectangular
box > ok > temperature > 100 > Ok.
8. Solution > Define loads > Apply > Thermal > convection > on lines > click the right side
of the rectangular box > Ok.
9. Solve > current L.S > Ok.
10. General Preprocessor > Plot results > Contour Plot > Nodal Solution > DOF solution >
nodal temperature (TEMP) > Ok.

Result:
Thus convective heat transfer analysis is performed.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

30

MATLAB-Overview of the MATLAB Environment


The MATLAB high-performance language for technical computing integrates computation,
visualization, and programming in an easy-to-use environment where problems and solutions are
expressed in familiar mathematical
notation. Typical uses include
Math and computation
Algorithm development
Data acquisition
Modeling, simulation, and prototyping
Data analysis, exploration, and visualization
Scientific and engineering graphics
Application development,
Including graphical user interface building MATLAB is an interactive system whose basic data
element is an array that does not require dimensioning. It allows you to solve many technical
computing problems, especially those with matrix and vector formulations, in a fraction of the time it
would take to write a program in a scalar noninteractive language such as C or FORTRAN.
The name MATLAB stands for matrix laboratory. MATLAB was originally written to provide easy
access to matrix software developed by the LINPACK and EISPACK projects. Today, MATLAB
engines incorporate the LAPACK and BLAS libraries, embedding the state of the art in software for
matrix computation.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

31

SIMULINK
INTRODUCTION:
Simulink is a graphical extension to MATLAB for modeling and simulation of systems. In
Simulink, systems are drawn on screen as block diagrams. Many elements of block diagrams are
available, such as transfer functions, summing junctions, etc., as well as virtual input and output
devices such as function generators and oscilloscopes. Simulink is integrated with MATLAB and
data can be easily transferred between the programs. In these tutorials, we will apply Simulink to the
examples from the MATLAB tutorials to model the systems, build controllers, and simulate the
systems. Simulink is supported on Unix, Macintosh, and Windows environments; and is included in
the student version of MATLAB for personal computers.
The idea behind these tutorials is that you can view them in one window while running Simulink in
another window. System model files can be downloaded from the tutorials and opened in Simulink.
You will modify and extend these system while learning to use Simulink for system modeling,
control, and simulation. Do not confuse the windows, icons, and menus in the tutorials for your
actual Simulink windows. Most images in these tutorials are not live - they simply display what you
should see in your own Simulink windows. All Simulink operations should be done in your Simulink
windows.
1.
2.
3.
4.
5.

Starting Simulink
Model Files
Basic Elements
Running Simulations
Building Systems

Starting Simulink
Simulink is started from the MATLAB command prompt by entering the following command:
>> Simulink
Alternatively, you can hit the Simulink button at the top of the MATLAB window as shown below:

When it starts, Simulink brings up the Simulink Library browser.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

32

Open the modeling window with New then Model from the File menu on the Simulink
Library Browser as shown above.
This will bring up a new untitiled modeling window shown below.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

33

Model Files
In Simulink, a model is a collection of blocks which, in general, represents a system. In addition to
drawing a model into a blank model window, previously saved model files can be loaded either from
the File menu or from the MATLAB command prompt.
You can open saved files in Simulink by entering the following command in the MATLAB
command window. (Alternatively, you can load a file using the Open option in the File menu in
Simulink, or by hitting Ctrl+O in Simulink.)
>> filename
The following is an example model window.

A new model can be created by selecting New from the File menu in any Simulink window (or by
hitting Ctrl+N).

Basic Elements
There are two major classes of items in Simulink: blocks and lines. Blocks are used to generate,
modify, combine, output, and display signals. Lines are used to transfer signals from one block to
another.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

34

Blocks
There are several general classes of blocks:

Continuous
Discontinuous
Discrete
Look-Up Tables
Math Operations
Model Verification
Model-Wide Utilities
Ports & Subsystems
Signal Attributes
Signal Routing
Sinks: Used to output or display signals
Sources: Used to generate various signals
User-Defined Functions
Discrete: Linear, discrete-time system elements (transfer functions, state-space models, etc.)
Linear: Linear, continuous-time system elements and connections (summing junctions, gains,
etc.)
Nonlinear: Nonlinear operators (arbitrary functions, saturation, delay, etc.)
Connections: Multiplex, Demultiplex, System Macros, etc.

Blocks have zero to several input terminals and zero to several output terminals. Unused input
terminals are indicated by a small open triangle. Unused output terminals are indicated by a small
triangular point. The block shown below has an unused input terminal on the left and an unused
output terminal on the right.

Lines
Lines transmit signals in the direction indicated by the arrow. Lines must always transmit signals
from the output terminal of one block to the input terminal of another block. One exception to this is
a line can tap off of another line, splitting the signal to each of two destination blocks, as shown
below.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

35

Lines can never inject a signal into another line; lines must be combined through the use of a block
such as a summing junction.
A signal can be either a scalar signal or a vector signal. For Single-Input, Single-Output systems,
scalar signals are generally used. For Multi-Input, Multi-Output systems, vector signals are often
used, consisting of two or more scalar signals. The lines used to transmit scalar and vector signals are
identical. The type of signal carried by a line is determined by the blocks on either end of the line.
Simple Example

The simple model (from the model files section) consists of three blocks: Step, Transfer Fcn, and
Scope. The Step is a source block from which a step input signal originates. This signal is transferred
through the line in the direction indicated by the arrow to the Transfer Function linear block. The
Transfer Function modifies its input signal and outputs a new signal on a line to the Scope. The
Scope is a sink block used to display a signal much like an oscilloscope.
There are many more types of blocks available in Simulink, some of which will be discussed later.
Right now, we will examine just the three we have used in the simple model.

Modifying Blocks
A block can be modified by double-clicking on it. For example, if you double-click on the "Transfer
Fcn" block in the simple model, you will see the following dialog box.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

36

This dialog box contains fields for the numerator and the denominator of the block's transfer
function. By entering a vector containing the coefficients of the desired numerator or denominator
polynomial, the desired transfer function can be entered. For example, to change the denominator to
s^2+2s+1, enter the following into the denominator field:
[1 2 1]

and hit the close button, the model window will change to the following:

which reflects the change in the denominator of the transfer function.


The "step" block can also be double-clicked, bringing up the following dialog box.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

37

The default parameters in this dialog box generate a step function occurring at time=1 sec, from an
initial level of zero to a level of 1. (in other words, a unit step at t=1). Each of these parameters can
be changed. Close this dialog before continuing.
The most complicated of these three blocks is the "Scope" block. Double clicking on this brings up a
blank oscilloscope screen.

When a simulation is performed, the signal which feeds into the scope will be displayed in
this window. Detailed operation of the scope will not be covered in this tutorial. The only function
we will use is the autoscale button, which appears as a pair of binoculars in the upper portion of the
window.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

38

Running Simulations
To run a simulation, we will work with the following model file:
simple2.mdl
Download and open this file in Simulink following the previous instructions for this file. You should
see the following model window.

Before running a simulation of this system, first open the scope window by double-clicking
on the scope block. Then, to start the simulation, either select Start from the Simulation menu (as
shown below) or hit Ctrl-T in the model window.

The simulation should run very quickly and the scope window will appear as shown below. If it
doesn't, just double click on the block labeled "scope."

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

39

Note that the simulation output (shown in yellow) is at a very low level relative to the axes of the
scope. To fix this, hit the autoscale button (binoculars), which will rescale the axes as shown below.

Note that the step response does not begin until t=1. This can be changed by double-clicking
on the "step" block. Now, we will change the parameters of the system and simulate the system
again. Double-click on the "Transfer Fcn" block in the model window and change the denominator to
[1 20 400]
Re-run the simulation (hit Ctrl-T) and you should see what appears as a
flat line in the scope window. Hit the autoscale button, and you should see the
following in the scope window.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

40

Notice that the autoscale button only changes the vertical axis. Since the new transfer
function has a very fast response, it compressed into a very narrow part of the scope window. This is
not really a problem with the scope, but with the simulation itself. Simulink simulated the system for
a full ten seconds even though the system had reached steady state shortly after one second.
To correct this, you need to change the parameters of the simulation itself. In the model
window, select Parameters from the Simulation menu. You will see the following dialog box.

There are many simulation parameter options; we will only be concerned with the start and
stop times, which tell Simulink over what time period to perform the simulation. Change Start time
from 0.0 to 0.8 (since the step doesn't occur until t=1.0. Change Stop time from 10.0 to 2.0, which
should be only shortly after the system settles. Close the dialog box and rerun the simulation.
After hitting the autoscale button, the scope window should provide a much better display of
the step response as shown below.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

41

Building Systems
In this section, you will learn how to build systems in Simulink using the building blocks in
Simulink's Block Libraries. You will build the following system.

First you will gather all the necessary blocks from the block libraries. Then you will modify
the blocks so they correspond to the blocks in the desired model. Finally, you will connect the blocks
with lines to form the complete system. After this, you will simulate the complete system to verify
that it works.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

42

Gathering Blocks
Follow the steps below to collect the necessary blocks:
Create a new model (New from the File menu or Ctrl-N). You will get a blank model window.

Click on the Library Browser button


to open the Simulink Library Browser. Click on the
Sources option under the expanded Simulink title to reveal possible sources for the model.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

43

Drag the Step block from the sources window into the left side of your model window.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

44

From the Simulink Library Browser, drag the Sum and Gain from "Math Operations" option
found under the Simulink title.

Switch to the "Continuous" option and drag two instances of the Transfer Fcn (drag it two times)
into your model window arranged approximately as shown below. The exact alignment is not
important since it can be changed later. Just try to get the correct relative positions. Notice that the
second Transfer Function block has a 1 after its name. Since no two blocks may have the same name,
Simulink automatically appends numbers following the names of blocks to differentiate between
them.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

45

Click on the "Sinks" option then drag over the "Scope" icon

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

46

Modify Blocks
Follow these steps to properly modify the blocks in your model.

Double-click your Sum block. Since you will want the second input to be subtracted, enter +into the list of signs field. Close the dialog box.
Double-click your Gain block. Change the gain to 2.5 and close the dialog box.
Double-click the leftmost Transfer Function block. Change the numerator to [1 2] and the
denominator to [1 0]. Close the dialog box.
Double-click the rightmost Transfer Function block. Leave the numerator [1], but change the
denominator to [1 2 4]. Close the dialog box. Your model should appear as:

Change the name of the first Transfer Function block by clicking on the words "Transfer Fcn".
A box and an editing cursor will appear on the block's name as shown below. Use the keyboard
(the mouse is also useful) to delete the existing name and type in the new name, "PI
Controller". Click anywhere outside the name box to finish editing.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

47

Similarly, change the name of the second Transfer Function block from "Transfer Fcn1" to
"Plant". Now, all the blocks are entered properly. Your model should appear as:

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

48

Connecting Blocks with Lines


Now that the blocks are properly laid out, you will now connect them together. Follow these steps.
Drag the mouse from the output terminal of the Step block to the upper (positive) input of the
Sum block. Let go of the mouse button only when the mouse is right on the input terminal. Do not
worry about the path you follow while dragging, the line will route itself. You should see the
following.

The resulting line should have a filled arrowhead. If the arrowhead is open, as shown below, it means
it is not connected to anything.

You can continue the partial line you just drew by treating the open arrowhead as an output
terminal and drawing just as before. Alternatively, if you want to redraw the line, or if the line
ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

49

connected to the wrong terminal, you should delete the line and redraw it. To delete a line (or any
other object), simply click on it to select it, and hit the delete key.
Draw a line connecting the Sum block output to the Gain input. Also draw a line from the Gain to
the PI Controller, a line from the PI Controller to the Plant, and a line from the Plant to the Scope.
You should now have the following.

The line remaining to be drawn is the feedback signal connecting the output of the Plant to the
negative input of the Sum block. This line is different in two ways. First, since this line loops around
and does not simply follow the shortest (right-angled) route so it needs to be drawn in several stages.
Second, there is no output terminal to start from, so the line has to tap off of an existing line.
To tap off the output line, hold the Ctrl key while dragging the mouse from the point on the existing
line where you want to tap off. In this case, start just to the right of the Plant. Drag until you get to
the lower left corner of the desired feedback signal line as shown below.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

50

Now, the open arrowhead of this partial line can be treated as an output terminal. Draw a line from it
to the negative terminal of the Sum block in the usual manner.

Now, you will align the blocks with each other for a neater appearance. Once connected, the
actual positions of the blocks does not matter, but it is easier to read if they are aligned. To move
each block, drag it with the mouse. The lines will stay connected and re-route themselves. The
middles and corners of lines can also be dragged to different locations. Starting at the left, drag each
block so that the lines connecting them are purely horizontal. Also, adjust the spacing between
blocks to leave room for signal labels. You should have something like:

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

51

Finally, you will place labels in your model to identify the signals. To place a label anywhere in
your model, double click at the point you want the label to be. Start by double clicking above the line
leading from the Step block. You will get a blank text box with an editing cursor as shown below

Type an r in this box, labeling the reference signal and click outside it to end editing.
Label the error (e) signal, the control (u) signal, and the output (y) signal in the same manner.
Your final model should appear as:

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

52

To save your model, select Save As in the File menu and type in any desired model name.
Simulation
Now that the model is complete, you can simulate the model. Select Start from the Simulation menu
to run the simulation. Double-click on the Scope block to view its output. Hit the autoscale button
(binoculars) and you should see the following.

Taking Variables from MATLAB


In some cases, parameters, such as gain, may be calculated in MATLAB to be used in a Simulink
model. If this is the case, it is not necessary to enter the result of the MATLAB calculation directly
into Simulink. For example, suppose we calculated the gain in MATLAB in the variable K. Emulate
this by entering the following command at the MATLAB command prompt.
K=2.5

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

53

This variable can now be used in the Simulink Gain block. In your Simulink model, double-click on
the Gain block and enter the following in the Gain field.
K

Close this dialog box. Notice now that the Gain block in the Simulink model shows the variable K
rather than a number.

Now, you can re-run the simulation and view the output on the Scope. The result should be the same
as before.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

54

Now, if any calculations are done in MATLAB to change any of the variables used in the Simulink
model, the simulation will use the new values the next time it is run. To try this, in MATLAB,
change the gain, K, by entering the following at the command prompt.
K=5
Start the Simulink simulation again, bring up the Scope window, and hit the autoscale button. You
will see the following output which reflects the new, higher gain.

Besides variables, signals and even entire systems can be exchanged between MATLAB and
Simulink

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

55

SIMULATION USING MAT LAB:

ExNo : 15

SIMULATION OF SPRING MASS SYSTEM

Writing Matlab Functions: Damped spring system


In this example, we will create a Simulink model for a mass attached to a spring with a linear
damping force.

A mass on a spring with a velocity-dependant damping force and a time-dependant force acting upon
it will behave according to the following equation:

The model will be formed around this equation. In this equation, 'm' is the equivalent mass of the
system; 'c' is the damping constant; and 'k' is the constant for the stiffness of the spring. First we want
to rearrange the above equation so that it is in terms of acceleration; then we will integrate to get the
expressions for velocity and position. Rearranging the equation to accomplish this, we get:

To build the model, we start with a 'step' block and a 'gain' block. The gain block represents the
mass, which we will be equal to 5. We also know that we will need to integrate twice, that we will
need to add these equations together, and that there are two more constants to consider. The damping
constant 'c' will act on the velocity, that is, after the first integration, and the constant 'k' will act on
the position, or after the second integration. Let c = 0.35 and let k = 0.5. Laying all these block out to
get an idea of how to put them together, we get:

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

56

By looking at the equation in terms of acceleration, it is clear that the damping term and spring term
are summed negatively, while the mass term is still positive. To add places and change signs of terms
being summed, double-click on the sum function block and edit the list of signs:

Once we have added places and corrected the signs for the sum block, we need only connect the lines
to their appropriate places. To be able to see what is happening with this spring system, we add a
'scope' block and add it as follows:

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

57

The values of 'm', 'c' and 'k' can be altered to test cases of under-damping, critical-damping and overdamping. To accurately use the scope, right-click the graph and select "Autoscale".
The mdl-file can now be saved. The following is a sample output when the model is run for 30
iterations.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

58

ExNO:16

SIMULATION OF AIR-CONDITIONING OF A HOUSE

Air Conditioning of a House: Simulation of Room Heater


This illustrates how we can use Simulink to create the Air Conditioning of a house Room Heater. This system depends on the outdoor environment, the thermal characteristics of the
house, and the house heating system. The air_condition1.m file initializes data in the model
workspace. To make changes, we can edit the model workspace directly or edit the m-file and reload the model workspace.
Opening the Model
In the MATLAB window, load the model by executing the following code (select the code and
press F9 to evaluate selection).
mdl=air_condition01;
open_system(mdl);
The House Heating Model
Model Initialization
When the model is opened, it loads the information about the house from the air_condition1.m
file. The M-file does the following:
Defines the house geometry (size, number of windows)
Specifies the thermal properties of house materials
Calculates the thermal resistance of the house
Provides the heater characteristics (temperature of the hot air, flow-rate)
Defines the cost of electricity (Rs.4.00/kWhr)
Specifies the initial room temperature (10 deg. Celsius = 50 deg. Fahrenheit)
Note: Time is given in units of hours. Certain quantities, like air flow-rate, are expressed
per hour (not per second).
Model Components
Set Point
"Set Point" is a constant block. It specifies the temperature that must be maintained indoors. It
is set at 86 degrees Fahrenheit which is equal to 30 degrees Centigrade.
By default. Temperatures are given in Fahrenheit, but then are converted to Celsius to
perform the calculations.
Thermostat
"Thermostat" is a subsystem that contains a Relay block. The thermostat allows fluctuations of
5 degrees Fahrenheit above or below the desired room temperature. If air temperature drops below
81 degrees Fahrenheit, the thermostat turns on the heater.
We can see the Thermostat subsystem by the following command in MATLAB Command
window.
open system([mdl,'/Thermostat']);
Heater
"Heater" is a subsystem that has a constant air flow rate, "Mdot", which is specified in the
air_condition.m M-file. The thermostat signal turns the heater on or off. When the heater is on, it
blows hot air at temperature THeater
(50 degrees Celsius = 122 degrees Fahrenheit by default) at a constant flow rate of Mdot
(1kg/sec = 3600kg/hr by default).
The heat flow into the room is expressed by the Equation 1.
Equation 1: (dQ/dt) = (T heater Troom)*Mdot*c
where c is the heat capacity of air at constant pressure.
We can see the Heater subsystem by the following command in MATLAB Command window.
open_system([mdl,'/Heater']);

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

59

Cost Calculator
"Cost Calculator" is a Gain block. "Cost Calculator" integrates the heat flow over time and
multiplies it by the energy cost.
The cost of heating is plotted in the "PlotResults" scope.
House
"House" is a subsystem that calculates room temperature variations. It takes into consideration
the heat flow from the heater and heat losses to the environment. Heat losses and the temperature
time derivative are expressed by Equation 2.
Equation 2
(dQ/dt)losses =(Troom Tout) / Req where Req is the equivalent thermal resistance of the house.
We can see the House subsystem by the following command in MATLAB Command window.
open_system([mdl,'/House']);
Modeling the Environment
We model the environment as a heat sink with infinite heat capacity and time varying
temperature Tout. The constant block "Avg Outdoor Temp" specifies the average air temperature
outdoors. The "Daily Temp Variation" Sine Wave block generates daily temperature fluctuations of
outdoor temperature. We can vary these parameters and see how they affect the heating costs.
Running the Simulation and Visualizing the Results
We can run the simulation and visualize the results.
Open the "PlotResults" scope to visualize the results. The heat cost and indoor versus outdoor
temperatures are plotted on the scope. The temperature outdoor varies sinusoidally, whereas the
indoors temperature is maintained within 5 degrees Fahrenheit of "Set Point". Time axis is labeled in
hours.
evalc('sim(mdl)');
open_system([mdl '/PlotResults']),
Remarks
This particular model is designed to calculate the heating costs only. If the temperature of the
outside air is higher than the room temperature, the room temperature will exceed the desired "Set
Point.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

60

ExNO: 17

CAM and FOLLOWER SYSTEM

A cam and follower system is system/mechanism that uses a cam and follower to create a specific
motion. The cam is in most cases merely a flat piece of metal that has had an unusual shape or
profile machined onto it. This cam is attached to a shaft which enables it to be turned by applying a
turning action to the shaft. As the cam rotates it is the profile or shape of the cam that causes the
follower to move in a particular way. The movement of the follower is then transmitted to another
mechanism or another part of the mechanism.

Examining the diagram shown above we can see that as some external turning force is applied to the
shaft (for example: by motor or by hand) the cam rotates with it. The follower is free to move in the
Y plane but is unable to move in the other two so as the lobe of the cam passes the edge of the
follower it causes the follower to move up. Then some external downward force (usually a spring
and gravity) pushes the follower down making it keep contact with the cam. This external force is
needed to keep the follower in contact with the cam profile.
Displacement Diagrams:
Displacement diagrams are merely a plot of two different displacements (distances). These two
dispalcements are:
1. the distance travelled up or down by the follower and
2. the angular displacement (distance) rotated by the cam

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

61

In the diagram shown opposite we can see the two different


displacements represented by the two different arrows. The
green arrow representing the displacement of the follower
i.e. the distance travelled up or down by the follower. The
mustard arrow (curved arrow) shows the angular
displacement travelled by the cam.

Note: Angular displacement is the angle through which the cam has rotated.
If we examine the diagram shown below we can see the relationship between a displacement
diagram and the actual profile of the cam. Note only half of the displacement diagram is drawn
because the second half of the diagram is the same as the first. The diagram is correct from a
theoretical point of view but would have to changed slightly if the cam was to be actually made and
used. We will consider this a little more in the the following section - Uniform Velocity.

Uniform Velocity:
Uniform Velocity means travelling at a constant speed in a fixed direction and as long as the speed or
direction don't change then its uniform velocity. In relation to cam and follower systems, uniform
velocity refers to the motion of the follower.
Now let's consider a typical displacement diagram which is merely a plot of two different
displacements (distances). These two displacements are:
1. the distance travelled up or down by the follower and
2. the angular displacement (distance) of the cam
Let us consider the case of a cam imparting a uniform velocity on a follower over a displacement of
30mm for the first half of its cycle.
ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

62

We shall take the cycle in steps. Firstly if the cam has to impart a displacement of 30mm on
follower over half its cycle then it must impart a displacement of 30mm180 for every 1 turned by
the cam i.e. it must move the follower 0.167mm per degree turn. This distance is to much to small
to draw on a displacement diagram so we will consider the displacement of the follower at the start,
at the end of the half cycle, the end of the full cycle and at certain other intervals (these intervals or
the
length of these intervals will be decided on later).
Angle the cam has rotated Distance
through
follower
Start of the Cycle

0mm

End of first Half of the Cycle

180

30mm

End of the Full Cycle

360

0mm

moved

by

the

We shall consider this in terms of a displacement diagram:


First we will plot the graph. Before doing this we must first consider the increments that we will use.
We will use millimeters for the follower displacement increments and because 1 is too small we will
use increments of 30 for the angular displacement.
Once this is done then we can draw the displacement diagram as shown below. Note a
straight line from the displacement of the follower at the start of the motion to the displacement of
the follower at the end of the motion represents uniform velocity.
Displacement Diagram for Uniform Velocity

Simple Harmonic Motion:


For this type of motion the follower displacement does not change at a constant rate. In other words
the follower doesn't travel at constant speed. The best way to understand this non-uniform motion is
to imagine a simple pendulum swinging.
Uniform Acceleration and Retardation:
This motion is used where the follower is required to rise or fall with uniform acceleration, that is its
velocity is changing at a constant rate.
To conclude this:
A cam can impart three types of motion on its follower:
Uniform velocity

Simple harmonic motion

Uniform
retardation

acceleration

and

Each of these motions can be represented by a displacement diagram.

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

63

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

64

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

65

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

66

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

67

Simply supported beam:

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

68

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

69

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

70

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

71

ME2404 COMPUTER AIDED SIMULATION AND ANALYSIS LABORATORY

72

Vous aimerez peut-être aussi