Displacement of cantilevered beam matlab

Click For Summary

Discussion Overview

The discussion revolves around creating a Matlab function to plot the displacement of a cantilevered beam under a point load. It includes aspects of coding, mathematical modeling, and troubleshooting related to the function's output and the underlying physics of beam deflection.

Discussion Character

  • Homework-related
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant presents a Matlab function intended to calculate and plot the displacement of a cantilevered beam, including formulas for displacement and angle at the tip.
  • Another participant points out a potential issue with the value of Young's modulus, suggesting that E = 30 Mpsi should be converted to psi for accurate calculations.
  • A participant seeks further assistance after entering the function parameters but still does not receive a plot, indicating confusion about the output.
  • A later reply indicates that the original poster resolved their issue without detailing the solution.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the specific reasons for the initial lack of output in the plot, but there is acknowledgment of the importance of correctly interpreting the units for Young's modulus.

Contextual Notes

The discussion highlights potential limitations in the original code, such as the handling of the plotting function and the need for correct unit conversions, but these remain unresolved.

Who May Find This Useful

Students and practitioners interested in structural analysis, Matlab programming, and beam mechanics may find this discussion relevant.

DODGEVIPER13
Messages
668
Reaction score
0

Homework Statement


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
theta=0.5*((Wa^2)/EI)

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.

Homework Equations





The Attempt at a Solution


function[ymax,theta]=displacement(E,I,L,a,W)


for x=linspace(0,a);
y=-(W*x.^2*(3*a-x))/(6*E*I);
end
for x=linspace(a,L);
y=-(W*a.^2*(3*x-a))/(6*E*I);
end

theta=0.5*((W*a.^2)/(E*I));
plot(y,x);
xlabel('Pos');
ylabel('disp');
title(sprintf('ymax=%g, theta=%5.3f',ymax,theta));

This is what I get:

ans =

8.2822e+003

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

Attachments

  • Capture.PNG
    Capture.PNG
    14 KB · Views: 907
Physics news on Phys.org
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.
 
>> 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?
 
hey appreciate the help man I got it figure out
 

Similar threads

Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
16K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
2
Views
2K
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K