Help with this problem...

the following problem should be completed by creating: function m-file with 4 input parameters and 2 output parameters script m-file using the testing parameters to call the function. Assuming that SI units are used in the formula, you need to perform unit conversions for the testing parameters in the English units
PROBLEM***write a function to plot the displacement of a cantileverd beam under a uniform load. in addition to creating the plot, the function should return the maximum deflection and angle between the horizontal and the surface of the beam at its tip. the formulas for the displacement y and tip angle theta are
y= -(w(x^2)/(24EI))(6(L^2)-4Lx+(x^2)) and theta = (1/6)((W(L^3))/(EI))
where w is the load per unit lenght, E is youngs modulus for the beam, I is the moment of inertia of the beam and L is the lenght of the beam. Test your function with E= 30, I=0.163 L=10, w=100

12 Commenti

Sean de Wolski
Sean de Wolski il 9 Giu 2011
What have YOU done to solve YOUR homework problem?
ken  masters
ken masters il 9 Giu 2011
function [y,angle]= lab2fun(w,E,I,L)
x=0:L
y=-((w*x^2)/(24*E*I))*((6*L^2)-4*L*x+x^2;
angle=(1/6)*(w*L^3)/E*I;
ken  masters
ken masters il 9 Giu 2011
SO far I am lost
Sean de Wolski
Sean de Wolski il 9 Giu 2011
Okay, good, what issue are you having with it?
You'll have to use .* and .^ because you want an element by element solution.
Sean de Wolski
Sean de Wolski il 9 Giu 2011
and ./
ken  masters
ken masters il 9 Giu 2011
hos does this look
function [y,angle]= lab2fun(w,E,I,L)
x=linspace(0,L,11);
y=-((w*x^2)/(24*E*I))*((6*L^2)-4*L*x+x^2;
y2=max(abs(y));
if y2~=(abs(y));
end
theta=((w*L^3)/(E*I*6));
plot(x,y);
****any mistakes???
Sean de Wolski
Sean de Wolski il 9 Giu 2011
I don't know does it? Does it plot a deforming beam?
Okay I do know (it's going to error out because you're doing a matrix exponentiation, not an elementwise one, as I hinted at in my last two comments)
ken  masters
ken masters il 9 Giu 2011
it gives me
??? Undefined function or variable 'w'.
Sean de Wolski
Sean de Wolski il 9 Giu 2011
well how'd you call it?
from the command line:
[y ang] = lab2fun(100,30,0.163,10)
ken  masters
ken masters il 9 Giu 2011
function [y,theta]= lab2fun(w,E,I,L)
x=linspace(0,L,11);
y=-((w.*x.^2)/(24*E*I)).*((6*L^2).*(-4.*L.*x+x.^2));
y2=max(abs(y));
if y2~=(abs(y));
end
theta=((w.*L^3)/(E.*I.*6));
plot(x,y);
result a graph with the following
y =
1.0e+007 *
Columns 1 through 8
0 0.0020 0.0155 0.0511 0.1178 0.2237 0.3755 0.5787
Columns 9 through 11
0.8376 1.1554 1.5337
theta =
3.4083e+003
Sean de Wolski
Sean de Wolski il 9 Giu 2011
Looks like the numbers are getting bigger - a characteristic of a cantilever beam undergoing loading.
Matt Fig
Matt Fig il 9 Giu 2011
http://www.mathworks.com/matlabcentral/answers/8626-how-do-i-get-help-on-homework-questions-on-matlab-answers

Accedi per commentare.

Risposte (3)

Bjorn Gustavsson
Bjorn Gustavsson il 9 Giu 2011

0 voti

You should learn now sooner than later to comment your code! Write between each line what it is supposed to do. If you reach a comment-to-code ratio of something like 2/1 it is no bad thing. This is actually the first thing you should learn. If you make clear and accurate descriptions of what it should do, you will make less mistakes, find mistakes earlier and generaly becomme a better person.
Danish Saleem
Danish Saleem il 30 Nov 2021

0 voti

a cantilever beam is a beam that is clamped at one end and is free at the other end. The deflection y at point x of a beam loaded with a uniformly distributed load w is given by the eaquation y=(-w/24EI)(x^4-4Lx^3+6L^2X^2) where E is the elastic modulus I is the moment if inertia and L is the length of a beam. For beam L=6M, E=70*10^9 Pa I=9.19*10^-6 m^4 and w=800N/m. Make a plot of the deflection of the beam y as a function of x.
Danish Saleem
Danish Saleem il 30 Nov 2021

0 voti

a cantilever beam is a beam that is clamped at one end and is free at the other end. The deflection y at point x of a beam loaded with a uniformly distributed load w is given by the eaquation y=(-w/24EI)(x^4-4Lx^3+6L^2X^2) where E is the elastic modulus I is the moment if inertia and L is the length of a beam. For beam L=6M, E=70*10^9 Pa I=9.19*10^-6 m^4 and w=800N/m. Make a plot of the deflection of the beam y as a function of x.

Richiesto:

il 9 Giu 2011

Risposto:

il 30 Nov 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by