ES421 Homework Assignment

Matlab: Displacement and Stress in a Cone

This web page provides guidance for the MENG 421 homework assignment to find the displacement and stress in a truncated cone.
Click for graphic of Cone.

Using Matlab, you will calculate the displacement and stress in a truncated cone that is constrained at one end and loaded at the other. This is the problem that was introduced in class. There are four parts:

1. Describe the problem on the cover sheet.
2. Solve the problem exactly using calculus (d5 = -5.269e-3 in).
3. Solve using one element (d = -4.68e-3 in)
4. Don't solve the cone using two elements, but report the results given in class
5. Solve with Matlab using four elements, but set up the matrix on your cover sheet
6. In a table, compare the error in displacement by using one, two, and four finite elements.

Data

1. Diameters: Left = 2 in, right = 1 in
2. Length: 12 in
3. Material: steel, E = 29e6 psi
5. Constraint: left end

Details

1. On the cover sheets, state the problem with Given and Find.
2. Use a linear shape function to find the diameter as a function of distance along the cone.
`     D = N1 D1 + N2 D2 `
3. Find the area as (pi/4)* diameter^2.
4. Find the exact displacement by calculus.
5. Find the displacement using one finite element.
6. Copy one of your previous axial programs and name it cone4.m
7. Change cone4.m to give the four-element solution.
8. Using this shape function, define in Matlab, the diameter, dia, as a function of position, pos, along the cone. Then use the diameter as usual to calculate the area. Then define an array k on a single line. For example:
```    len = 3 * ones(1,4)         % element length
pos = (1:4)*3 - 1.5         % position of each element center
dia = 2 - pos / 12;         % diameter
area = (pi * dia .^2)/4
ex = 29e6                   % elastic modulus
k = area * ex ./ len        % make k a vector```
k is now a vector with the appropriate value for each of the four elements.
9. Try each of the above Matlab expressions by typing them into Matlab in interactive mode. Before you use them in your program, be sure you understand what each does.
10. Now, for the stiffness matrix, define the diagonal elements with the k vector.
```    k11 = k(1)
k22 = k(1)+k(2)```
However, use the k vector itself off the diagonal.
```    stiff = [ k11  -k(1)   0     0      0 % stiffness matrix
-k(1)  k22  -k(2)   0      0```
11. On the cover sheet compare the displacements (giving percent error) for the one-element, two-element, and four-element models to the exact solution.

MENG 421 | Lectures | Class assignments | Ansys | Files: Ansys, Matlab