1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Displacement of cantilevered beam matlab

  1. Feb 14, 2014 #1
    1. The problem statement, all variables and given/known data
    Write a Matlab function to plot the displacement of a cantilevered beam under a point load. Annotate the figure’s axes and title the figure. In addition to creating the plot, the function should report (in the figure’s title!) the maximum deflection and angle between the horizontal and the surface of the beam at its tip. The geometry of the beam is shown below:
    The formulas for the displacement y and tip angle θ are
    y=-((Wx^2)/6EI)(3a-x) for 0<X<a
    y=-((Wa^2)/6EI)(3x-a) for a<x<L

    where W is the point load, E is the Young’s modulus for the beam, I is the moment of inertia for the beam, and L is the length of the beam. Test your function with E = 30 Mpsi, I = 0.163 in4, L = 10 in, a = 3 in, W = 1,000 lbf. Report both your code and the plot for the given values.

    2. Relevant equations

    3. The attempt at a solution

    for x=linspace(0,a);
    for x=linspace(a,L);

    title(sprintf('ymax=%g, theta=%5.3f',ymax,theta));

    This is what I get:

    ans =


    The plot shows nothing so I am confused, what should I do?

    Attached Files:

  2. jcsd
  3. Feb 14, 2014 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    For one thing, E = 30 Mpsi = 30 * 10^6 psi, or 30,000,000 psi. This accounts for the discrepancy in the deflection calculation. It doesn't explain why to slope wasn't output.
  4. Feb 15, 2014 #3
    >> displacement(30*10.^6,0.163,10,3,1000) ok this is what I entered and I still didn't get a plot any more hints?
  5. Feb 15, 2014 #4
    hey appreciate the help man I got it figure out
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted