# Calculate *σ*_{x} for *r*_{i} = 1 cm

_{x}

_{i}

Remember elementary statics? It gives the bending stress at point *O* as

Using my calculator, I get *σ** _{x}*=-101.7 MPa. We'll check the MATLAB result against this value.

## Calculate *σ*_{x} at point *O*

_{x}

In your program, leave a blank line and start a new section for calculating *σ** _{x}* at point

*O*with an explanatory comment line. Then, create the parameters

*M*,

*ro*, and

*ri*since these are needed to calculate σ

_{x}.

Following this is the statement to calculate *I*, the moment of inertia:

Things to note: the parameter pi is predefined and contains a very accurate value of π. The operator ^ is used to raise a quantity to a desired power. Now we can calculate *σ** _{x}* at

*O:*

The factor 10^-6^ above converts the result into MPa. The semi-colon at the end of the line is left off so that we can see what the resulting value of ** sigma_x** is. Click on the

*Run*icon in the editor (or hit the

*F5*key) . What is the value of sigma_x reported by your program? I get

This is close enough to my paper-and-pencil result of -101.7 MPa above. See my entire program here (right click and select save target as, or just left-click and copy-paste in the editor).