Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

An Engineer has requested you write a program to calculate the deflection at cen

ID: 3601688 • Letter: A

Question

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 acb replace a with b and 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 in). 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 - Deflectio at Center Pb(48E-4n . Ask the user for the following inputs (must be non-negative a. Length of the beam in inches b. Load in pounds c. Modulus of elasticity in psi. d. The number of points to have deflection computed for, including the two ends (must be 2 and an integer). This vector is 'a 2. 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) 3. 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 funetion 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 returms the following arguments OUT max Def is a vector of the maximum deflections of the beam

Explanation / Answer

#include<iostream.h>
#include<conio.h>
void deflection(int L,int P,int E,int I); //declaration of funtion
void main() //main function
{
clrscr();
int L,P,E,I; //taking inputs
cout<<" enter the length of the beam:";
cin>>L;
cout<<" enter the load:";
cin>>P;
cout<<" enter the modulus of elasticity:";
cin>>E;
cout<<" enter the moment of inertia:";
cin>>I;
deflection(L,P,E,I); //funtion call
getch();
}


void deflection(int L,int P,int E,int I); //defination of function
{
int a,b,t,max_def,def_at_load,def_at_center;
cout<<" enter the value of a:";
cin>>a;
b=L-a;
cout<<" the value of b:"<<b;
if(a>=b)
{
cout<<" we use the formula:";
}
else
{
t=a;
a=b;
b=t;
}
max_def = (-P*b(L*L-b*b)^3/2)/(9*3^1/2*I*L);
cout<<" Max Deflection:"<<max_def;
def_at_load = (-P*a*a*b*b)/(3*E*I*L);
cout<<" deflection at load :"<<def_at_load;
def_at_center = (-P*b(3*L*L-4*b*b))/(4*8*E*L);
cout<<" deflection at center:"<<def_at_center;
}