In engineering, deflection is the degree to which a structural element is displa
ID: 3861832 • Letter: I
Question
In engineering, deflection is the degree to which a structural element is displaced under a load stress. For a beam that is supported at both ends and expresses to a uniform load stress, we can define the following: The stress at any point on the beam: S = - W/2 z I x (l - x) Defection at any given point "x" Maximum defection at the center y = 5/384 Wt^3/El Where E: Modulus of Elasticity (N/mm^2) Moment of inertia (mm^4) Load stress (N) Distance from the end of the beam (mm) length of the beam (mm) Distance to neutral axis plain (mm), i.e: distance from the surface of the beam to the axis doesn't experience any change in length note on measurement units Write a C + + program that reads from the keyboard, the engineering design parameters of a beam and then calculates and displays the values of the defection calculation of the beam Please enter your design parameters E: Modulus of Elasticity (N/mm^2) Moment of inertia (mm^4): 926.0 Load (N)! 1200.0 Distance from the end (mm):60.0 length of the beam (mm): 120.0 Distance to neutral axis plain (mm): 9.0 The stress at any point on the beam: - 2000.0 N/mm^2 Defection at 60.0 mm 9.719c.004 mm Maximum defection at the center: 9.719c 004 mm Press any key to continueExplanation / Answer
I can't write any simpler than this :P
#include<iostream>
using namespace::std;
int main() {
double E,I,W,x,l,Z,S,yx,yc;
cout<<" Beam Defection Calculator"<<endl;
cout<<" ***************************"<<endl;
cout<<"Please enter your design parameters:"<<endl;
cout<<"E: Modulus of elasticity (N/m^2): ";
cin>>E;
cout<<"I: Mooment of Inertia (nm^4): ";
cin>>I;
cout<<"W: Load (N): ";
cin>>W;
cout<<"x: Distance from the end (mm): ";
cin>>x;
cout<<"l: length of the beam (mm): ";
cin>>l;
cout<<"Z: Distance from neutral axis/plain (mm): ";
cin>>Z;
S = -(W/(2*Z*l))*x*(l-x);
yx = W*x*(l-x)*(l*l+x*(l-x))/(24*E*I*l);
yc = 5*W*l*l*l/(384*E*I);
cout<<"The stress at any point on the beam: "<< S <<" N/m^2"<<endl;
cout<<"Defection at "<< x << " mm: "<< yx <<" mm"<<endl;
cout<<"Maximum defection at the center: "<<yc<<" mm"<<endl;
cout<<"Please press any key to continue...";
getc();
}