We’re required to use MatLab with this.

I know how to solve this on paper, but it’s the coding (matlab) part I can’t do.?

I’ve attached files.

MSE 206 Computational Report 7
Today we will use a two-dimensional ?nite element code to calculate thermal stresses and to
identify stress concentration points (see Ch. 9.7 in Hibbeler for more information) within two
compression test specimen geometries. Your lab technician has come up with a great idea to improve alignment during compression testing of ?dog-bone&quot; shaped specimens?using slots in
the sample instead of traditional clamps or pins to secure the specimens. However, before you
conduct any expensive, time-consuming tests, you want to make sure that the new con?guration won?t impact the failure behavior of the material. You know that your compression rig
tends to introduce a small thermal gradient across a sample and you need to calculate the thermal stresses of the new specimen geometry and decide which is best based on the two slots the
lab technician has designed. Your specimen (in blue) is aluminum, which has a high coef?cient
of thermal expansion. The specimens are ?xed into the test rig using steel pins (in orange)?
steel has a low coef?cient of thermal expansion.
Following the instructions below, calculate the thermal stresses for a very small temperature
gradient, ?T=0.1, to identify an possible stress concentration sites. Determine and report the
maximum thermal stress and whether it is isolated to the gage section of the specimen for both
geometries. For such a small thermal gradient, does the geometry of the slot and steel pin matter? Does this change if ?T increases? By how much? If you?re not sure about the exact magnitude of the potential thermal gradient in your testing rig, which specimen geometry would be
less prone to stress concentrations outside of the gage section?
Old dog-bone compression design with pins:

New possible dog-bone compression designs (using slots with pins):

&quot;

&quot;1 of &quot;3

Finite Element Method
Finite Element Analysis (FEA) is a powerful tool for solving partial differential equations with
boundary conditions. The idea behind FEA is similar to a Riemann sum approach to integration,
where the problem is broken up into smaller pieces that are easier to solve, and can be approximated numerically.

&quot;
http://mathinsight.org/calculating_area_under_curve_riemann_sums

Implementation
For this problem you will be using an online simulation website: nanohub.org. Log in using
your account information. Hover over the Resources tab and then choose the Tools option.
We will be using the OOF2 (Object-Oriented Finite Element) tool. To ?nd it, select [All] in the
Tag column and scroll through options in the Resources column. Once you select OOF2,
there will appear a Launch Tool button in the third column; click on that.
You should see three windows in your viewer: Import/Export, OOF2, and OOF2 Messages.

&quot;
&quot;2 of &quot;3

The basic steps of OOF2:
1. Choose a structure to analyze; structures are imported as ?gures.
2. De?ne properties of all materials in structure.
3. Assign materials to sets of pixels (by color).
4. Break the structure in to smaller homogeneous pieces (create skeleton).
5. Create a mesh, which assigns materials to the different pieces.
6. Choose ?elds (such as temperature, displacement) and equations to solve (heat equation,
static equilibrium or ?force balance?).
7. Set boundary conditions.
8. Solve.
9. Analyze solution.
For this assignment, some of the steps have been completed for you; in future classes you?ll
learn how to do the other steps with OOF2. We will focus on the ?nal four steps, choosing ?elds
and equations, setting boundary conditions, solving and analyzing the solution. Below are the
steps to run a single calculation.
1. Load the image ?le and python script by ?rst clicking the Upload button in the Import/
Export window and selecting the appropriate ?les. In the main OOF2 window go to
File &gt; Load &gt; Script? and select the python ?le you just uploaded. The script may
take a little time to load.
2. Go to the Fields &amp; Equations tab. In the Fields section next to Temperature
check the boxes in front of defined, active, and in-plane. Do the same for Displacement. In the Equations section check the boxes in next to Heat Equation (for
the temperature) and Force Balance (for the displacements/strains).
3. Go to the Boundary Conditions tab. We are going to create two boundary conditions.
a. Start by clicking New. Making sure the field is set to Temperature and profile
is set to Constant Profile, set the number next to value to 300.0 and the
boundary to left. Click Apply.
b. To make the second boundary condition, enter a value of 300.1 and set boundary
to right and click Ok. (Note: you should have exactly TWO boundary conditions. If
you accidentally created more, you must delete the duplicates.)
4. Again in the main OOF2 window, click on the dropdown menu select Solver tab. In the
Solvers section, double click on default and then, change max_iterations to
10000 and click Ok. In the lower right corner click Solve.
5. Go to the OOF2 Graphics window. In the menu bar, select on Layer &gt; New. In the
Displayed Object section, set category to Mesh. In the Display Methods section, click New. In the top drop-down menu, select Filled Contour. In the second
drop-down menu select Flux. Check to make sure Stress and xx are selected below. In
the drop-down menu next to Where, select original. Then click Ok.
6. Save a screen shot of the stress distribution and be sure to include the color scale. Report
the maximum thermal stress as indicated by the color scale in your written report.

&quot;3 of &quot;3