16.5k views
0 votes
For the two-support beam shown below, you need to calculate and plot the beam's deflection under the given loads Deflection is the movement of the beam downward due to external forces applied. This deflection is solved in terms of a discontinuous piecewise function, also known as a singularity function. Another engineer has already derived the equations you need below. 1200 ib 60 lb/in For some given number a, a point where forces change on a beam, the singularity function is defined as: 0, The below deflection equation, v(x), was derived using the free-body-diagram above and contains two singularity functions. (x)3.19x 10 5( 800x3-13.7 × 106x-2.5x4 + 2.5(x-120)" + 600(x-240)3 TASK 2: (17-25 min) Write a user defined function named MA3 Deflection _courgarnetlD.m which has one input (position x) and one output, (deflection v) You will need to apply the equation above with the discontinuity conditions described. Use this function to determine the deflection at the position entered. Produce a formatted output to the command window that states the deflection at the point entered.

User Fakeleft
by
4.3k points

1 Answer

2 votes

Answer:

Task 1 Code :

x = input("Please enter a position between 0 and 360 inches:");

if ( x<0 )

disp("The value entered is negative, taking absolute value");

x = -1*x;

end

if(x>360)

disp("The value entered is more than 360 inches");

exit; //complete closedown

end

Task 2 Code

The function is MA3_Deflection_CourgarnetID , you have to pass an input value x and the output will be in v.

function [ v ] = MA3_Deflection_CourgarnetID( x )

if(x>120); a = (x-120); else; a = 0; end

if(x>240); b = (x-240); else; b = 0; end

v = (1/(3.9e9))*(800*x^3-(13.7e06)*x - 2.5*x^4 + 2.5*(a)^4 + 600*b^3);

end

Task 3 Code

This the complete code with the user prompt.

x = input("Please enter a position between 0 and 360 inches:");

if ( x<0 )

disp("The value entered is negative, taking absolute value");

x = -1*x;

end

if(x>360)

disp("The value entered is more than 360 inches");

exit;

end

X = 0:0.1:x

Y = 0;

for i=1:length(X)

Y(i) = MA3_Deflection_CourgarnetID(X(i));

end

plot(X,Y);

grid on;

xlabel('Position on beam [inches]');

ylabel('Deflection of beam [inches]');

User Paquita
by
4.4k points