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

Sl.No.

Date Title of the Exercise Page Remarks


STRUCTURAL STATIC ANALYSIS Number
1 Stress analysis of a plate with a circular hole.
2 Stress analysis of simple bracket.
3 Stress analysis of simple rectangular L bracket
4 Stress analysis of rectangular L bracket
5 Stress analysis of an Axi-symmetric component.
6 Stress analysis of Cantilever beam with point load at the end
7 Stress analysis of Simply supported beam with point load at the
8 center
Stress analysis of Simply supported beam with uniformly
9 distributed load.of Fixed beam with point load at the center
Stress analysis
STRUCTURAL DYNAMIC ANALYSIS
10 Mode frequency analysis of Cantilever beam.
11 Mode frequency analysis of Simply supported beam.
12 Mode frequency analysis of Fixed beam.
STRUCTURAL HARMONIC ANALYSIS
13 Harmonic analysis of a 2D component
THERMAL ANALYSIS
14 Thermal stress analysis of a 2D component – static
15 Conductive heat transfer analysis of a 2D component
16 Convective heat transfer analysis of a 2D component
FLUID FLOW ANALYSIS
17 Analysis of Fluid Flow over a cylinder
MATLAB
18 Study of Basics of MATLAB
19 Determination of Matrix Operations
20 Determination of Eigen values and Eigen vectors
21 Solution of Simultaneous Equations
22 Plot 2-D and 3-D Graphs

1
Ex. No. : 01 STRESS ANALYSIS OF A PLATE WITH A CIRCULAR HOLE

Date :

AIM:
To determine the displacement and bending stress of a given plate with a circular hole using Finite
Element Analysis based ANSYS structure and view the displacement and bending stress plots.

PROCEDURE:
1. Enter the title of the analysis
Utility Menu > File > Select Change Title> Enter New Title > Stress Analysis of a Plate with
Hole > Ok

2
ANSYS Main Menu > preferences > turn on Structural > Ok

2. Define Type of element


Preprocessor > Element Type > Add/Edit/Delete >structural mass > solid > Quad4node 182 > Ok >
options > pull down K3 plane stress and select plane strs w/thk.> Ok > close

Options > pull down K3 plane stress and select plane strs w/thk.> Ok > close

3
3. Define Real constants

Preprocessor > Real Constants > Add/Edit/Delete>Add>Ok>Enter THK = 20 >Ok >Close

4
4. Define Material Properties
Preprocessor > Material Props > Material Models > Structural > Linear > Elastic > Isotropic > Enter EX
= 200000 and Enter PRXY = 0.3 > Ok > Close

5. Modeling
a. Create the main rectangular shape
Preprocessor > Modeling > Create > Areas > Rectangle > By 2 Corners > WP X=0, WP Y=0, Width =
200 and Height = 100.

5
b. Create the circle
Preprocessor > Modeling > Create > Areas > Circle > Solid Circle > WP X= 100, WP Y=50 and
Radius = 20

You should now have the following model:

6
c. Numbering Areas
Utility Menu >plot controls > Numbering> pick Areas

d.Subtraction
Now we want to subtract the circle (2) from the rectangle (1). Prior to this operation, your image
should resemble the following:

Modeling > Operate > Booleans > Subtract > Areas > Enter 1 > Ok > Enter 2 > Ok

You should now have the following model:

7
6. Mesh Size
Preprocessor > Meshing > Size Cntrls > Manual Size > Areas > All Areas

7. Mesh the model


Preprocessor > Meshing > Mesh > Areas > Free > Click on ‘Pick All’

Solution Phase: Assigning Loads and Solving


You have now defined your model. It is now time to apply the load(s) and constraint(s) and solve the resulting
system of equations.
1. Define Analysis Type
o Ensure that a Static Analysis will be performed
o Preprocessor >Loads > Analysis Type > New Analysis > select Static > Ok.

2. Apply Constraints
As shown previously, the left end of the plate is fixed.
Preprocessor > Define Loads > Apply > Structural > Displacement > On Lines > Using Mouse Select
the left end vertical line of the plate > click on 'Apply' in the window > Ok.

8
o Fill in the window as shown below.

This location is fixed which means that all DOF's are constrained. Therefore, select 'All DOF' by
clicking on it and enter '0' in the Value field as shown above.
You will see some blue triangles in the graphics window indicating the displacement constraints.

3. Apply Loads
o As shown in the diagram, there is a load of 20N/mm distributed on the right hand side of the
plate. Calculate the pressure on the plate end by dividing the distributed load by the thickness of
the plate (1 N/mm2).

Solution > Define Loads > Apply > Structural > Pressure > On Lines > Using Mouse Select the right
end vertical line of the plate > click on 'Apply' in the window

9
o Fill in the "Apply PRES on lines" window as shown below > Ok.

The pressure is uniform along the surface of the plate; therefore the last field is left blank.

The pressure is acting away from the surface of the plate, and is therefore defined as a
negative pressure.

o The applied loads and constraints should now appear as shown below.

10
4. Solving the System
Solution > Solve > Current LS > Ok.

5. Deformation

General Postproc > Plot Results > Deformed Shape > select Def + undeformd > Ok

View both the deformed and the undeformed object.

Observe the locations of deflection.

11
6. Deflection
General Postproc > Plot Results > Contour plot > Nodal Solution > Nodal Solution > pick DOF solution
> select Displacement Vector Sum > In the bottom of the window select Deformed shape with
Undeformed model > Ok.

12
7. Stresses

General Postproc > Plot Results > Nodal Solution > pick Stress > select Von Mises Stress > In the
bottom of the window select Deformed shape with Undeformed model > Ok.

13
RESULT:

Displacement vector sum =

Von mises stress =

14
Ex. No. : 02 STRESS ANALYSIS OF SIMPLE BRACKET

Date :

AIM:

To determine the displacement and bending stress of a given simple bracket using Finite Element
Analysis bases ANSYS structure and view the displacement and bending stress plots.

PROCEDURE

1. Defining the Problem


Utility Menu > File > Change Title>Stress Analysis of Simple Bracket
ANSYS Main Menu > preferences > turn on Structural
2. Define Type of element
Preprocessor > Element Type > Add/Edit/Delete >structural mass > solid > Quad4node 182 > Ok >
options > pull down plane stress and select plane stress with thick.> pull down No Extra output and
select Nodal Stress > Ok > close
3. Define Real constants

Preprocessor > Real Constants > Add/Edit/Delete>Add>Ok>Enter THK = 20 >Ok > Close

4. Define Material Properties


15
Preprocessor > Material Props > Material Models > Structural > Linear > Elastic > Isotropic > EX =
200000 and PRXY = 0.3 > Ok > Close

5. Modeling

a. Create the main rectangular shape


Preprocessor > Modeling > Create > Areas > Rectangle > By 2 Corners (X=0,Y=0, WIDTH= 80,
HEIGHT =100)

b. Create the circular end on the right hand side

Preprocessor > Modeling > Create > Areas > Circle > Solid Circle> X=80,Y=50 and R=50 > Ok

c. Now create a second and third circle for the left hand side using the following dimensions:

Preprocessor > Modeling > Create > Areas > Circle > Solid Circle> X=0,Y=20 and R=20 > Ok

Preprocessor > Modeling > Create > Areas > Circle > Solid Circle> X=0,Y=80 and R=20 > Ok

d. Create a rectangle on the left hand end to fill the gap between the two small circles.

Preprocessor > Modeling > Create > Areas > Rectangle > By 2 Corners (X= -20, Y=20,
WIDTH= 20, HEIGHT =60)

e. Your screen should now look like the following...

f. We now want to add these five discrete areas together to form one area.
Modeling > Operate > Booleans > Add > Areas > Pick All

g. Create the Bolt Holes


We now want to remove the bolt holes from this plate.
i. Create the three circles
with the parameters given below:

Preprocessor > Modeling > Create > Areas >


Circle > Solid Circle
16
parameter circle 1 circle 2 circle 3
WP X 80 0 0
WP Y 50 20 80
radius 30 10 10

h. Numbering Areas
Ansys utility menu > Plot controls > Numbering > Areas Area numbers > Turn On
i. Subtract object ( Simple Bracket) from Three Holes

Preprocessor > Modeling > Operate > Booleans > Subtract > Areas > Enter ‘6’ (Simple Bracket)
> Apply>1,2,3 > OK

Now you should have the following:

6. After Modeling is done save the model in a new folder


Ansys utility menu > plot controls > write metafile > invert white/black
7. Mesh Size
Preprocessor > Meshing > Size Cntrls > Manual Size > Areas > All Areas > element edge length > 5
8. Mesh
Preprocessor > Meshing > Mesh > Areas > Free > Pick All

9. After meshing is done save the meshed model on a previous new folder
Ansys utility menu > plot controls > write metafile > invert
white/black
Solution Phase: Assigning Loads and Solving
10. Define Analysis Type
Solution' > 'New Analysis' and select 'Static'.
11. Apply Constraints
As illustrated, the plate is fixed at both of the smaller holes on the left hand side.
17
a. Solution > Define Loads > Apply > Structural > Displacement > On Nodes
In the dial box, select circle option. Now Pick center of circle and drag upto outer surface as
shown figure.> ok > select All DOF , Enter Displacement value = 0 and Repeat for Second small
circle.

12. Apply Loads


As shown in the diagram, there is a single vertical load of 1000N, at the bottom of the large bolt hole.
Apply this force to the respective keypoint
Solution > Define Loads > Apply > Structural > Force/Moment > On Keypoints> just pick one point on
bottom of large circle > Ok > pull down FY > Enter force value
= -1000.

13. Solving the System


Solution > Solve > Current LS > Ok > Close

POST-PROCESSING: VIEWING THE RESULTS

18
14. Deflection
General Postproc > Plot Results > Contour Plot > Nodal Solu ... > DOF solution, > displacement
vector sum.> Ok

15. Von Mises Stress


General Postproc > Plot Results > Contour Plot > Nodal Solu ... > Stress > Von Mises Stress >
Ok

RESULT:

Displacement vector sum =

Von mises stress =

19
Ex. No. : 03. STRESS ANALYSIS OF SIMPLE RECTANGULAR L - BRACKET

Date:

AIM:

To determine the displacement and bending stress of a given L - bracket using Finite Element Analysis
bases ANSYS structure and view the displacement and bending stress plots.

PROCEDURE

Step 1: Set the analysis title

Utility Menu > Change title > Stress Analysis of Rectangular L – Bracket > ok

Step 2: Set preferences


Main Menu > Preferences > Structural > ok

Step 3: Define the material properties.


Main Menu > Preprocessor > Material Props > Material Models > Structural > Linear > Elastic >
Isotropic > EX 30000000 and PRXY 0.27 > ok >

20
Step 3: Define the element types
Main Menu > Preprocessor > Element Type > Add/Edit/Delete > Add > solid > 8 node Quad plane 82 >
ok

Options > choose plane stress with thickness > ok > close

Step 4: Define the Real constants


Main Menu > Preprocessor > Real Constants > Add/Edit/Delete > Add > ok > Enter the thickness 0.5 >
ok > close

Step 5: Create the Geometry

Create rectangle

Main Menu> Preprocessor> Modeling> Create> Areas> Rectangle> By Dimensions > Enter the
Dimensions > ok

Coordinates Rectangle 1 Rectangle 2

X1 0 4

X2 6 6

Y1 -1 -1

Y2 1 -3

Change plot controls and replot


Utility Menu > Plot ctrls > Numbering > turn on area number > ok

Create the circle

Main Menu> Preprocessor> Modeling> Create> Areas> Circle> Solid Circle

Dimensions Circle 1 Circle 2

Wp x 0 5

Wp y 0 -3

Radius 1 1

Add areas
21
Main Menu > Preprocessor > Modeling > Operate > Booleans > Add > Areas > Pick All
Create line fillet
Utility Menu > Plot Ctrls > Numbering > Turn on line numbering > ok > close

Main Menu > Preprocessor > Modeling > Create > Lines > Line Fillet > Pick the two lines > ok > Enter
the fillet radius 0.4 > ok > close

Utility Menu > Plot > Lines

Create fillet area

Main Menu > Preprocessor > Modeling > Create > Area > Arbitrary > By lines > Pick the Fillet line >
ok

Utility Menu > Plot > Area

Add areas together

Main Menu > Preprocessor > Modeling > Operate > Booleans > Add > Area > Pick All

Create first pin hole

Main Menu> Preprocessor> Modeling> Create> Areas> Circle> Solid Circle > Enter the Coordinates >
ok

Coordinates Circle 3 Circle 4

Wp x 0 5

Wp y 0 -3

Radius 0.4 0.4

Subtract pin holes from bracket


Main Menu> Preprocessor> Modeling> Operate> Booleans> Subtract> Areas > Pick Main Object > ok
> second and third circle > ok

Step 6: Mesh the Area


Main Menu > Preprocessor > Meshing > Mesh Tool > Set Global size control > Enter 0.5 > ok > Choose
Area Meshing > click > Pick All

22
Step 7: Apply Boundary conditions and loads

Constraints

Main Menu > Solution > Define Loads > Apply > Structural > Displacement > On Lines > Pick the four
lines around left hand hole > ok > select All DOF > Enter the value 0 > ok > close

Utility Menu > Plot lines

Pressure load

Main Menu > Solution > Define Loads > apply > Structural > Pressure > On Lines > Pick line defining
bottom left part of the circle > Apply > Enter 50 for VALUE > Enter 500 for optional value > Apply >
Pick line defining bottom right part of the circle > Apply > Enter 500 for VALUE > Enter 50 for
optional value > ok

Step 8: solve the Problem

Main Menu > Solution > Solve > Current LS > ok > close

Step 9: Review the Results


Main Menu > General Postproc > Read Results > First set
Deformed shape

Main Menu > General Postproc > Plot Results > Deformed Shape > choose Def + undeformed > ok

Displacement vector sum

Main Menu > General Postproc > Plot Results > Contour Plot > Nodal Solution > select DOF Solution >
select Displacement vector sum > ok.

23
Von Mises Stresses

Main Menu > General Postproc > Plot Results > Nodal Solution > stress > select von Mises Stress

RESULT:

Displacement vector sum =

Von mises stress =

24
Ex. No. :04. STRESS ANALYSIS OF RECTANGULAR L - BRACKET

Date :

AIM:

To determine the displacement and bending stress of a given L - bracket using Finite Element Analysis
bases ANSYS structure and view the displacement and bending stress plots.

This is a simple, single load step, structural static analysis of the (corner angle) L-bracket shown below.
The upper left-hand pin hole is constrained (welded) around its entire circumference, and a tapered pressure
load is applied to the bottom of the lower right-hand pin hole. The objective of the problem is to demonstrate
the typical ANSYS analysis procedure.

PROCEDURE

Given
The bracket is made of A36 steel with a Young’s modulus of 30E6 psi and Poisson’s ratio of 0.27.

25
Approach and Assumptions
Assume plane stress for this analysis. Since the bracket is thin in the z direction (1/2 inch thickness) compared
to its x and y dimensions, and since the pressure load acts only in the x-y plane, this is a valid assumption.
Your approach is to use solid modeling to generate the 2-D model and automatically mesh it with nodes and
elements.
Build Geometry
1. Define rectangles.
2. Change plot controls and replot.
3. Change working plane to polar and create first circle.
4. Move working plane and create second circle.
5. Add areas.
6. Create line fillet.
7. Create fillet area.
8. Add areas together.
9. Create first pin hole.
10. Move working plane and create second pin hole.
11. Subtract pin holes from bracket.
12. Save the database as model.db.
Define Materials
13. Set Preferences.
14. Define Material Properties.
15. Define element types and options.
16. Define real constants.
Generate Mesh
17. Mesh the area.
Apply Loads
19. Apply displacement constraints.
20. Apply pressure load.
Obtain Solution
21. Solve.
Review Results
22. Enter the general postprocessor and read in the results.
23. Plot the deformed shape.
24. Plot the von Mises equivalent stress.
25. List the reaction solution.
Step 1: Define rectangles.
There are several ways to create the model geometry within ANSYS, some more convenient than others. The
first step is to recognize that you can construct the bracket easily with combinations of rectangles and circle
Primitives.

26
Decide where the origin will be located and then define the rectangle and circle primitives relative to that origin.
The location of the origin is arbitrary. Here, use the center of the upper left-hand hole. ANSYS does not need to
know where the origin is. Simply begin by defining a rectangle relative to that location. In ANSYS, this origin
is called the global origin.
1. Main Menu> Preprocessor> Modeling> Create> Areas> Rectangle> By Dimensions > Enter
the following:
X1 = 0 (Note: Press the Tab key between entries)
X2 = 6
Y1 = -1

Y2 = 1

2. > Apply [to create the first rectangle].


3. Enter the following:
X1 = 4
X2 = 6
Y1 = -1

Y2 = -3
4. OK to create the second rectangle and close the dialog box.

27
Step 2: Change plot controls and replot.
The area plot shows both rectangles, which are areas, in the same color. To more clearly distinguish between
areas, turn on area numbers and colors. The "Plot Numbering Controls" dialog box on the Utility Menu controls
how items are displayed in the Graphics Window. By default, a "replot" is automatically performed upon
execution of the dialog box. The replot operation will repeat the last plotting operation that occurred (in this
case, an area plot).
1. Utility Menu> Plot Ctrls> Numbering
2. Turn on area numbers.

3. OK to change controls, close the dialog box, and replot.

Before going to the next step, save the work you have done so far. ANSYS stores any input data in
memory to the ANSYS database. To save that database to a file, use the SAVE operation, available as a
tool on the Toolbar. ANSYS names the database file using the format job name .db. If you started ANSYS
using the product launcher, you can specify a job name at that point (the default job name is file). You can
check the current job name at any time by choosing Utility Menu> List> Status> Global Status. You can
also save the database at specific milestone points in the analysis (such as after the model is complete, or
after the model is meshed) by choosing Utility Menu> File> Save As and specifying different job names
(model .db, or mesh.db, etc.).
It is important to do an occasional save so that if you make a mistake, you can restore the model
from the last saved state. You restore the model using the RESUME operation, also available on the
Toolbar. (You can also find SAVE and RESUME on the Utility Menu, under File.)
4. Toolbar: SAVE_DB.\

Step 3: Change working plane to polar and create first circle.

The next step in the model construction is to create the half circle at each end of the bracket. You
will actually create a full circle on each end and then combine the circles and rectangles with a Boolean

28
"add" operation (discussed in step 5.). To create the circles, you will use and display the working plane.
You could have shown the working plane as you created the rectangles but it was not necessary.

Before you begin however, first "zoom out" within the Graphics Window so you can see more of the
circles as you create them. You do this using the "Pan-Zoom-Rotate" dialog box, a convenient graphics control
box you’ll use often in any ANSYS session.
1. Utility Menu> PlotCtrls> Pan, Zoom, Rotate

2. Click on small dot once to zoom out.

3. Close dialog box.


4. Utility Menu> WorkPlane> Display Working Plane (toggle on)

Notice the working plane origin is immediately plotted in the


Graphics Window. It is indicated by the WX and WY symbols; right now
coincident with the global origin X and Y symbols. Next you will change
the WP type to polar, change the snap increment, and display the grid.

5. Utility Menu> WorkPlane> WP Settings

6. Click on Polar.

7. Click on Grid and Triad.

8. Enter 0.1 for snap increment.

9. OK to define settings and close the dialog box.

10. Main Menu> Preprocessor> Modeling> Create> Areas> Circle> Solid


Circle
Be sure to read prompt before picking.
11. Pick center point at:
WP X = 0 (in Graphics Window shown below)
WP Y = 0
29
12. Move mouse to radius of 1 and click left button to create circle.

13. OK to close picking menu.

Note
While you are positioning the cursor for picking, the "dynamic" WP X and Y values are displayed in the Solid
Circular Area dialog box. Also, as an alternative to picking, you can type these values along with the radius into
the dialog box.
Step 4: Move working plane and create second circle.
To create the circle at the other end of the bracket in the same manner, you need to first move the working plane
to the origin of the circle. The simplest way to do this without entering number offsets is to move the WP to an
average keypoint location by picking the keypoints at the bottom corners of the lower, right rectangle.
1. Utility Menu> WorkPlane> Offset WP to> Keypoints
2. Pick keypoint at lower left corner of rectangle.
3. Pick keypoint at lower right of rectangle.

4. OK to close picking menu.

5. Main Menu> Preprocessor> Modeling> Create> Areas> Circle> Solid Circle


6. Pick center point at:
WP X = 0
WP Y = 0
7. Move mouse to radius of 1 and click left button to create circle.
30
8. OK to close picking menu.

Step 5: Add areas.


Now that the appropriate pieces of the model are defined (rectangles and circles), you need to add them together
so the model becomes one continuous piece. You do this with the Boolean add operation for areas.
1. Main Menu> Preprocessor> Modeling> Operate> Booleans> Add> Areas

2. Pick All for all areas to be added.

3. Toolbar: SAVE_DB.
Step 6: Create line fillet.

31
1. Utility Menu> PlotCtrls> Numbering

2. Turn on line numbering.


3. OK to change controls, close the dialog box, and automatically replot.

4. Utility Menu> WorkPlane> Display Working Plane (toggle off)

5. Main Menu> Preprocessor> Modeling> Create> Lines> Line Fillet


6. Pick lines 17 and 8.

7. OK to finish picking lines (in picking menu).

8. Enter .4 as the radius.


9. OK to create line fillet and close the dialog box.

32
10. Utility Menu> Plot> Lines

Step 7: Create fillet area.


1. Utility Menu> PlotCtrls> Pan, Zoom, Rotate

2. Click on Zoom button.


3. Move mouse to fillet region, click left button, move mouse out and click again.

33
4. Main Menu> Preprocessor> Modeling> Create> Areas> Arbitrary> By Lines
5. Pick lines 4, 5, and 1.

6. OK to create area and close the picking menu.

7. Click on Fit button.

8. Close the Pan, Zoom, Rotate dialog box.


9. Utility Menu> Plot> Areas

Step 8: Add areas together.


1. Main Menu> Preprocessor> Modeling> Operate> Booleans> Add> Areas

34
2. Pick All for all areas to be added.

3. Toolbar: SAVE_DB.
Step 9: Create first pin hole.
1. Utility Menu> WorkPlane> Display Working Plane (toggle on)

2. Main Menu> Preprocessor> Modeling> Create> Areas> Circle> Solid Circle


3. Pick center point at:
WP X = 0 (in Graphics Window)
WP Y = 0
4. Move mouse to radius of .4 (shown in the picking menu) and click left button to create circle.
5. OK to close picking menu.
Step 10: Move working plane and create second pin hole.
1. Utility Menu> WorkPlane> Offset WP to> Global Origin
2. Main Menu> Preprocessor> Modeling> Create> Areas> Circle> Solid Circle
3. Pick center point at:
WP X = 0 (in Graphics Window)
WP Y = 0
4. Move mouse to radius of .4 (shown in the picking menu) and click left mouse button to create circle.
5. OK to close picking menu.
6. Utility Menu> WorkPlane> Display Working Plane (toggle off)
35
7. Utility Menu> Plot> Replot

From this area plot, it appears that one of the pin hole areas is not there. However, it is there (as
indicated by the presence of its lines), you just can't see it in the final display of the screen. That is
because the bracket area is drawn on top of it. An easy way to see all areas is to plot the lines instead.
8. Utility Menu> Plot> Lines

Step 11: Subtract pin holes from bracket.


1. Main Menu> Preprocessor> Modeling> Operate> Booleans> Subtract> Areas
2. Pick bracket as base area from which to subtract.
3. Apply (in picking menu).
4. Pick both pin holes as areas to be subtracted.

5. OK to subtract holes and close picking menu.

Step 12: Save the database as model.db.


At this point, you will save the database to a named file -- a name that represents the model before meshing. If
you decide to go back and remesh, you'll need to resume this database file. You will save it as model.db.
1. Utility Menu> File> Save As

2. Enter model.db for the database file name.


36
3. OK to save and close dialog box.
Define Materials
Step 13: Set preferences.
In preparation for defining materials, you will set preferences so that only materials that pertain to a structural
analysis are available for you to choose.
To set preferences:
1. Main Menu> Preferences
2. Turn on structural filtering. The options may differ from what is shown here since they

depend on the ANSYS product you are using.

3. OK to apply filtering and close the dialog box.


Step 14: Define material properties.
To define material properties for this analysis, there is only one material for the bracket, A36 Steel, with given
values for Young’s modulus of elasticity and Poisson’s ratio.
1. Main Menu> Preprocessor> Material Props> Material models

2. Double-click on Structural, Linear, Elastic, Isotropic.

3. Enter 30e6 for EX.

4. Enter .27 for PRXY.


5. OK to define material property set and close the dialog box.

37
6. Material> Exit

Step 15: Define element types and options.


In any analysis, you need to select from a library of element types and define the appropriate ones for your
analysis.
For this analysis, you will use only one element type, PLANE82, which is a 2-D, quadratic, structural, higher-
order element. The choice of a higher-order element here allows you to have a coarser mesh than with lower-
order elements while still maintaining solution accuracy. Also, ANSYS will generate some triangle shaped
elements in the mesh that would otherwise be inaccurate if you used lower-order elements (PLANE42). You
will need to specify plane stress with thickness as an option for PLANE82. (You will define the thickness as a
real constant in the next step.)
1. Main Menu> Preprocessor> Element Type> Add/Edit/Delete

2. Add an element type.

3. Structural solid family of elements.


4. Choose the 8-node quad (PLANE82).

38
5. OK to apply the element type and close the dialog box.

6. Options for PLANE82 are to be defined.

7. Choose plane stress with thickness option for element behavior.


8. OK to specify options and close the options dialog box.

9. Close the element type dialog box.

Step 16: Define real constants.


For this analysis, since the assumption is plane stress with thickness, you will enter the thickness as a real
constant for PLANE82. To find out more information about PLANE82, you will use the ANSYS Help System
in this step by clicking on a Help button from within a dialog box.

1. Main Menu> Preprocessor> Real Constants> Add/Edit/Delete

39
2. Add a real constant set.

3. OK for PLANE82.
Before clicking on the Help button in the next step, you should be aware that the help
information may appear in the same window as this tutorial, replacing the contents of the
tutorial. After reading the help information, click on the Back button to return to this tutorial.
If the help information appears in a separate window from the tutorial, minimize or close the
help window after you read the help information.

4. Help to get help on PLANE82.


5. Hold left mouse button down to scroll through element description.
6. If the help information replaced the tutorial, click on the Back button to return to the tutorial.

7. Enter .5 for THK.

8. OK to define the real constant and close the dialog box.

9. Close the real constant dialog box.

40
Generate Mesh
Step 17: Mesh the area.
One nice feature of the ANSYS program is that you can automatically mesh the model without specifying any
mesh size controls. This is using what is called a default mesh. If you’re not sure how to determine the mesh
density, let ANSYS try it first! Meshing this model with a default mesh however, generates more elements than
are allowed in the ANSYS ED program. Instead you will specify a global element size to control overall mesh
density.
1. Main Menu> Preprocessor> Meshing> Mesh Tool

2. Set Global Size control.

3. Type in 0.5.

4. OK.

5. Choose Area Meshing.

6. Click on Mesh.
7. Pick All for the area to be meshed (in picking menu). Close any warning messages that
appear.

8. Close the Mesh Tool.

Note

41
The mesh you see on your screen may vary slightly from the mesh shown here. As a result of this, you may see
slightly different results during postprocessing. For a discussion of results accuracy, see Planning Your
Approach in the ANSYS Modeling and Meshing Guide.
Step 18: Save the database as mesh.db.
Here again, you will save the database to a named file, this time mesh.db.

1. Utility Menu> File> Save as

2. Enter mesh.db for database file name.

3. OK to save file and close dialog box.


Apply Loads
The beginning of the solution phase.
A new, static analysis is the default, so you will not need to specify analysis type for this problem. Also, there
are no analysis options for this problem.
Step 19: Apply displacement constraints.
You can apply displacement constraints directly to lines.
1. Main Menu> Solution> Define Loads> Apply> Structural> Displacement> On Lines

2. Pick the four lines around left-hand hole (Line numbers 10, 9, 11, 12).

3. OK (in picking menu).

4. Click on All DOF.

5. Enter 0 for zero displacement.

6. OK to apply constraints and close dialog box.


7. Utility Menu> Plot Lines
42
8. Toolbar: SAVE_DB.
Step 20: Apply pressure load.
Now apply the tapered pressure load to the bottom, right-hand pin hole. ("Tapered" here means varying
linearly.) Note that when a circle is created in ANSYS, four lines define the perimeter. Therefore, apply the
pressure to two lines making up the lower half of the circle. Since the pressure tapers from a maximum value
(500 psi) at the bottom of the circle to a minimum value (50 psi) at the sides, apply pressure in two separate
steps, with reverse tapering values for each line.
The ANSYS convention for pressure loading is that a positive load value represents pressure into the surface
(compressive).

1. Main Menu> Solution> Define Loads> Apply> Structural> Pressure> On Lines

2. Pick line defining bottom left p art of the circle (line 6).

3. Apply.

4. Enter 50 for VALUE.

43
5. Enter 500 for optional value.

6. Apply.
7. Pick line defining bottom right part of circle (line 7).

8. Apply.

9. Enter 500 for VALUE.

10. Enter 50 for optional value.

11. OK.

Obtain Solution

44
Step 21: Solve.

1. Main Menu> Solution> Solve> Current LS


2. Review the information in the status window, then choose File> Close (Windows), or Close

(X11/Motif), to close the window.

3. OK to begin the solution .


4. Choose Yes to any Verify messages that appear.
5. Close the information window when solution is done.
ANSYS stores the results of this one load step problem in the database and in the results file, Jobname.RST (or
Jobname.RTH for thermal, Jobname.RMG for magnetic, and Jobname.RFL for fluid analyses). The database
can actually contain only one set of results at any given time, so in a multiple load step or multiple substep
analysis, ANSYS stores only the final solution in the database. ANSYS stores all solutions in the results file.
Review Results
The beginning of the postprocessing phase.
Note
The results you see may vary slightly from what is shown here due to variations in the mesh.
Step 22: Enter the general postprocessor and read in the results.
1. Main Menu> General Postproc> Read Results> First Set
Step 23: Plot the deformed shape.
1. Main Menu> General Postproc> Plot Results> Deformed Shape

2. Choose Def + undeformed.

3. OK.

You can also produce an animated version of the deformed shape:

45
4. Utility Menu> Plot Ctrls> Animate> Deformed Shape

5. Choose Def + undeformed.

6. OK.

7. Make choices in the Animation Controller (not shown), if necessary, then choose Close.

Step 24: Plot the von Mises equivalent stress.


1. Main Menu> General Postproc> Plot Results> Contour Plot> Nodal Solu

2. Choose Stress item to be contoured.

3. Scroll down and choose von Mises (SEQV).

4. OK.

46
You can also produce an animated version of these results:
5. Utility Menu> Plot Ctrls> Animate> Deformed Results

6. Choose Stress item to be contoured.

7. Scroll down and choose von Mises (SEQV).

8. OK.

9. Make choices in the Animation Controller (not shown), if necessary, then choose Close.
Step 25: List reaction solution.

1. Main Menu> General Postproc> List Results> Reaction Solu

2. OK to list all items and close the dialog box.

3. Scroll down and find the total vertical force, FY.

4. File> Close (Windows), or Close (X11/Motif), to close the window.

47
The value of 134.61 is comparable to the total pin load force.

RESULT:

Displacement vector sum =

Von mises stress =

Ex. No. : 05 STRESS ANALYSIS OF AN AXISYMMETRIC TUBE

Date :

AIM:

To determine the displacement and bending stress of a given axisymmetric component using Finite
Element Analysis bases ANSYS structure and view the displacement and bending stress plots.

48
The model will be that of a closed tube made from steel. Point loads will be applied at the Point loads
will be applied at the center of the top and bottom plate to make an analytical verification simple to calculate. A
3/4 cross section view of the tube is shown below

Cross Section of the Beam

PROCEDURE:

Preprocessing: Defining the Problem

1. Defining the Problem


Utility Menu > File > Change Title>Stress Analysis of Axisymmetric component
ANSYS Main Menu > preferences > turn on Structural
2. Define Type of element
49
Preprocessor > Element Type > Add/Edit/Delete >structural mass > solid > Quad4node 182 > Ok >
options > pull down K3 and select Axismmetric.> Ok > close
3. Define Material Properties
Preprocessor > Material Props > Material Models > Structural > Linear > Elastic > Isotropic > EX =
200000 and PRXY = 0.3 > Ok

4. Modeling
(a).Create Areas
Preprocessor > Modeling > Create > Areas > Rectangle > By Dimensions

For an axisymmetric problem, ANSYS will rotate the area around the y-axis at x=0. Therefore,
to create the geometry mentioned above, we must define a U-shape.
Rectangle X1 X2 Y1 Y2
1 0 20 0 5
2 15 20 0 100
3 0 20 95 100
(b) Add Areas Together
Preprocessor > Modeling > Operate > Booleans > Add > Areas > Pick All
5. Define Mesh Size
Preprocessor > Meshing > Size Cntrls > ManualSize > Areas > All Areas > Enter 2
For this example we will use an element edge length of 2mm.
6. Mesh the model
Preprocessor > Meshing > Mesh > Areas > Free > click 'Pick All'
Your model should know look like this:
Solution Phase: Assigning Loads and Solving
7. Define Analysis Type
Solution > Analysis Type > New Analysis > Static
8. Apply Constraints
a. Solution > Define Loads > Apply > Structural > Displacement > Symmetry B.C. > On Lines
Pick the two edges on the left, at x=0, as shown below.

50
b. Solution > Define Loads > Apply > Structural > Displacement > On Nodes > select two nodes at
the mid point of the model as shown below > In the window pick Apply > select Uy and Enter
displacement value = 0 > Ok

9. Apply Loads
a. Solution > Define Loads > Apply > Structural > Force/Moment > On Keypoints
Pick the top left corner of the area and click OK. Apply a load of 100 in the FY direction.
b. Solution > Define Loads > Apply > Structural > Force/Moment > On Keypoints
Pick the bottom left corner of the area and click OK. Apply a load of -100 in the FY direction.
The applied loads and constraints should now appear as shown in the figure below.

10. Solve the System

51
Solution > Solve > Current LS

Postprocessing: Viewing the Results

11. Deflection
General Postproc > Plot Results > Contour Plot > Nodal Solu ... > DOF solution, > displacement
vector sum.> Ok
12. Von mises stress
General Postproc > Plot Results > Contour Plot > Nodal Solu ... > Stress > Von Mises Stress >
Ok
13. Plotting the Elements as Axisymmetric
Utility Menu > PlotCtrls > Style > Symmetry Expansion > 2-D Axi-symmetric...
The following window will appear. By clicking on 3/4 expansion you can produce the figure
shown at the beginning of this tutorial.

52
RESULT:

Displacement vector sum =

Von mises stress =

Ex. No. : 06 STRESS ANALYSIS OF CANTILEVER BEAM WITH POINT LOAD AT THE
END

Date:

AIM:

To determine the displacement and bending stress of a given Cantilever Beam using Finite Element
Analysis based ANSYS software and also plot shear force and bending moment diagrams.

53
PROCEDURE

1. Defining the Problem


Utility Menu > File > Change Title>Stress Analysis of Cantilever Beam
ANSYS Main Menu > preferences > turn on Structural > Ok
2. Define Type of element

Preprocessor > Element Type > Add/Edit/Delete > Add >Beam > 2 node 188> Ok > Options > pull
down K3 select Cubic Form > pull down K7 select All Section points > pull down K9 select All Section
points

3. Define Material Properties

Preprocessor > Material Props > Material Models > Structural > Linear > Elastic > Isotropic > Enter EX
= 2.068E11 and PRXY = 0.3> Ok

4. Define Section Type

Preprocessor > Sections > Beam > Common sections > Pull down Sub- Type in the window > select
square section > Enter B = 0.01 and H = 0.01 > Preview > Ok

5. Modeling

Preprocessor > Modeling > Create > Key points > In Active CS > Key point number 1 > X= 0, Y= 0 and
Z = 0 > Apply > Key point number 2> X= 1, Y= 0 and Z =0 > Ok

54
6. Form a Line

Preprocessor > Modeling > Create > Lines > Lines > Straight Line >pick Key points 1 and 2 > Ok

7. Define Mesh Size

Preprocessor > Meshing > size cntrls > Manual size > Lines > All Lines> Enter No. of Element
divisions = 20 > Ok

8. Mesh the model

Preprocessor > Meshing > Mesh > Lines > Pick All

9. Define Analysis Type


Preprocessor > Loads > Analysis Type > New Analysis > select Static Ok.
10. Apply Constrain

Preprocessor > Loads > Define loads >Apply > Structural > Displacement > On Key Points >select left
key point 1 > Ok > select All DOF > Enter Displacement Value = 0 > Ok

11. Apply Loads

Preprocessor > Loads > Define loads >Apply > Structural > Force /Moment > On Key Points >select
right key point 2 > Ok > pull down select FY > Enter Force / Moment Value = -100 > Ok

12. Solving the system


Solution > Solve > Current LS > Ok

VIEWING THE RESULTS

13. Deformation plot

55
General Postproc > Plot Results > Deformed Shape > select Def + undeformd > Ok

14. Deflection plot

General Postproc > Plot Results > Contour Plot > nodal Solu > select DOF Solution > select
Displacement Vector sum > Ok

15. Stress

General Postproc > List Results > Element Solution > select Stress > select Von Mises stress >
Ok > Close

56
16. Shear Force Plot

General Postproc > Element Table > Define Table > Add > pull down left side select By
sequence num right side Enter SMISC, 6 > Apply > Again pull down left side select By
sequence num > right side Enter SMISC, 19 > Ok > Close

General Postproc > Plot Results > Contour Plot > Line Elem Res > select LabI Elem table item
at node I SMIS6 > select LabJ Elem table item at node J SMIS19 > Ok

17. Bending Moment Plot

57
General Postproc > Element Table > Define Table > Add > pull down left side select By
sequence num right side Enter SMISC, 3> Apply > Again pull down left side select By sequence
num > right side Enter SMISC, 16 > Ok > Close

General Postproc > Plot Results > Contour Plot > Line Elem Res > select LabI Elem table item
at node I SMIS3> select LabJ Elem table item at node J SMIS16
> Ok

RESULT:
Displacement vector sum =

Von Mises Stress =

Shear force =

Maximum bending moment =

Ex. No. : 07 STRESS ANALYSIS OF SIMPLY SUPPORTED BEAM WITH POINT LOAD AT THE
CENTRE

Date:

AIM:

To determine the displacement and bending stress of a given simply supported beam using Finite
Element Analysis based ANSYS software and also plot shear force and bending moment diagrams.

58
PROCEDURE

1. Defining the Problem


Utility Menu > File > Change Title>Stress Analysis of Stress Analysis of stress analysis of simply
supported beam with point load at the centre
ANSYS Main Menu > preferences > turn on Structural > Ok
2. Define Type of element

Preprocessor > Element Type > Add/Edit/Delete > Add >Beam > 2 node 188> Ok > Options > pull
down K3 select Cubic Form > pull down K7 select All Section points > pull down K9 select All Section
points > Ok > Close

3. Define Material Properties

Preprocessor > Material Props > Material Models > Structural > Linear > Elastic > Isotropic > Enter EX
= 2.068E11 and PRXY = 0.3> Ok

4. Define Section Type

Preprocessor > Beam > Common sections > Pull down Sub- Type in the window > select square
section > Enter B = 0.01 and H = 0.01 > Preview > Ok

5. Modeling

Preprocessor > Modeling > Create > Key points > In Active CS > Key point number 1 > X= 0, Y= 0 and
Z = 0 > Apply > Key point number 2> X= 1, Y= 0 and Z Ok

6. Form a Line

59
Preprocessor > Modeling > Create > Lines > Lines > Straight Line >using mouse pick Key points 1 and
2 > Ok

7. Define Mesh Size

Preprocessor > Meshing > size cntrls > Manual size > Lines > All Lines> Enter No. of Element
divisions = 20 > Ok

8. Mesh the model

Preprocessor > Meshing > Mesh > Lines > Pick All

9. Define Analysis Type


Preprocessor > Loads > Analysis Type > New Analysis > select Static Ok.
10. Apply Constrain

Preprocessor > Loads > Define loads >Apply > Structural > Displacement > On Key Points >select key
points 1 and 2 > Ok > select UX and UY > Enter Displacement Value = 0 > Ok

11. Apply Loads

Preprocessor > Loads > Define loads >Apply > Structural > Force /Moment > On Nodes >using mouse
select Mid point of the line > Ok > pull down select FY > Enter Force / Moment Value = -100 > Ok

12. Solving the system


60
Solution > Solve > Current LS > Ok
Viewing the Results
13. Deformation plot

General Postproc > Plot Results > Deformed Shape > select Def + undeformd > Ok

14. Deflection plot

General Postproc > Plot Results > Contour Plot > nodal Solu > select DOF Solution > select
Displacement Vector sum > Ok

15. Stress

General Postproc > List Results > Element Solution > select Stress > select Von Mises stress >
Ok > Close

61
16. Shear Force Plot

General Postproc > Element Table > Define Table > Add > pull down left side select By
sequence num > right side Enter SMISC, 6 > Apply > Again pull down left side select By
sequence num > right side Enter SMISC, 19 > Ok > Close

General Postproc > Plot Results > Contour Plot > Line Elem Res > select LabI Elem table item
at node I SMIS6 > select LabJ Elem table item at node J SMIS19
> Ok

17. Bending Moment Plot

62
General Postproc > Element Table > Define Table > Add > pull down left side select By
sequence num > right side Enter SMISC, 3 > Apply > Again pull down left side select By
sequence num > right side Enter SMISC, 16 > Ok > Close

General Postproc > Plot Results > Contour Plot > Line Elem Res > select LabI Elem table item
at node I SMIS3> select LabJ Elem table item at node J SMIS16
> Ok

RESULT:
Displacement vector sum =

Von Mises Stress =

Shear force =

Maximum bending moment =

63
Ex. No. : 08 STRESS ANALYSIS OF SIMPLY SUPPORTED BEAM WITH UNIFORMLY
DISTRIBUTED LOAD

Date:

AIM:

To determine the displacement and bending stress of a given stress analysis of simply supported beam
with uniformly distributed load using Finite Element Analysis based ANSYS software and also plot shear force
and bending moment diagrams.

PROCEDURE

1. Defining the Problem


Utility Menu > File > Change Title>Stress Analysis of Cantilever Beam
ANSYS Main Menu > preferences > turn on Structural > Ok
2. Define Type of element

Preprocessor > Element Type > Add/Edit/Delete > Add >Beam > 2 node 188> Ok > Options > pull
down K3 select Cubic Form > pull down K7 select All Section points > pull down K9 select All Section
points > Ok > Close

3. Define Material Properties

Preprocessor > Material Props > Material Models > Structural > Linear > Elastic > Isotropic > Enter EX
= 2.068E11 and PRXY = 0.3> Ok

4. Define Section Type


64
Preprocessor > Beam > Common sections > Pull down Sub- Type in the window > select square
section > Enter B = 0.01 and H = 0.01 > Preview > Ok

5. Modeling

Preprocessor > Modeling > Create > Key points > In Active CS > Key point number 1 > X= 0, Y= 0 and
Z = 0 > Apply > Key point number 2> X= 1, Y= 0 and Z Ok

6. Form a Line

Preprocessor > Modeling > Create > Lines > Lines > Straight Line >using mouse pick Key points 1 and
2 > Ok

7. Define Mesh Size

Preprocessor > Meshing > size cntrls > Manual size > Lines > All Lines> Enter No. of Element
divisions = 20 > Ok

8. Mesh the model

Preprocessor > Meshing > Mesh > Lines > Pick All

9. Define Analysis Type


Preprocessor > Loads > Analysis Type > New Analysis > select Static Ok.
10. Apply Constrain

Preprocessor > Loads > Define loads >Apply > Structural > Displacement > On Key Points >select key
points 1and 2 > Ok > select UX and UY > Enter Displacement Value = 0 > Ok

65
11. Apply Loads

Preprocessor > Loads > Define loads > Apply > Structural > Force / Moment > On Nodes > using
mouse select All the nodes of the line except first and last nodes > Ok > pull down select FY > Enter
Force / Moment Value = - 0.25 > Ok

12. Solving the system


Solution > Solve > Current LS > Ok

66
VIEWING THE RESULTS

13. Deformation plot

General Postproc > Plot Results > Deformed Shape > select Def + undeformd > Ok

14. Deflection plot

General Postproc > Plot Results > Contour Plot > nodal Solu > select DOF Solution > select
Displacement Vector sum > Ok

67
15. Stress

General Postproc > List Results > Element Solution > select Stress > select Von Mises stress >
Ok > Close

16. Shear Force Plot

General Postproc > Element Table > Define Table > Add > pull down left side select By
sequence num right side Enter SMISC, 6 > Apply > Again pull down left side select By
sequence num > right side Enter SMISC, 19 > Ok > Close

General Postproc > Plot Results > Contour Plot > Line Elem Res > select LabI Elem table item
at node I SMIS6 > select LabJ Elem table item at node J SMIS19
> Ok

68
17. Bending Moment Plot

General Postproc > Element Table > Define Table > Add > pull down left side select By
sequence num right side Enter SMISC, 3> Apply > Again pull down left side select By sequence
num > right side Enter SMISC, 16 > Ok > Close

General Postproc > Plot Results > Contour Plot > Line Elem Res > select LabI Elem table item
at node I SMIS3> select LabJ Elem table item at node J SMIS16 > Ok

RESULT:

Displacement vector sum =

Von Mises Stress =

Shear force =

Maximum bending moment =

69
Ex. No. : 09 STRESS ANALYSIS OF FIXED BEAM WITH POINT LOAD AT THE CENTRE

Date:

AIM:

To determine the displacement and bending stress of a given stress analysis of fixed beam with point
load at the centre using Finite Element Analysis based ANSYS software and also plot shear force and bending
moment diagrams.

PROCEDURE

1. Defining the Problem


Utility Menu > File > Change Title>Stress Analysis of Cantilever Beam
ANSYS Main Menu > preferences > turn on Structural > Ok
2. Define Type of element

Preprocessor > Element Type > Add/Edit/Delete > Add >Beam > 2 node 188> Ok > Options > pull
down K3 select Cubic Form > pull down K7 select All Section points > pull down K9 select All Section
points > Ok > Close

3. Define Material Properties

Preprocessor > Material Props > Material Models > Structural > Linear > Elastic > Isotropic > Enter EX
= 2.068E11 and PRXY = 0.3> Ok

70
4. Define Section Type

Preprocessor > Beam > Common sections > Pull down Sub- Type in the window > select square
section > Enter B = 0.01 and H = 0.01 > Preview > Ok

5. Modeling

Preprocessor > Modeling > Create > Key points > In Active CS > Key point number 1 > X= 0, Y= 0 and
Z = 0 > Apply > Key point number 2> X= 1, Y= 0 and Z Ok

6. Form a Line

Preprocessor > Modeling > Create > Lines > Lines > Straight Line >using mouse pick Key points 1 and
2 > Ok

7. Define Mesh Size

Preprocessor > Meshing > size cntrls > Manual size > Lines > All Lines> Enter No. of Element
divisions = 20 > Ok

8. Mesh the model

Preprocessor > Meshing > Mesh > Lines > Pick All

9. Define Analysis Type


Preprocessor > Loads > Analysis Type > New Analysis > select Static Ok.
10. Apply Constrain

Preprocessor > Loads > Define loads >Apply > Structural > Displacement > On Key Points >select key
point 1 and 2 > Ok > select All DOF > Enter Displacement Value = 0 > Ok

71
11. Apply Loads

Preprocessor > Loads > Define loads >Apply > Structural > Force /Moment > On Nodes >using mouse
select Mid point of the line > Ok > pull down select FY > Enter Force / Moment Value = -100 > Ok

12. Solving the system


Solution > Solve > Current LS > Ok
Viewing the Results
13. Deformation plot

General Postproc > Plot Results > Deformed Shape > select Def + undeformd > Ok

72
14. Deflection plot

General Postproc > Plot Results > Contour Plot > nodal Solu > select DOF Solution > select
Displacement Vector sum > Ok

15. Stress

General Postproc > List Results > Element Solution > select Stress > select Von Mises stress >
Ok > Close

73
16. Shear Force Plot

General Postproc > Element Table > Define Table > Add > pull down left side select By
sequence num right side Enter SMISC, 6 > Apply > Again pull down left side select By
sequence num > right side Enter SMISC, 19 > Ok > Close

General Postproc > Plot Results > Contour Plot > Line Elem Res > select LabI Elem table item
at node I SMIS6 > select LabJ Elem table item at node J SMIS19 > Ok

17. Bending Moment Plot

General Postproc > Element Table > Define Table > Add > pull down left side select By
sequence num right side Enter SMISC, 3> Apply > Again pull down left side select By sequence
num > right side Enter SMISC, 16 > Ok > Close

General Postproc > Plot Results > Contour Plot > Line Elem Res > select LabI Elem table item
at node I SMIS3> select LabJ Elem table item at node J SMIS16 > Ok

74
RESULT:

Displacement vector sum =

Von Mises Stress =

Shear force =

Maximum bending moment =

75
Ex. No. : 10 MODE FREQUENCY ANALYSIS OF CANTILEVER BEAM

Date:

AIM:

To determine first three natural frequencies of Cantilever Beam using Finite Element Analysis
based ANSYS software and also plot three mode shapes.

PROCEDURE

1. Defining the Problem


Utility Menu > File > Change Title>Mode Frequency Analysis of Cantilever Beam
ANSYS Main Menu > preferences > turn on Structural > Ok
2. Define Type of element

Preprocessor > Element Type > Add/Edit/Delete > Add >Beam > 2 node 188> Ok > Options > pull
down K3 select Cubic Form > pull down K7 select All Section points > pull down K9 select All Section
points > Ok > Close

3. Define Material Properties

Preprocessor > Material Props > Material Models > Structural > Linear > Elastic > Isotropic > Enter EX
= 2.068E11 and PRXY = 0.3

Enter Density DENS = 7830 > Ok

76
4. Define Section Type

Preprocessor > Beam > Common sections > Pull down Sub- Type in the window > select square
section > Enter B = 0.01 and H = 0.01 > Preview > Ok

5. Modeling

Preprocessor > Modeling > Create > Key points > In Active CS > Key point number 1 > X= 0, Y= 0 and
Z = 0 > Apply > Key point number 2> X= 1, Y= 0 and Z Ok

6. Form a Line

Preprocessor > Modeling > Create > Lines > Lines > Straight Line >pick Key points 1 and 2 > Ok

7. Define Mesh Size

Preprocessor > Meshing > size cntrls > Manual size > Lines > All Lines> Enter No. of Element
divisions = 20 > Ok

8. Mesh the model

Preprocessor > Meshing > Mesh > Lines > Pick All

9. Define Analysis Type


Preprocessor > Loads > Analysis Type > New Analysis > select Modal > Ok.

10. Define Mode Extraction Method


Preprocessor > Loads > Analysis Type > Analysis Options > select Reduced Method > Enter No. of
modes to extract = 3 > No. of modes to expand = 3 > Ok
Enter Frequency range 0 To 2500
Enter No. of modes to print = 3 > Ok

11. Define Master DOFs


Preprocessor > Loads > Master DOFs > User Selected > Define > using mouse select All nodes except
first and last node > Ok > Lab-1 and Lab-2 select UY > Ok

77
12. Apply Constrain

Preprocessor > Loads > Define loads >Apply > Structural > Displacement > On Key Points >select left
key point 1 > Ok > select All DOF > Enter Displacement Value = 0 > Ok

13. Solving the system


Solution > Solve > Current LS > Ok
VIEWING THE RESULTS

14. List First Three Fundamental Frequencies

General Postproc > List Results > Detailed Summary

78
THREE MODE SHAPES

15. Deformation plot

General Postproc > Read Results > First Set > Plot Results > Deformed Shape > select Def +
Undeformed > Ok

General Postproc > Read Results > Next Set > Plot Results > Deformed Shape > select Def +
Undeformed > Ok

79
General Postproc > Read Results > Next Set > Plot Results > Deformed Shape > select Def + Undeformed >
Ok

RESULT:

First natural frequency =

Second natural frequency =

Third natural frequency =

80
Ex. No. : 11 MODE FREQUENCY ANALYSIS OF SIMPLY SUPPORTED BEAM

Date:

AIM:

To determine the first three natural frequencies of simply supported Beam using Finite Element Analysis
based ANSYS software and also plot first three mode shapes.

PROCEDURE

1. Defining the Problem


Utility Menu > File > Change Title>Mode Frequency Analysis of Simply Supported Beam
ANSYS Main Menu > preferences > turn on Structural > Ok
2. Define Type of element

Preprocessor > Element Type > Add/Edit/Delete > Add >Beam > 2 node 188> Ok > Options > pull
down K3 select Cubic Form > pull down K7 select All Section points > pull down K9 select All Section
points > Ok > Close

3. Define Material Properties

Preprocessor > Material Props > Material Models > Structural > Linear > Elastic > Isotropic > Enter EX
= 2.068E11 and PRXY = 0.3

Enter Density DENS = 7830


4. Define Section Type

Preprocessor > Beam > Common sections > Pull down Sub- Type in the window > select square
section > Enter B = 0.01 and H = 0.01 > Preview > Ok

81
5. Modeling

Preprocessor > Modeling > Create > Key points > In Active CS > Key point number 1 > X= 0, Y= 0 and
Z = 0 > Apply > Key point number 2> X= 1, Y= 0 and Z Ok

6. Form a Line

Preprocessor > Modeling > Create > Lines > Lines > Straight Line > pick Key points 1 and 2 > Ok

7. Define Mesh Size

Preprocessor > Meshing > size cntrls > Manual size > Lines > All Lines> Enter No. of Element
divisions = 20 > Ok

8. Mesh the model

Preprocessor > Meshing > Mesh > Lines > Pick All

9. Define Analysis Type


Preprocessor > Loads > Analysis Type > New Analysis > select Modal > Ok.
10. Define Mode Extraction Method
Preprocessor > Loads > Analysis Type > Analysis Options > select Reduced Method > Enter No. of
modes to extract = 3 > No. of modes to expand = 3 > Ok
Enter Frequency range 0 To 2500
Enter No. of modes to print = 3 > Ok
11. Define Master DOFs
Preprocessor > Loads > Master DOFs > User Selected > Define > using mouse select All nodes except
first and last node > Ok > Lab-1 select UX and Lab-2 select UY > Ok

12. Apply Constrain

Preprocessor > Loads > Define loads >Apply > Structural > Displacement > On Key Points >select left
key point 1 and select right key point 2 > Ok > select UX and UY > Enter Displacement Value = 0 > Ok

82
13. Solving the system
Solution > Solve > Current LS > Ok

VIEWING THE RESULTS


14. List First Three Fundamental Frequencies

General Postproc > List Results > Detailed Summary

THREE MODE SHAPES

15. Deformation plot

General Postproc > Read Results > First Set > Plot Results > Deformed Shape > select Def +
Undeformed > Ok

83
General Postproc > Read Results > Next Set > Plot Results > Deformed Shape > select Def +
Undeformed > Ok

General Postproc > Read Results > Next Set > Plot Results > Deformed Shape > select Def +
Undeformed > Ok

84
RESULT:

First natural frequency =

Second natural frequency =

Third natural frequency =

85
Ex. No. :12 MODE FREQUENCY ANALYSIS OF FIXED BEAM

Date:

AIM:

To first three natural frequencies of fixed Beam using Finite Element Analysis based ANSYS
software and also plot first three mode shapes.

PROCEDURE

1. Defining the Problem


Utility Menu > File > Change Title>Mode Frequency Analysis of Fixed Beam
ANSYS Main Menu > preferences > turn on Structural > Ok
2. Define Type of element

Preprocessor > Element Type > Add/Edit/Delete > Add >Beam > 2 node 188> Ok > Options > pull
down K3 select Cubic Form > pull down K7 select All Section points > pull down K9 select All Section
points > Ok > Close

3. Define Material Properties

Preprocessor > Material Props > Material Models > Structural > Linear > Elastic > Isotropic > Enter EX
= 2.068E11 and PRXY = 0.3
Enter Density DENS = 7830 > Ok
4. Define Section Type

Preprocessor > Beam > Common sections > Pull down Sub- Type in the window > select square
section > Enter B = 0.01 and H = 0.01 > Preview > Ok

86
5. Modeling

Preprocessor > Modeling > Create > Key points > In Active CS > Key point number 1 > X= 0, Y= 0 and
Z = 0 > Apply > Key point number 2> X= 1, Y= 0 and Z Ok

6. Form a Line

Preprocessor > Modeling > Create > Lines > Lines > Straight Line >pick Key points 1 and 2 > Ok

7. Define Mesh Size

Preprocessor > Meshing > size cntrls > Manual size > Lines > All Lines> Enter No. of Element
divisions = 20 > Ok

8. Mesh the model

Preprocessor > Meshing > Mesh > Lines > Pick All

9. Define Analysis Type


Preprocessor > Loads > Analysis Type > New Analysis > select Modal > Ok.
10. Define Mode Extraction Method
Preprocessor > Loads > Analysis Type > Analysis Options > select Reduced Method > Enter No. of
modes to extract = 3 > No. of modes to expand = 3 > Ok
Enter Frequency range 0 To 2500
Enter No. of modes to print = 3 > Ok
11. Define Master DOFs
Preprocessor > Loads > Master DOFs > User Selected > Define > using mouse select All nodes except
first and last node > Ok > Lab-1 and Lab-2 select UY > Ok

87
12. Apply Constrain

Preprocessor > Loads > Define loads >Apply > Structural > Displacement > On Key Points >select left
key point 1 and right key point 2 > Ok > select All DOF > Enter Displacement Value = 0 > Ok

13. Solving the system


Solution > Solve > Current LS > Ok
VIEWING THE RESULTS
14. List First Three Fundamental Frequencies

General Postproc > List Results > Detailed Summary

88
THREE MODE SHAPES

15. Deformation plot

General Postproc > Read Results > First Set > Plot Results > Deformed Shape > select Def +
Undeformed > Ok

General Postproc > Read Results > Next Set > Plot Results > Deformed Shape > select Def +
Undeformed > Ok

89
General Postproc > Read Results > Next Set > Plot Results > Deformed Shape > select Def +
Undeformed > Ok

RESULT:

First natural frequency =

Second natural frequency =

Third natural frequency =

90
Ex. No. : 13. HARMONIC ANALYSIS OF A CANTILEVER BEAM

Date:

To perform harmonic analysis of Fixed Beam using Finite Element Analysis based ANSYS
software and also plot Amplitude Vs Frequency graph .

PROCEDURE

1. Defining the Problem


Utility Menu > File > Change Title>Mode Frequency Analysis of Fixed Beam
ANSYS Main Menu > preferences > turn on Structural > Ok
2. Define Type of element

Preprocessor > Element Type > Add/Edit/Delete > Add >Beam > 2 node 188> Ok > Options > pull
down K3 select Cubic Form > pull down K7 select All Section points > pull down K9 select All Section
points > Ok > Close

3. Define Material Properties

Preprocessor > Material Props > Material Models > Structural > Linear > Elastic > Isotropic > Enter EX
= 2.068E11 and PRXY = 0.3
Enter Density DENS = 7830 > Ok

91
4. Define Section Type

Preprocessor > Beam > Common sections > Pull down Sub- Type in the window > select square
section > Enter B = 0.01 and H = 0.01 > Preview > Ok

5. Modeling

Preprocessor > Modeling > Create > Key points > In Active CS > Key point number 1 > X= 0, Y= 0 and
Z = 0 > Apply > Key point number 2> X= 1, Y= 0 and Z Ok

6. Form a Line

Preprocessor > Modeling > Create > Lines > Lines > Straight Line >pick Key points 1 and 2 > Ok

7. Define Mesh Size

Preprocessor > Meshing > size cntrls > Manual size > Lines > All Lines> Enter No. of Element
divisions = 20 > Ok

8. Mesh the model

Preprocessor > Meshing > Mesh > Lines > Pick All

9. Define Analysis Type


Preprocessor > Loads > Analysis Type > New Analysis > select Harmonic > Ok.

10. Define Solution Method


Preprocessor > Loads > Analysis Type > Analysis Options > select Full > DOF printout format select
Real + imaginary > Ok
Equation Solver > pull down select Sparse solver > Ok

11. Apply Constrain


Preprocessor > Loads > Define loads >Apply > Structural > Displacement > On Key Points >select left
key point 1 > Ok > select All DOF > Enter Displacement Value = 0 > Ok

92
12. Apply Loads

Preprocessor > Loads > Define loads >Apply > Structural > Force / Moment > On Key Points >select
right key point 2 > Ok > select FY > Real part of force/mom = 100 and Imag part of force/mom = 0 >
Ok

93
13. Set the frequency range

Solution > Load Step Opts > Time/Frequency > Freq and Substeps > Enter Harmonic freq range 0 To
100 > Enter Number of substeps = 100 > select Stepped b.c.

14. Solving the system


Solution > Solve > Current LS > Ok

VIEWING THE RESULTS

TimeHist Postpro > Time History Variables – file .rst window should pop up as shown.

94
Select Add (the green '+' sign in the upper left corner) from this window and the following
window should appear

Nodal Solution > DOF Solution > Y-Component of displacement. Click OK.

o Graphically select right key point 2 when prompted and click OK. The 'Time History Variables'
window should now look as follows

95
2. List Stored Variables
o In the 'Time History Variables' window click the 'List' button, 3 buttons to the left of 'Add'
The following window will appear listing the data:

3. Plot UY vs. frequency


o In the 'Time History Variables' window click the 'Plot' button, 2 buttons to the left of 'Add'
The following graph should be plotted in the main ANSYS window.

96
Note that we get peaks at frequencies of approximately 8.3 and 51 Hz. This corresponds with the
predicted frequencies of 8.311 and 51.94Hz.
To get a better view of the response, view the log scale of UY.
o Select Utility Menu > PlotCtrls > Style > Graphs > Modify Axis
The following window will appear

o As marked by an 'A' in the above window, change the Y-axis scale to 'Logarithmic'
97
o Select Utility Menu > Plot > Replot
o You should now see the following

This is the response at node 2 for the cyclic load applied at this node from 0 - 100 Hz.

RESULT:

98
Ex. No. : 14. THERMAL STRESS ANALYSIS OF A 2D COMPONENT – STATIC

Date :

AIM:
To determine the thermal stress of a given component using FEA based ANSYS software.
A steel link, with no internal stresses, is pinned between two solid structures at a reference temperature
of 273 K. One of the solid structures is heated to a temperature of 348 K. As heat is transferred from the solid
structure into the link, the link will attempt to expand. However, since it is pinned this cannot occur and
as such, stress is created in the link. A steady-state solution of the resulting stress will be found to simplify the
analysis.
Loads will not be applied to the link, only a temperature change of 348 K. The link is steel with a modulus of
elasticity of 200 GPa, a thermal conductivity of 60.5 W/m*K and a thermal expansion coefficient of 12e-6 /K.

Preprocessing: Defining the Problem


Although the geometry must remain constant, the element types can change. For instance, thermal
elements are required for a thermal analysis while structural elements are required to determine the stress in the
link. It is important to note, however that only certain combinations of elements can be used for a coupled
physics analysis. For a listing, see Chapter 2 of the ANSYS Coupled-Field Guide located in the help file. The
process requires the user to create all the necessary environments, which are basically the preprocessing
portions for each environment, and write them to memory. Then in the solution phase they can be combined to
solve the coupled analysis.

PROCEDURE:

Thermal Environment - Create Geometry and Define Thermal Properties


1. Enter Title
Utility Menu > File > Change Title > Enter Thermal Stress Analysis
2. Open preprocessor menu
ANSYS Main Menu > Preprocessor > Turn on Thermal
3. Define the Type of Element
Preprocessor > Element Type > Add/Edit/Delete > Link > 3D conduction 33 > Ok > Close
4. Define Real Constants
Preprocessor > Real Constants > Add/Edit/Delete > Add > Enter Area = 4e-4 > Ok > Close
5. Define Element Material Properties

99
Preprocessor > Material Props > Material Models > Thermal > Conductivity > Isotropic > KXX
= 60.5
6. Modeling - Define Keypoints

Preprocessor > Modeling > Create > Keypoints > In Active CS > Key point number 1, X=0, Y=0
and Z=0 > Apply

Preprocessor > Modeling > Create > Keypoints > In Active CS > Key point number 2, X=1, Y=0
and Z=0 > Ok

7. Create Lines
Preprocessor > Modeling > Create > Lines > Lines > Straight Line > pick Key point number 1
and 2 > Ok
8. Define Mesh Size
Preprocessor > Meshing > Size Cntrls > ManualSize > Lines > All Lines > Enter No. of element
divisions = 20
9. Mesh the frame
Preprocessor > Meshing > Mesh > Lines > click 'Pick All'
10. Write Environment
(The thermal environment (the geometry and thermal properties) is now fully described and can
be written to memory to be used at a later time).
Preprocessor > Physics > Environment > Write
In the window that appears, enter the TITLE Thermal and click OK.

11. Clear Environment


Preprocessor > Physics > Environment > Clear > OK
(Doing this clears all the information prescribed for the geometry, such as the element type,
material properties, etc. It does not clear the geometry however, so it can be used in the next
stage, which is defining the structural environment).

Structural Environment - Define Physical Properties


Since the geometry of the problem has already been defined in the previous steps, all that is
required is to detail the structural variables.

100
12. Switch Element Type
Preprocessor > Element Type > Switch Elem Type > Choose Thermal to Struc from the scroll
down list. > Close

(This will switch to the complimentary structural element automatically. In this case it is LINK
8. For more information on this element, see the help file. A warning saying you should modify
the new element as necessary will pop up. In this case, only the material properties need to be
modified as the geometry is staying the same).
13. Define Element Material Properties
Preprocessor > Material Props > Material Models > Structural > Linear > Elastic > Isotropic >
EX = 200e9 and PRXY = 0.3

Preprocessor > Material Props > Material Models > Structural > Thermal Expansion > Secant
Coefficient > Isotropic > ALPX = 12e-6 > Ok > Close
14. Write Environment
The structural environment is now fully described.
Preprocessor > Physics > Environment > Write
In the window that appears, enter the TITLE Struct
Solution Phase: Assigning Loads and Solving
15. Define Analysis Type
Solution > Analysis Type > New Analysis > select Static > Ok
16. Read in the Thermal Environment
Solution > Unabridged Menu > 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).
17. Apply Constraints

Solution > Define Loads > Apply > Thermal > Temperature > On Key points > select Keypoint
1> Ok > select TEMP > Enter TEMP value = 348 > Ok

101
18. Solve the System

Solution > Solve > Current LS > Ok

19. Close the Solution Menu

Main Menu > Finish

(It is very important to click Finish as it closes that environment and allows a new one to be
opened without contamination. If this is not done, you will get error messages).

20. Plot Temperature

General Postproc > Plot Results > Contour Plot > Nodal Solu > DOF solution > Nodal
Temperature > Ok

(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 determing the structural effects).

21. Read in the Structural Environment

Solution > Physics > Environment > Read > Choose struct and click OK.

22. Apply Constraints

Solution > Define Loads > Apply > Structural > Displacement > On Key points > select Key
point 1 > Ok > select All DOF > Enter displacement value = 0 > Ok

Solution > Define Loads > Apply > Structural > Displacement > On Key points > select Key
point 2 > Ok > select UX > Enter displacement value = 0 > Ok

23. Include Thermal Effects


Solution > Define Loads > Apply > Structural > Temperature > From Therm Analy

(As shown below, enter the file name as file.rth. This couples the results from the solution of
the thermal environment to the information prescribed in the structural environment and uses it
during the analysis).

102
24. Define Reference Temperature
Preprocessor > Loads > Define Loads > Settings > Enter Reference Temp = 273 > Ok

25. Solve the System


Solution > Solve > Current LS > Ok

Postprocessing: Viewing the Results


1. Get Stress Data
Since the element is only a line, the stress can't be listed in the normal way. Instead, an element
table must be created first.
General Postproc > Element Table > Define Table > Add
Fill in the window as shown below.

103
2. List the Stress Data
General Postproc > Element Table > List Elem Table > COMPSTR > OK

The following list should appear. Note the stress in each element: -0.180e9 Pa, or 180 MPa in
compression as expected.

RESULT:

Thermal stress =

104
Ex. No. :15 CONDUCTIVE HEAT TRANSFER ANALYSIS OF A 2D COMPONENT

Date:

AIM:
To perform conductive heat transfer analysis of a given 2D component using FEA based ANSYS
software and plot temperature distribution.
PROCEDURE:
The Simple Conduction Example is constrained as shown in the following figure. Thermal conductivity (k) of
the material is 10 W/m*C and the block is assumed to be infinitely long.

1. Defining the Problem


File > clear and start new> do not read file >ok> yes
File > change title> conductive 2D thermal analysis
ANSYS Main Menu > preferences > turn on thermal
2. Define the Type of Element
Preprocessor > Element Type > Add/Edit/Delete... > click 'Add' > Select Thermal Mass Solid > Quad
4Node 55

105
3. Element Material Properties
Preprocessor > Material Props > Material Models > Thermal > Conductivity > Isotropic > KXX = 10
(Thermal conductivity)
4. Modeling
Preprocessor > Modeling > Create > Areas > Rectangle > By 2 Corners > X=0, Y=0, Width=1,
Height=1
5. After modeling is done save the model on a new folder
Ansys utility menu > plot controls > write metafile > invert white/black
6. Mesh Size
Preprocessor > Meshing > Size Cntrls > Manual Size > Areas > All Areas > 0.05
7. Mesh
Preprocessor > Meshing > Mesh > Areas > Free > Pick All
8. After meshing is done save the meshed model on a previous new folder
Ansys utility menu > plot controls > write metafile > invert white/black > Save

Solution Phase: Assigning Loads and Solving

9. Define Analysis Type


Solution > Analysis Type > New Analysis > Steady-State > ok

10. Apply Constraints


For thermal problems, constraints can be in the form of Temperature, Heat Flow, Convection, Heat Flux,
Heat Generation, or Radiation. In this example, all 4 sides of the block have fixed temperatures.
Solution > Define Loads > Apply > Thermal > Temperature > On lines > using cursor select top
horizontal line > ok

The following window will appear:

Fill the window in as shown to constrain the side to a constant temperature of 500

Solution > Define Loads > Apply > Thermal > Temperature > On lines > using cursor select bottom
horizontal line , left vertical line and right vertical line > ok

The following window will appear:

106
Fill the window in as shown to constrain the side to a constant temperature of 100
Orange triangles in the graphics window indicate the temperature contraints.
11. After boundary condition and loading is done save the same on a previous new folder
Ansys utility menu > plot controls > write metafile > invert white/black > Save

12. Solve the System


Solution > Solve > Current LS

Postprocessing: Viewing the Results


1. Results Using ANSYS
Plot Temperature
General Postproc > Plot Results > Contour Plot > Nodal Solu ... > DOF solution, Temperature
TEMP

13. Save the same on a previous new folder


Ansys utility menu > plot controls > write metafile > invert white/black > Save

14. Ansys utility menu > plot controls > animate > deformed results > dof solution > nodal temp

RESULT:

107
Ex. No. : 16 CONVECTIVE HEAT TRANSFER ANALYSIS OF A 2D COMPONENT

Date :

AIM:

To perform convective heat transfer analysis of a given 2D component using FEA based ANSYS
software and plot temperature distribution.

PEROCEDURE:

1. Defining the Problem


File > clear and start new > do not read file > ok > yes
File > change title> convective 2D thermal analysis
ANSYS Main Menu > preferences > turn on thermal
2. Define the Type of Element
Preprocessor > Element Type > Add/Edit/Delete... > click 'Add' > Select Thermal Mass Solid > Quad
4Node 55

3. Element Material Properties


Preprocessor > Material Props > Material Models > Thermal > Conductivity > Isotropic > KXX = 10
(Thermal conductivity)
4. Modeling

108
Preprocessor > Modeling > Create > Areas > Rectangle > By 2 Corners > X=0, Y=0, Width=1,
Height=1

5. After modeling is done save the model on a new folder


Ansys utility menu > plot controls > write metafile > invert white/black
6. Mesh Size
Preprocessor > Meshing > Size Cntrls > Manual Size > Areas > All Areas > 0.05

7. Mesh
Preprocessor > Meshing > Mesh > Areas > Free > Pick All
8. After meshing is done save the meshed model on a previous new folder
Ansys utility menu > plot controls > write metafile > invert white/black
9. Define Analysis Type
Loads > Analysis Type > New Analysis > Steady-State > ok

10. Apply Conduction Constraints


In this example, all 2 sides of the block have fixed temperatures, while convection occurs on the other 2
sides.
1. Solution > Define Loads > Apply > Thermal > Temperature > On Lines
2. Select the top line of the block and constrain it to a constant value of 500
3. Using the same method, constrain the left vertical line of the block to a constant value of 100
11. Apply Convection Boundary Conditions
1. Solution > Define Loads > Apply > Thermal > Convection > On Lines
2. Select the right vertical line of the block.
The following window will appear:

3. Fill in the window as shown. This will specify a convection of 10 W/m2*C and an ambient
temperature of 100 degrees Celcius. Note that VALJ and VAL2J have been left blank. This is
because we have uniform convection across the line.

109
12. Apply Insulated Boundary Conditions
1. Solution > Define Loads > Apply > Thermal > Convection > On Lines
2. Select the bottom line of the block.
3. Enter a constant Film coefficient (VALI) of 0. This will eliminate convection through the side,
thereby modeling an insulated wall. Note: you do not need to enter a Bulk (or ambient)
temperature.You should obtain the following:

13. After boundary condition and loading is done save the same on
a previous new folder
Ansys utility menu > plot controls > write metafile > invert white/black > Save
14. Solve the System
Solution > Solve > Current LS > Ok > Close
Plot Temperature
General Postproc > Plot Results > Contour Plot > Nodal Solu ... > DOF solution, Temperature
TEMP

15. save the same on a previous new folder


Ansys utility menu > plot controls > write metafile > invert white/black > Save

16. Animate The Nodal Temperature


Ansys utility menu > plot controls > animate > deformed results > dof solution > nodal temp

RESULT:

110
Ex. No. : 17 ANALYSIS OF FLUID FLOW OVER A HOLE

Date:

AIM:

To perform fluid flow analysis of a given 2D component using FEA based ANSYS software and plot
velocity distribution and pressure distribution.

PROCEDURE

1. Defining the Problem


File > clear and start new > do not read file > ok > yes
File > change title> Fluid Flow Analysis
ANSYS Main Menu > preferences > turn on FLOTRAN CFD
2. Define the Type of Element
Preprocessor > Element Type > Add/Edit/Delete > Add > select 2D FLOTRAN 141 > Ok
3. Modeling

(A).Draw the rectangle


Preprocessor > Modeling > Create > Areas > Rectangle > By 2 Corners > WP X=0, WP Y=0, Width=2,
Height=1

(B). Draw the circle

111
Preprocessor > Modeling > Create > Areas > Circle > Solid Circle > WP X= 1 WP Y=0.5, and Radius =
0.2

(C).Numbering Areas
Utility Menu >plot controls > Numbering> pick Areas

(D).Subtraction
Now we want to subtract the circle (2) from the rectangle (1).

Modeling > Operate > Booleans > Subtract > Areas > Enter 1 > ok> Enter 2 > ok

4. Mesh Size
Preprocessor > Meshing > Mesh Tool > Close

5. Mesh
Preprocessor > Meshing > Mesh > Areas > Free > Pick All

6. Apply Loads
Preprocessor > Loads > Define Loads > Apply > Fluid /CFD > Velocity > On Lines > pick the
left edge of the plate > Ok > Enter VX = 1 > Ok
Preprocessor > Loads > Define Loads > Apply > Fluid /CFD > Velocity > On Lines > pick edges
around the circle > Ok Enter VX = 0 and Enter VY = 0 > Ok

Preprocessor > Loads > Define Loads > Apply > Fluid /CFD > Pressure DOF > On Lines > pick
the top, bottom and right edges of the plate > Ok > Ok

112
7. Solution
Solution > FLOTRAN CFD Set Up > Fluid Properties > a dialog box appears in that select
against density as Liquid and against Viscosity as Liquid > Ok

Then another dialog box appears in that Enter the value of Density (Nominal value) = 1000 and
Viscosity (Nominal value) = 0.001 > Ok

Solution > FLOTRAN CFD Set Up > Execution Ctrl > A dialog box appears in that Enter in the
first row Global Iterations = 200 > Ok

Solution > Run FLOTRAN > Close

VIEWING THE RESULTS

8. Velocity Distribution

General Postproc > Read Results > Last Set

General Postproc > Plot Results > Contour Plot > Nodal Solution > Select DOF solution > select
Fluid Velocity > Ok

113
9. Velocity Vector Plot

General Postproc > Plot Results > Contour Plot > Vector Plot >Predefined

10. Pressure Distribution

General Postproc > Plot Results > Contour Plot > Nodal Solution > Select DOF solution > select
Pressure > Ok

RESULT:
114
EX.NO.18: STUDY OF BASICS OF MATLAB

DATE:

AIM:

To study the basic operations, commands and codes of MATLAB.

INTRODUCTION

This chapter is a brief introduction to MATLAB ( an abbreviation of MATrix LABoratory) basics,


registered trademark of computer software, version 4.0 or later developed by the Math Works Inc. The
software is widely used in many of science and engineering fields, MATLAB is an interactive program
for numerical computation and data visualization. MATLAB is supported on unix, macintosh, and
windows environments. for more information on MATLAB, contact the Math Work.com. a windows
version of MATLAB is assumed here. The syntax is very similar for the dos version.

MATLAB integrates mathematical computing, visualization, and a powerful language to provide a


flexible environment for technical computing. The open architecture makes it easy to use MATLAB and
its companion products to explore data, create algorithms, and create custom tools that provides early
insights and competitive advantages.

Known for its highly optimized matrix and vector calculations, MATLAB offers on intuitive languages
for expressing problems and their solutions both mathematically and visually. Typically uses include:

o Numeric computation and algorithm development


o Symbolic computation (with the built-in symbolic math function)
o Modeling, simulation, and prototyping
o Data analysis and signal processing
o Engineering graphics and scientific visualization

In this chapter, We will introduce the MATLAB environment, We will learn how to create , edit, save,
run, and debug m-files (ASCII files with series of MATLAB statements). We will see how to create arrays
(matrices and vectors), and explore the built-in MATLAB linear algebra functions for matrix and vector
multiplication, do not cross products, transpose, determinates, and inverses and for the solution linear
equations. MATLAB is based on the language c, but is generally much easier to use. We will also see how to
program logic constructs and oops in MATLAB, how to use subprograms and functions, and how to use
comments (%) for explaining the programs and tabs for easy readability, and how to print and plot graphics
both two and three dimensional MATLAB's functions for symbolic mathematics are presented. use of these
functions to perform symbolic operations, to develop closed from expression for solution to algebraic equations,
ordinary differential equations , and system equation for presented . Symbolic mathematics can be used to
determine analytical expression for the derivative and integral of an expressions.

115
Starting and Quitting MATLAB

To start MATLAB click on the MATLAB icon or type in MATLAB , followed by pressing the enter or return
key at the system prompt. the screen will produce the MATLAB prompt >>(or EDU>>), which indicates that
MATLAB is waiting for a command to be entered.

in order to quit MATLAB, type quit or exit after prompt , followed by pressing the enter or return key.

Display Windows

MATLAB has three display windows. They are

1. A command Windows which is used to enter commands and data to display plots and graphs.

2.A Graphic Windows which is used to display plots and graphs

3. A Edit window which used to crate and modify m-files. m-flies are the files that contain a program are script
of MATLAB commands.

Entering Commands

Every command has to be followed by a carrier return <cr> (enter key) in order that the command can be
executed. MATLAB command are case sensitive and lower case letters are used throughout.

To execute an M-files (such as Project_1.m ). simply enter the name of the file without its extension (as in
project_1).

MATLAB expo

In order to see some of the, MATLAB capabilities , enter the demo command this will initiate the MATLAB
expo , MATLAB Expo is a graphical demonstration environment that shows the some of the different type of
operations which can be conducted with MATLAB.

Abort

In order to abort a command in MATLAB , hold down the control key and press c to generate a local abort with
MATLAB.

The Semicolon (;)

If a semicolon (;) is typed at the end of the command , the output of the command is not displayed.

Typing %

When percent symbol (%) is typed in the beginning of a line, the line is designated as a command . W.....hen
the enter key is pressed , the line is not executed.

116
The clc Command

The typing clc command and pressing enter cleans the command windows. once the clc command is executed a
clear windows is displayed.

Help

The MATLAB has a host of bulit in fuctions. For complete list , refer to MATLAB user's guide or refer to
online Help . To obtain the help on the particular topic in the list, eg. inverse , type help inv.

Statements and Variables

Statements have the form

>> variable = expression

the equal sign implies the asssign ment of the expression to the variable. for instance to enter a 2x2

matrix with a variable name A, we write

>> A= ={1 2 ; 3 4 } <ret>

the statement is executed after the carriage return (or enter ) key is pressed to display

A=

1 2

3 4

ARITHMATIC OPERATION

The symbols for arithmetic operations with scalars are summarized below in tables 2.1

Table:

Arithmatic operation Symbol Example


Addition + 6+3=9
Subtraction - 6-3=3
Multiplication X 6*3=18
Right division / 6/3=2
Left division \ 6\3=3/6=1/2
Exponentiation ^ 6^3(63=261)

117
Table Common Math Functions

Function Description

abs(x) Computes the absolute value of x

sqrt(x) Computes the square root of x

round(x) Rounds x to nearest integer

fix(x) Rounds (or truncates ) x to the nearest integer

floor(x) Rounds x to the earest integer toward -∞

ceil(x) Rounds x to the earest integer toward ∞

sign(x) Returns a value of -1 if x is less than 0, a value


of 0 if equals 0, and a value of 1 otherwise

rem(x,y) Returns the remainder of x/y. for example,


rem(25,4) is 1, and rem (100,21) is 16. This
function is also called a modulus function

exp(x) Computes ex, where e is the base for natural


logarithms , or approximately 2.718282

log(x) Computes ln x, the atural logarithm of x to the


base e.

log10(x) Computes log10 x, the common logarithm of x


to the base 10

Table Exponential Functions

Function Description

exp(x) Exponential (ex)

log(x) Natural logarithm

log10(x) Base 10 logarithm

sqrt(x) Square root

118
Table trigonometric and hyperbolic functions

Function Description

sin(x) Computes the sine of x, where x is in radians

cos (x) Computes the cosine of x, where x is in


radians

tan(x) Computes the tangent of x, where x is in


radians

asin(x) Computes the arcsine or inverse sine of x,


where x is must be between -1 and 1. the
function returns an angle oin radians between
𝜋 𝜋
-2 and 2

acos(x) Computes the arccosine or inverse cosine of


x, where x is must be between -1 and 1. the
function returns an angle oin radians between
0 and π

atan(x) Computes the arctangent or inverse tangent


of x. the function returns an angle oin radians
𝜋 𝜋
between - 2 and 2

atan2(y,x) Computes the arctangent or inverse tangent


of y/x. the function returns an angle oin
radians between x and y

sinh(x) computes the hyperbolic sine of x,which is


equal to ex-e-x/2

cosh(x) computes the hyperbolic cosine of x,which is


equal to ex+e-x/2

tanh(x) compute the hyperbolic tangent of x, which is


equal to sinhx/coshx

asinh(x) compute the hyperbolic sine of x, which is


equal to x+√𝑥 2 + 1

acosh(x) compute the hyperbolic cosine of x, which is

119
equal to x+√𝑥 2 − 1

atanh(x) compute the inverse hyperbolic tangent of x,


1+𝑥
which is equal to √1−𝑥

Table on- line help

Function description

Help lists topics on which help is available

Helpwin opens the interactive help window

Helpdesk opens the web browser based help facility

Helptopic provides help on topic

lookfor string lists help topics containing string

Demo runs the demo program

Workplace information

function description

who lists variables currently in the workplace

whos lists variables currently in the workplace with


their size

what lists m, mat, and mex- files on the disk

clear clears the workplace, all variables are


removed

clear x y z clears only variables x, y, and z.

clear all clears all variables and functions from


workplace

mlock fun looks fun so that clear cannot remove it

munlock fun unlocks function fun so that clear can remove


it

120
clc clear command window, command histo0ry
is lost

home same as clc

clf clears figure window

ARRAYS

An array ia a list of numbers arranged in rows and or columns. a one dimensional arrray is a row or a column of
numbers and a two dimensional array has a set of numbers arranged in rows and columns. an array operation is
performed element by element.

ROW VECTOR

A vector is a row or column of elements.

In a row vector the elements are entered with a space or a comma between the elements inside the square
brackets. for example,

x=[7 -1 2 -5 8]

COLUMN VECTOR

In a column vector the elements or enterd with asemicolun between the elements inside the square brackets. for
example,

x= [7; -1; 2; -5; 8;]

MATRIX

A matrix is a two dimensional array which has numbers in rows and columns. A matrix is a enterd a row wise
with consecutive elements of a rows sepearted by a space or a comma, and the rows seperated by a semi colon
or carriage returns, the entire matrix is enclosed with in square brackets, in the elements of matrix may be real
numbers or comples numbers. for example to enter the matrix

1 3 −4
A=[ ]
0 −2 8

The mat lab input command is

A=[1 3 -4; 0 -2 8]

similarly for complex number elements of a matrix B

−5𝑋 𝑙𝑛2𝑥 + 7𝑠𝑖𝑛3𝑦


B=[ ]
3𝑖 5 − 13𝑖

121
The matlab input command is

B=[-5*x log(2*x)+7*sin(3*y); 3i 5-13i ]

ADDRESING ARRAYS

A colon can be used in mat lab to addres a range of elements in a vector or a matrix

COLON FOR A VECTOR

Va(:) - refers to all the elements of the vector Va (either a row or a column vector)

Va(m:n) - refers to a elements m through n of the vector Va

For instance

>> V =[2 5 -1 11 8 4 7 -3 11]

>> U= V(2:8)

U= 5 -1 11 8 4 7 -3 11

COLUMN FOR A MATRIX

Table gives the use of colon in addresing arrays in a matrix\

colon use for a matrix

Command Description

A(:,n) refers to the elements in alll the rows of a coloumn n of the matrix A

A(n,:) Refers to the elements in all the columns of row n of the matrix A

A(:,m:n) Refers to the elements in all the rows between coloumns m and n of the
matrix A

Refers to the elements in all the coloumns between rows m and n of the
A(m:n, :) matrix A

Refers to the elements in all the rows m through n and coloumns p through
A(m:n, p:q) q of the matrix A

Adding elements to a vector or a matrix

122
A variable that exists as a vector, or a matrix, can be changed by adding elements to it. Addition of elements is
done by assigining values of the additional elements, or by appending existing varibales . rows and or coloumns
can be added to an existing matrix by assigning values to the new rows or columns.

DELETING ELEMENTS

An element, or a range of elements. of an existing variable can be deleted by reassigning blanks to these
elements. this is done simply by the use of square brackets with nothing typed in between them.

BUILT-IN FUNCTIONS

Some of the built-in functions available in MATLAB for managing and handling arrays as listed

Built-in functions for handling arrays

Function Description

Length(A) Returns the number of elements in the vector A.

Size(A) Returns a row vector [m,n], Where m and n are the size mxn of the array A.

Reshape(A,m,n) Rearrange a matrix A that has r rows and a coloumns to have m rows and n
columns r times s must be equal to m times n.

Diag(v) When v is a vector, create a square matrix with the elements of v in the
diagonal

Ia (A0 When A is a matrix, creates a vector from the diagonal of A.

2.10 OPERATIONS WITH ARRAYS

We consider here matrices that have than one row and more than one column

ADDITION AND SUBTRACTION OF MATRICES

The addition ( the sum) or the subtraction (the difference) of the two arrays is obtained by adding or subtracting
their corresponding elements. These operations are performed with arrays of identiacal size (same number of
rows and columns.)

for example if A and B are two arrays (2x3 matrices)

𝑎11 𝑎12 𝑎13 𝑏11 𝑏12 𝑏13


A = [𝑎 𝑎22 𝑎23 ] and B=[𝑏21 ]
21 𝑏22 𝑏23

then, the matrix addition (A+B) is obtained by adding A and B is

123
𝑎11 + 𝑏11 𝑎12 + 𝑏12 𝑎13 + 𝑏13
[ ]
𝑎21 + 𝑏21 𝑎22 + 𝑏22 𝑎23 + 𝑏23

DOT PRODUCT

The product is a scalar computed from two vectors of the same size. the scalar is the sum of the products of the
values in corresponding positions in the vectors.

for n elements in the vectors A and B

dot product = A.B = ∑𝑛𝑖=1 𝑎𝑖 𝑏𝑖

dot (A,B) computes the dot product of A and B. if A and B are matrices , the dot product is a vector containing
the dot products for the corresponding columns of A and B

ARRAY MULTIPLICATION

The value in positon ci,j of the product C of two matrices , A and B, is the dot product of row I of the first matrix
and column j of the second matrix:

Ci,j = ∑𝑛𝑘=1 𝑐𝑖,𝑗 𝑏𝑘,𝑗

Array division

The division operation can be explained by means of the identity matrix and the inverse matrix operation .

Identity matrix

An identity matrix is a square matrix in which all the diagonal elements are 1’ds, and the remaining elements
are 0’s. if a matrix A is square, then it can be multiplied by the identity matrix, I, from the left or from the right

AI=IA=A

Inverse of a matrix

The matrix B is the inverse of the matrix A if when the two matrices are multiplied the product is the identity
matrix. Both matrices A and B must be square and the order of the multiplication can be AB or BA

AB=BA=I

Transpose

The transpose of a matrix is a new matrix in which the rows of the orginal matrix are the columns of the new
matrix. The transopse of a given matrix A is denoted by AT. in MATLAB, the transpose of the matrix A is
denoted by A’

124
Determinant

A determinant is a scalar computed from the entries in a square matrix. For a 2x2 matrix A, the determinant is

|A| = a11a22-a21a12

MATLAB will compute determinant of a matrix using the det function:

Det (A) computes the determinant of a suare matrix A .

Array Division

MATLAB has two types of array divisions, which are the left division and the right division.

Left division

The left division is used to solve the matrix equation Ax=B where x and B are column vectors.

Multiplying both sides of this equation by inverse of A, A-1, we have

A-1Ax=A-1 B

or Ix = ᵪ = A-1 B

In MATLAB, the above equation is written by using the left division character:

ᵪ = A\B

Right Division

The Right division is used to solve the matrix equation xA = B where x and B are row vectors.

Multiplying both sides of this equation by the inverse of A, A-1 , we have

ᵪ.A A-1 = B.A-1

ᵪ = B . A-1

or

In MATLAB, this equation is written by using the right division character:

ᵪ=A/B

Eigenvalues and Eigenvectors

Consider the following equation,


125
AX = λX

Where A is an n X n square matrix, X is a column vector with n rows and λ is a scalar.

The values of λ for which X are nonzero are called the eigenvalues of the matrix A, and

The corresponding values of X are called the eigenvalues of the matrix A .

Equation (2.1) can also be used to find the following equation

(A – λI) X = 0

Where IIs an n x n identity matrix. Equation (2.2) corresponding to a set of homogeneous

Equation and has nontrivial solutions only if the determinant is equal to zero, or

│A – λI│ = 0

Equation (2.3) is known as the characteristic equation of the matrix A. The solution to

Eq. (2.3) gives eigenvalues of the matrix A.

MATLAB determines both the eigenvalues and ei8genvectors for a matrix A.

eig (A) Computes a column vector containing the eigenvalues of A.

[Q,d] = eig(A)Computes a square matrix Q containing the eigenvectors of A as columns

And a square matrix d containing the eigenvalues (λ) of A on the diagonal.

The values of Qand d are such thatQ*Qis the identity matrix and A*X

Equals (λ) times X.

126
Element – by element operations

Arithmetic operations

Matrix operators Array operators

+ Addition + Addition

- Subtraction - Subtraction

* Multiplication .* Array Multiplication

^ Exponentiation .^ Array Exponentiation

/ Left division ./ Array Left division

\ Right division .\ Array Right division

Matrix Division

The solution to the matrix equation AX = B is obtained using matrix division , or X = A/B. The vector X
then contains the values of x

Matrix Inverse

For the solution of the matrix equation AX = B , we premultiply both sides of the equation by A-1

A-1AX = A-1B

Or IX = A-1B
127
Where I is the identity matrix

Hence X = A-1B

In MATLAB , we use the command x = inv (A)*B. Similarly , for XA = B, we use the command x=
B*inv (A)

The basic computional unit in MATLAB is the matrix . A matrix expression is enclosed in square
brackets , [ ].Blanks or commas seprate the column elements , and semisolons or carriage return separate the
rows.

Matrix operations require that the matrix dimensions be compatible . If A is an n * m and B is a p * r


then A ± B is allowed only if n = p and m = r . similarly , matrix product A*B is allowed only if m = p.

SCRIPT FILES

A script is a sequence of ordinary statement and functions used at the command prompt level. A Script
is invoked at the command prompt level by typing the file-name or by using the pull down menu. Script can
also invoke other scripts.

The commands in the command window cannot be saved and executed again. Also, the command
window is not interactive. To overcome these difficulties, the procedure is first to create a file with a list of
command, save it, and then run the file. In this way the commands contained are executed in the order they are
listed when the file is run. In addition, as the need arises, one can change or modify the commands in the file,
the file can be saved and run again the file that are used in this fashion are known as script file. Thus, a script
file is a text file that contains a sequence of MATLAB commands. Script file can be edited (corrected and/or
changed)and executed many times.

Creating and Saving a script File

Any text editor can be used to create script files. In MATLAB script file are created and edited in the
Editor/Debugger window .this window can be opened from the command window, select file, New, and then
M-file. Once the window is open, the commands of the script file are typed line. The commands can also be
typed in any text editor or word processor program and then copied and pasted in the edit/debugger window.
The second type of M-File is the function file. Function file enables the user to extend the basic library function
by adding one’s own computational procedures. Function M-files are expected to return one or more results.
Script files and function files may include reference to other MATLAB toolbox routines.

MATLAB function file begins with a header statement of the form:

Function (name of result or results)=name (argument list)

Before a script file can be executed it must be saved. All script files must be saved with the extension “.m”.
MATLAB refers to them as m-files. When using MATLAB M-files editor, the files will automatically be saved
with the “.m” extension. If any other text editor is used, the file must be saved with the “.m” extension, or
MATLAB will not be able to find and run the script file. This is done by choosing save As… from the file

128
menu, selecting a location, and entering a name for the file. The names of user defined variables, predefined
variables, MATLAB commands or functions should not be used to name script files.

Running a script file

A script file can be executed either by typing its name in the command window and then pressing the enter
key, directly from the Editor Window by clicking on the Run icon. File The is assumed to be in the current
directly, or in the search path.

Input to a script file

There are three ways of assigning a value to variable in a script file.

1. The variable is defined and assigned value in the script file

2. The variable is defined and assigned value in the command windows

3. The variable is defined in the script file, but a specified value

Output commands

There are two commands that are commonly used to generate output. They are the disp and fprintf
commands.

1. The disp command


The disp command displays the elements of a variable without displaying the name of the variable, and
displays text

2. The fprintf command


The fprint command displays output (text and data) on the screen or saves it to a file. The output can be
formatted using this command

PROGRAMMING IN MATLAB

One most significant of MATLAB is its extendibility through user-written programs such as the M-files. M-
files are ordinary ASCII text files written in MATLAB language. A function file is a subprogr

Relational and logical operators

A relational operator compares two numbers by finding whether a comparison statement is true or false. A
logical operator examines true/false statements and produces a result which is true or false according to the
specific operator. Relational and logical operators are used in mathematical expressions and also in combination
with other commands, to make decisions that control the flow of a computer program.

MATLAB has six relational operators as shown in table

129
Relational operators

Relational
Interpretation
operators

< Less than

<= Less than or equal

> Greater than

>= Greater than or equal

== Equal

̴= Not equal

The logical operators in MATLAB are shown in table

Logical operators

Logical operator Name Description

& AND Operators on two operands (A and B). If both are true, the result
is true (1), otherwise the result is false (0).
Example: A&B

I OR Operators on two operands (A and B). If either one, or both are


true, the result is true (1), otherwise (both are false) the result is
Example: AIB false (0).

˞ NOT Operators on one operand (A). Give the opposite of the


operand. True (1) if the operand is false, and false (0) if the
Example: ̴A operand is true.

130
Order of precedence

The following table shows the order of precedence used by MATLAB.

Precedence Operation

1 (highest) Parentheses (If nested parentheses exist, inner have precedence).

2 Exponentiation

3 Logical NOT ( ̴)

4 Multiplication, Division.

5 Addition, Subtraction.

6 Relational operators (>,<,>=,<=,==, ̴ =)

7 Logical AND (&).

8 (lowest) Logical OR (I)

2.16.3 Built-in logical Functions

The MATLAB built-in functions which are equivalent to the logical operators are:

And (A, B) Equivalent to A & B

Or (A, B) Equivalent to A I B

Not (A) Equivalent to ̴A

List of the MATLAB logical built-in functions are described in table

GRAPHICS

MATLAB has many commands that can be used to create basic 2-D plots, overlay plots, specialized 2-D plots,
3-D plots, mesh, and surface plots.

Basic 2-D plots

The basic command for producing a simple 2-D plots is

Plot(xvalue y values, ‘style option’)

Where x value and y values are vectors containing the x-and y-coordinates of points on the graph.

131
Style option is an optional argument that specifies the color, line-style, and the point-marker style.

The style option in the plot command is a character string that consists of 1,2 or 3 characters that specify the
color and/or the style. The different color, line-style and marker style option are summarized in table

color, line-style, and marker-style options

Color style-option Line style-option Marker style-option

Y yellow - Solid + plus sign


- - dashes
M magenta ; dotted 0 circle
* asterisk
C cyan -. Dash-dot
X x-mark
R red
. point
G green
^up triangle
B blue
S square
W white
D diamond, etc.
R black

Specialized 2-D plots

There are several specialized graphics function available in MATLAB for 2-D plots. The list of functions
commonly used in MATLAB for plotting x-y data are in Table.

List of function for plotting x-y data

Function Description

Area Creates a filled area plot.

Bar Creates a bar graph.

Barh Creates a horizontal bar graph.

Comet Makes an animated 2-D plots.

Compass Creates arrow graph for complex number.

Contour Makes contour plots

132
Contourf Makes filled contour plots.

Errobar Plots a graph and puts error bars.

Feather Makes a feather plot.

Fill Draws filled polygons of specified color.

Fplot Plots a function of a single variable.

Hist Makes histograms.

Loglog Creates plots with log scale on both x and y axes.

Pareto Makes pareto plots.

pcolor Makes pseudo color plot matrix

command Description

Pie Creates a pie chart.

Plotyy Makes a double y-axis plot.

Plotmatrix Makes a scatter plot of a matrix.

Polar Plots curves in polar coordinates.

Quiver Plots vector fields.

Rose Makes angled histograms.

Scatter Creates a scatter plot.

Semilogx Makes semilog plot with log scale on the x-axis.

Semilogy Makes semilog plot with log scale on the y-axis.

Stairs Plots a stair graph.

stem Plots a stem graph.

Overlay plots

There are three ways of generating overlay plots in MATLAB, they are

(a)Plot command
133
(b)Hold command

(c)Line command

(a)Plot command. Example E2.7(a) shows the use of plot command used with matrix argument, each
column of the second argument matrix plotted against the corresponding column of the first argument matrix.

(b)Hold command . invoking hold on at any point during a session freezes the current plot in the graphics
window. All the next plots generated by the plot command are added to the exiting plot. See Example E2.7(a).

(c)Line command. The line command takes a pair of vectors (or a triplet in 3-D) followed by a parameter
name/parameter value pairs as argument. For instance, the command: line (x data, y data, parameter name,
parameter value) adds lines to the existing axes. See Example E2.7(a).

3-D plots

MATLAB provides various options for displaying three-dimensional data. They include line and wire, surface,
mesh plots, among many others. More information can be found in the Help window under plotting and Data
visualization. Table lists commonly used function.

Functions used for 3-D graphics

command Description

Plot3 Plots three-dimensional graph of the trajectory of a set of thee


parametric equations x(t), y(t), and z(t) can be obtained using
plot3(x,y,z).
Meshgrid If x and y are two vectors containing a range of points for the evaluation
of a function, [X,Y]=meshgrid(x,y) returns two rectangular matrices
containing the x and y values at each point of a two-dimensional grid.

If X and Y are rectangular arrays containing the values of the x and y


Mesh(X,Y,z) coordinates at each point of a rectangular grid, and if z is the value of a
function evaluated at each of these points, mesh(X,Y,z) will produce a
three-dimensional perspective graph of the points. The same results can
be obtained with mesh(x,y,z) which can also b used.

command Description

Mesch,meshz If the xy grid is rectangular, these two function are merely variations of
the basic plotting program mesh, and they operate in an identical
fashion. Meshc will produce a corresponding contour plot drawn on the
xy plane below the three dimensional figure, and meshz will add a

134
vertical wall to the outside features of the figures drawn by mesh.

Produces a three-dimensional perspective drawing. Its use is usually to


draw surfaces, as opposed to plotting functions, although the actual
Surf tasks are quite similar. The output of surf will be a shaded figure. If
row vectors of length n are defined by x=y cos and y=r sin , with 0_<
2they correspond to a circle of radius r. if r is column vector equal to
r=[0 1 2]’;then z=r*ones(size(x)) will be a rectangular, 3 x n,arrays of
0’s and 2’s, and surf(x,y,z) will produce a shaded surface bounded by
three circles; i.e., a cone.

This function is related to surf in the same way that meshc is related to
mesh.

Used to change the default coloring of a figure. See the MATLAB


reference manual or the help file.
Surfc
Controls the type of color shading used in drawing figures. See the
Colormap MATLAB reference manual or the help file.

View(az,el) controls the perspective view of a three-dimensional plot.


The view of the figure is from angle ”el” above the xy plane with the
coordinate axes (and the figure) rotated by an angle “az” in a clockwise
direction about the z axis. Both angles are in degrees. The default
values are az=371/2 and el=30
View
Determines or changes the scaling of p plot. If the coordinate axis
limits of a two dimensional of three-dimensional graph are contained in
the row vector r=[] axis will return the values in this vector, and axis(r)
can b used to alter them. The coordinate axes can be turned on and off
with axis(‘on’) and axis(‘off’). A few other string constant inputs to
axis and their effects are given below:

Axis(‘equal’) x and y scaling are forced to be the same.


Axis
Axis(‘square’) The box formed by the axes is square.

Axis(‘auto’) Restores the scaling to default settings.

Axis(‘normal’) Restoring the scaling to full size, removing any effects


of

square or equal settings.

Axis(‘image’) Alters the aspect ratio and the scaling so the screen
pixels are

135
square shaped rather than rectangular.

The use is contour(x,y,z). A default value of N=10 contour lines will be


drawn. An optional fourth argument can be used to control the number
of contour lines that are drawn. Contour(x,y,z,V), if V is a vector
containing values in the range of z values, will draw contour lines at
each value of z=V.

Plots line or curves in three dimensions. If x,y, and z are vectors of


equal length, plot3(x,y,z)will draw, on a three-dimensional coordinate
axis system, the lines connecting the points. A fourth argument,
representing the color and symbols to b used at each point can be added
Contour in exactly the same manner as with plot.

Grid on adds grid lines to a to-dimensional or three-dimensional graph;


grid off removes them.

Draws “slices” of a volume at a particular location within the volume.

Plot3

Grid

slice

136
Result :- Thus the basic commands and codes of MATLAB were studied.

137
EX.NO.19: DETERMINATION OF MATRIX OPERATIONS

DATE:

AIM:

1 0 1 7 4 2
Consider two matrices A = [ 2 3 4 ] and B = [ 3 5 6 ] Using MATLAB, determine the following,
− 1 6 7 − 1 2 1
(a) A+B, (b) AB, (c) A , (d) A , (e)B , (f) B A , (g) A2+B2-AB, and (h) determinant of A, determinant of B
2 T -1 T T

and determinant of AB

SOLUTION

>> A=[1 0 1;2 3 4;-1 6 7]

A =1 0 1

2 3 4

-1 6 7

>> B=[7 4 2;3 5 6;-1 2 1]

B =7 4 2

3 5 6

-1 2 1

>> C=A+B

C =8 4 3

5 8 10

-2 8 8

>> D=A*B

D =6 6 3

19 31 26

4 40 41

>> E=A^2
138
E =0 6 8

4 33 42

4 60 72

>> %Let F=transpose of A

>> F=A'

F= 2 -1

0 3 6

1 4 7

>> H=inv(B)

H = 0.1111 0.0000 -0.2222

0.1429 -0.1429 0.5714

-0.1746 0.2857 -0.3651

>> J=A'*B'

13 7 2

24 51 12

37 65 14

>> I=B'*A'

I =6 19 4

6 31 40

3 26 41

>> K=A^2+B^2-A*B

K =3 52 45

15 51 58

-2 28 42

>> det(A)

ans = 12
139
>> det(B)

ans = -63.0000

>> det(A*B)

ans = -756.0000

RESULT: - (a) A+B =

(b) AB =

(c) A2=

(d) AT =

(e)B-1 =

(f) BTAT =

(g) A2+B2-AB =

(h) Determinant of A=

Determinant of B =

Determinant of AB =

140
EX.NO.20: DETERMINATION OF EIGEN VALUES AND EIGEN VECTORS

DATE:

AIM:

To determine the eigenvalues and eigenvectors of A and B using MATLAB

4 2 −3 7 4 2
A = [ −1 1 3 ] and B = [ 3 5 6 ]
2 5 7 1 2 1

Solution

>> A=[4 2 -3; -1 1 3; 2 5 7]

A =4 2 -3

-1 1 3

2 5 7

>> B=[1 2 3; 8 7 6; 5 3 1]

B =1 2 3

8 7 6

5 3 1

>> eig(A)

ans =0.5949

3.0000

8.4051

>> lamda=eig(A)

lamda = 0.5949

3.0000

8.4051
141
>> [v,d]=eig(A)

v = -0.6713 0.9163 -0.3905

0.6713 -0.3984 0.3905

-0.3144 0.0398 0.8337

d = 0.5949 0 0

0 3.0000 0

0 0 8.4051

Result:-

Eigenvalues =

Eigenvectors =

142
EX.NO.21: SOLUTION OF SIMULTANEOUS EQUATIONS

DATE:

AIM:

Solve the following set of equations using MATLAB

x1+2x2+3x3+5x4=21

-2x1+5x2+7x3-9x4=18

5x1+7x2+2x3-5x4=25

-x1+3x2-7x3+7x4=30

Solution

[A][x] = [B]

1 2 3 5 𝑥1 21
−2 5 7 − 9 𝑥2 18
[ ]x[ ]=[ ]
5 7 2 − 5 𝑥3 25
−1 3 − 7 7 𝑥4 30
[x] = [A]-1B

>> A=[1 2 3 5; -2 5 7 -9; 5 7 2 -5; -1 3 -7 7]

A= 1 2 3 5

-2 5 7 -9

5 7 2 -5

-1 3 -7 7

>> B=[21; 18; 25; 30]

B= 21

18

25

30

143
>> X=inv(A)*B

X= -1.5130

5.9108

0.3762

1.9126

>> check=A*X

check =

21.0000

18.0000

25.0000

30.0000

Result:-

144
Mesh plot

145
EX.NO.22: PLOT 2-D AND 3-D GRAPHS

DATE:

AIM:

2 2
To plot the function Z = 2−1.5√𝑥 +𝑦 sin(x) cos(0.5y) over the domain -4 ≤ x ≤ 4 and -4 ≤ y ≤ 4.

(a) Mesh plot

(b) Surface plot

(c) Mesh curtain plot

(d) Mesh and contour plot

(e) Surface and contour plot

(f) Surface plot with lighting

(g) Water fall plot

(h) 2-D contour plot

(i) 3-D contour plot

Solution :-

>> %(a) Mesh Plot

>> x=-4:0.25:4;

>> y=-4:0.25:4;

>> [x,y]=meshgrid(x,y);

>> z=2^(-1.5*sqrt(x^2+y^2))*cos(0.5*y)*sin(x);

>> mesh(x,y,z)

146
(b) Surface Plot

(c) Mesh curtain plot

>> %(b) Surface Plot

>> x=-4:0.25:4;
147
>> y=-4:0.25:4;

>> [x,y]=meshgrid(x,y);

>> z=2^(-1.5*sqrt(x^2+y^2))*cos(0.5*y)*sin(x);

>> surf(x,y,z)

>> %(c) Mesh curtain plot

>> x=-4:0.25:4;

>> y=-4:0.25:4;

>> [x,y]=meshgrid(x,y);

>> z=2^(-1.5*sqrt(x^2+y^2))*cos(0.5*y)*sin(x);

>> meshz(x,y,z)

(d) Mesh and contour plot

148
(e) Surface and contour plot

>> %(d) Mesh and contour plot

>> x=-4:0.25:4;

>> y=-4:0.25:4;

>> [x,y]=meshgrid(x,y);

>> z=2^(-1.5*sqrt(x^2+y^2))*cos(0.5*y)*sin(x);

>> meshc(x,y,z)

>> %(e) Surface and contour plot

>> x=-4:0.25:4;

>> y=-4:0.25:4;

>> [x,y]=meshgrid(x,y);

149
>> z=2^(-1.5*sqrt(x^2+y^2))*cos(0.5*y)*sin(x);

>> surfc(x,y,z)

(f) Surface plot with lighting

150
(g) Water fall plot

>> %(f) Surface plot with lighting

>> x=-4:0.25:4;

>> y=-4:0.25:4;

>> [x,y]=meshgrid(x,y);

>> z=2^(-1.5*sqrt(x^2+y^2))*cos(0.5*y)*sin(x);

>> surfl(x,y,z)

>> %(g) Water fall plot

>> x=-4:0.25:4;

151
>> y=-4:0.25:4;

>> [x,y]=meshgrid(x,y);

>> z=2^(-1.5*sqrt(x^2+y^2))*cos(0.5*y)*sin(x);

>> waterfall(x,y,z)

(h) 2-D Contour plot

152
(i) 3-D Contour plot

>> %(h) 2-D Contour plot

>> x=-4:0.25:4;

>> y=-4:0.25:4;

>> [x,y]=meshgrid(x,y);

>> z=2^(-1.5*sqrt(x^2+y^2))*cos(0.5*y)*sin(x);

>> contour(x,y,z,15)

153
>> %(i) 3-D Contour plot

>> x=-4:0.25:4;

>> y=-4:0.25:4;

>> [x,y]=meshgrid(x,y);

>> z=2^(-1.5*sqrt(x^2+y^2))*cos(0.5*y)*sin(x);

>> contour3(x,y,z,15)

Result:-

The following plots were drawn Mesh plot, Surface plot, Mesh curtain plot, Mesh and contour plot,
Surface and contour plot, Surface plot with lighting, Water fall plot, 2-D contour plot and 3-D contour
plot

154

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