Hi,(adsbygoogle = window.adsbygoogle || []).push({});

I am in Mechanics of materials class, and I am attempting to design a cantilever beam that meets certain specifications for atomic Force microscopy. (details aren't relevant for programming steps).

I have been tasked with writing a script in matlab that:

A.) Calculates the coordinates of the centroid of any Cross section.

B.) Calculates the second moment of area (I) about the centroidal Z-axis (assume this axis is horizontal)

C.) Calculates the Q that is needed to compute the maximum shear stress.

For the above tasks, assume the resolution of the image is 1 nm/pixel.

I have already created the m-file for 1 of the images that I will be using . (it is a ring cross-section). It is attached.

I have also finished Part (A), and I think it works.

The centroid is basically the center of mass of a 2-d object.

Part B is really giving me trouble, I can't seem to make any headway towards getting the correct solution.

The equation for calculating the second moment of Area is: I=Integral(Y^2*dA) (A=area).

If someone with more programming knowledge/experience than me can help, that would be lifesaving!

The attached m files that I have finished are attached.

-Ryan

View attachment centroid2.m

View attachment ring.m

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab- Second moment of Area(I) Script Help!

Loading...

Similar Threads - Matlab Second moment | Date |
---|---|

Python How can I run Python by getting values from Matlab | Mar 7, 2018 |

What is each step of this Matlab program doing? | Feb 21, 2018 |

C/++/# Help with MATLAB code? | Feb 9, 2018 |

Numerical Integration with variable limits MATLAB | Jan 15, 2018 |

Numerical second order pde solver | Sep 1, 2014 |

**Physics Forums - The Fusion of Science and Community**