… exercise a degree of skepticism with regard to the application of formulas for there is uncertainty as to the limitations of use or the areas of applicability.

A.C. Ugural + S.K. Fenster in Advanced Strength and Applied Elasticity

Forewarning. This post (as all others on this page) serve as a journal for my studies. As such, if you’ve (somehow) ended up here looking to glean some gem to push you over the pass-mark for your Mechnical Engineering 101 unit, I’m afraid that what follows is more likely to hinder rather than help. If, however, you’re interested in old books, old computer languages and using them to solve problems in a rather round-about manner, then please, read on…

A while back the library at my university was giving away a selection of “old” and “outdated” textbooks. Hidden in the mix, i claimed a copy of `Advanced Strength and Applied Elasticity by A.C. Ugural + S.K. Fenster`

. This copy was published in 1981 and differentiates itself from its older brother by noting that it is `The SI Version`

. The cover is worn, held together now by a length of black tape, the hard-cover spine altogether absent. The pages are yellowed and graffiti-ed with the occasional notes, asterisks for important sections and comments where personal experience has deviated from the text…

I started working this week through chapter one, `Analysis of Stress`

. Below I go through solving some of the problems in Maxima (an old tool for an old book). If you’d like to follow the `Maxima`

workbook, check it out here!

## Mohr’s Circle for Two-Dimensional Stress

The goal here is to develop a Maxima script which generates Mohr’s circle for a two dimensional stress tensor. The script is not perfectly general, but can be easily adapted for a different stress tensor with little effort. The resultant diagram can be printed to scale and used as a solution for that particular system. Alternatively, additional lines can be plotted interactively with maxima (I’ve given an example of how to plot additional information).

### Principal Stress

A function to calculate the principal stresses, σ1 and σ2, given the stresses acting in the x and y directions, and the shear stress

```
principal_stress(x, y, t) :=[ (x + y) / 2 + (sqrt(((x - y)/2)^2+t^2)), (x + y) / 2 - (sqrt(((x - y)/2)^2+t^2)) ];
principal_stress_angle(x, y, t) := [atan(t/(x - (x+y)/2))/2, (atan(t/(x - (x+y)/2))+%pi)/2];
σ : principal_stress(14,4,10), numer;
(%o38) [20.18033988749895,-2.180339887498949]
σ[1];
20.18033988749895
θ: principal_stress_angle(14, 4, 10), numer;
(%o41) [0.5535743588970452,2.124370685691942]
todeg(θ[1]), numer;
31.717474411461
```

Great, we’ve calculated the magnitude and angle of the principal stresses. Note that the first and second elements of the arrays returned from these two functions is not guaranteed to be σ1 and σ2 (likewise θ1 and θ2) respectively, they may require sorting.

I’ve used `numer`

liberally throughout this post. `numer`

displays the result <i>numerically</i>, this helps to give the user a sense of the result, being much easier to interpret than the exact form that maxima would otherwise report.

The function `todeg`

is defined below to convert radians to degrees (remember, `maxima`

uses radians by default).

```
(%i1) torad(θ) := θ*%pi/180;
(%o1) torad(θ):=(θ*%pi)/180
(%i2) todeg(θ) := θ*180/%pi;
(%o2) todeg(θ):=(θ*180)/%pi
```

### Maximum Shear Stress

The maximum shear stress can be calculated with the following

`max_shear(x, y, t) := [sqrt(((x - y)/2)^2 + t^2), - sqrt(((x - y)/2)^2 + t^2)];`

The angle of the plane of maximum shear stress occurs when the body is rotated 45degrees from the principal roatation (that is, the rotation of principal stress). Thus, a simple formula to calculate the angle of maximum shear stress would look like:

```
max_shear_angle(x, y, t) := principal_stress_angle(x,y, t) + %pi/4;
θp : principal_stress_angle(14,4,10);
todeg(θp), numer;
[31.717474411461,121.717474411461]
θτ = max_shear_angle(x, y, t);
todeg(θτ), numer;
[76.71747441146101,166.717474411461]
```

45 degrees apart, as expected.

### Drawing the Circle

The book uses far more exact language than I’ll use (or even attempt). Call this a colloquial interpretation, a distilled form to facilitate speedy re-familiarization for the pre-initiated.

- Using a 2D cartesian plane, let y be the shear stress, τ, and x be the normal stress, σ.
- Plot the circle center, C, on the σ-axes at position (σx+σy)/2
- Plot the point A at the σx and τxy coordinates you’ve got.
- The distance from C to A is your circle radius. Draw the circle.

Cool. Lets have a crack with the following problem:

Plot Mohrs circle for the stresses: σ_x = 80MPa, σ_y =

40MPa, τ_xy = 30MPa

I use the variables x and y here to refer to the plot axes, remember that they refer to the normal and shear stresses respectively. I’ve also disobeyed the previous instructions, rather than using the given points to draw the circle, its (somewhat) easier to just go ahead and use our previously defined functions to find our principal stresses and use these to form the plot.

```
load(draw);
σ : principal_stress(80,40,30);
principal_stress_angle(x, y, t) := [atan(t/(x - (x+y)/2))/2, (atan(t/(x - (x+y)/2))+%pi)/2];
/* circle center */
c: (σ[1] + σ[2])/2;
/* radius */
r : (σ[1] - σ[2])/2;
/* equation for the circle */
circle: (x - c)^2 + y^2-r^2;
/* make the plot */
wxdraw2d(
color = black,
points_joined = true,
points([[0,0], [120,0]]),
/* the circle */
color = blue,
implicit(circle, x, 0, 120, y, -50, 50),
label_alignment = left,
label(["C", c + 1, 3]),
/* given stress */
color = red,
line_type = dashes,
points([[80,-30], [40,30]]),
label_alignment = left,
label(["A(80, -30)", 82, -32]),
label_alignment = right,
label(["B(40, 30)", 38, 32]),
/* principal stress angle */
color = black,
line_type = dashes,
points_joined = true,
points([[80, -30], [80, 0]]),
label_alignment = left,
label(["F", 80, 3]),
implicit(y^2 + (x - c) ^2 - (10)^2, x, 66, 80, y, -20, 0),
label_alignment = left,
label(["2θ_p", 70, -7]),
/* Maximum shear stress */
color = black,
line_type = dashes,
points_joined = true,
points([[c, r], [c, -r]]),
label_alignment = left,
label(["D", c+1, r+3]),
label_alignment = right,
label(["E", c-1, -r-3]),
/* other */
title = "Mohrs Circle",
xlabel = "σ (MPa)",
ylabel = "τ (MPa)",
proportional_axes = xy
);
```

We used some new techniques here. Rather than relying on `plot2d`

we’ve used the function `draw2d`

which makes it a bit easier to chain together a number of draw commands. In addition, it gives us access to the `implicit`

function to draw the circle itself. In the first call to `implicit`

we pass in our circle function, previously defined as `circle: (x - c)^2 + y^2-r^2;`

, followed by the bounds for `x`

and `y`

.

Notice how `draw2d `

allows us to change certain graph attributes, such as `color`

, several times throughout the function call. Using this technique, we can create some fairly sophisticated plots.

Let’s add in the values for the principal stresses at their position on the plot. This is simply done by adding the following the `draw2d`

function call.

```
/* Principal stresses */
color =red,
points_joined = false,
point_type = filled_circle,
points([[σ[1], 0],[σ[2], 0]]),
label_alignment = left,
label(["σ1(96.1)", σ[1], 4]),
label_alignment = right,
label(["σ2(23.9)", σ[2], 4]),
/* reset the point type */
point_type = plus,
```

Nice one.

There is a lot more we could. The script is not very general, particularly the plotting. In fact, the level of detail in the plot is probably overkill. However, we’ve done well to quickly bang out a Mohr’s Circle diagram. This may be useful if you find yourself with a need to calculate the stress on a two dimensional body which has been rotated from the orientation from which you last measured the stresses acting on it. Particularly useful if you discover that you’ve left your graphing paper, protractor and favorite pencil at home.