Question: Topics: User Defined Functions and MATLAB Conditionals An Engineer has requested you write a program to calculate the deflection at center, deflection at load and
Topics: User Defined Functions and MATLAB Conditionals An Engineer has requested you write a program to calculate the deflection at center, deflection at load and the maximum deflection of a level beam with a load at a specified number of equidistant points along the beam that is supported by a point at each end. The following formulas are applied where a>=b, for those points where a b with a. Where P is the load in pounds, L is length of the beam in inches, E is the modulus of elasticity (psi), I is the moment of inertia (in4). The a symbol in inches along the beam from the left side for the equidistant point for which you are calculating the deflections. The b symbol is b = L-a. MaxDeflection= -PbL2- b2 3/293 EIL Deflection_at_Load = -Pa2b23EIL Deflection at Center= -Pb(3L2-4b2)48EI P L b a Ask the user for the following inputs (must be non-negative).: Length of the beam in inches. Load in pounds. Modulus of elasticity in psi. The number of points to have deflection computed for, including the two ends (must be >=2 and an integer). This vector is a. You program must then call the function deflection to compute the deflection at center, deflection at load and the maximum deflection deflections for each of equidistant points (A vector). You must the generate a report with 4 labeled columns, Position, Maximum Deflection, Deflection at load, and Deflection at center as shown in the sample run Finish the following MATLAB function and write a MATLAB Script that (uses that function) to satisfy the above description. function [ max_Def, def_at_Load, def_at_Center ] = deflection( A, P, I, L, E ) %{ This function gets the following arguments IN A is a vector of the equidistance points for the deflection to be calculated along the beam. P is a scalar representing the load in pounds I is a scalar representing the moment of inertia L is a scalar representing the length in inches E is a scalar representing the modulus of elasticity The function returns the following arguments OUT max_Def is a vector of the maximum deflections of the beam def_at_Load is a vector of deflection of the beam at the point of the load def_at_Center is a vector of deflection of the beam at its center %} Outline: Create a MATLAB Function .m file named deflection.m Copy the skeleton function given Finish the function by assigning all of the output variables correctly Create a MATLAB Script .m file named Program05.m Write the necessary MATLAB commands to prompt for and read into variables all the variables needed Call your deflection.m function to compute the deflections Format and display to the screen, the output report for the position, max_deflection, deflection_at Load and deflection_at_Center as shown in the sample run Notes(s): Sample Run(s): Upload BOTH your Function file ( deflection.m ) and Script file ( Program05.m ) to D2L's ( Program 05 ) Dropbox >> Program05 Beam Defection Program User Input ------------------------------ Enter the length of the beam in inches: 360 Enter the weight of the load in pounds: 24000 Enter the modulus of elasticity in psi: 30e06 Enter the moment of inertia: 795.5 Enter the number of points (including the ends you want along the beam): 11 Position Maximum Deflection Deflection (inches) deflection at load at center ------------------------------------------------------------------------------------ 0.0 -0.0000 -0.0000 -0.0000 36.0 -0.2965 -0.1267 -0.2893 72.0 -0.5662 -0.4004 -0.5552 108.0 -0.7839 -0.6897 -0.7742 144.0 -0.9269 -0.9009 -0.9228 180.0 -0.9775 -0.9775 -0.9775 216.0 -0.9269 -0.9009 -0.9228 252.0 -0.7839 -0.6897 -0.7742 288.0 -0.5662 -0.4004 -0.5552 324.0 -0.2965 -0.1267 -0.2893 360.0 -0.0000 -0.0000 -0.0000 >>
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
