Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel

Author: Rajesh Bhaskaran, Cornell University

Problem Specification
Step 1: Find Reactions RA, RB
Step 2: Calculate σx for ri = 1 cm
Step 3: Plot σx vs. ri
Step 4: Plot σx vs. ri: Take 2
Step 5: Plot σx vs. ri, Take 3: File Input/Output
Step 6: Plot σx vs. ri, Take 4: Functions

Step 6: Plot sigma_x vs. ri, Take 4: Functions

...

Let's create a function to calculate bending_stress that outputs σx given (M, ri, ro )

...


 
Call function bending_stress
Run and check output

Before we part, let's remind ourselves of some important programming guidelines that we have followed in this tour:

  • Develop code incrementally, testing obsessively at each stage. Develop a plan for how you are going to build your code before you sit at the computer.
  • Dig through the MATLAB help diligently to figure out how to use specific functions etc. Usually, the examples are the best place to start. This is a better strategy than desperately hunting for the TA every time you need help with your code.
  • Comment your program liberally.