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

Given: Beam material, dimensions, and the magnitude of the load will be provided

ID: 3548792 • Letter: G

Question

Given: Beam material, dimensions, and the magnitude of the load will be provided by the user. The user will also specify the number of data points to return.


write a program to calculate the deflection along the beam and return a table to the user with the number of data points requested (you will need to determine how to calculate the implementation).

In addition, you must output the maximum deflection and maximum stress in the beam.


If the loading causes the structure to yield (Smax>Sy), a message must be sent to the user indicating plastic deformation of the structure.


Use these formulas to calculate the deflection at points along the beam:

Wmax=W(L/2)=-PL^3/48EI

W(x)=-Px(3L^2-4x^2)/48EI ..... 0 Lessthan equal to x less than or equal to (L/2)

W(x)=P(L-x)(L^2-8x L+4x^2)/48EI...... L/2 lesstan or equal to x less than or equal to L.

smax = PLy/(48EI)

Where P = applied load (N)

X = distance from left beam support (m)

L = length of beam (m)

E = Modulus of Elasticity (Pa)

I = Area Moment of Inertia (m^4)

b = base  of rectangular cross section (m)

h = height of rectangular cross section (m)

y = h/2


Material

E (GPa)

Sy (Yield Strength)(MPa)

Aluminium

69

95

Stainless Steel

200

250

Titanium Alloy

105-120

730

Iron

211

80 - 100

Copper

117

70

Silicon Carbide

450

3440

  

Material

     

E (GPa)

     

Sy (Yield Strength)(MPa)

     

Aluminium

     

69

     

95

     

Stainless Steel

     

200

     

250

     

Titanium Alloy

     

105-120

     

730

     

Iron

     

211

     

80 - 100

     

Copper

     

117

     

70

     

Silicon Carbide

     

450

     

3440

  

Explanation / Answer

#include <iostream>

#include <string.h>

#include <math.h>

using namespace std;


int main()

{

string Material[] = {"Aluminium","Stainless Steel","Titanium Alloy","Iron","Copper", "Silicon Carbide"};

int E[] = {69, 200, 120, 211, 117, 450};

int Sy[] = {95, 250, 730, 100, 70, 3440};


int MaterialType;

int ModulusofElasticity;

int SyofMaterial;

int Length, base, height;

double AreaMomentofInertia;

int NoofDataPoints;

int P;


cout<<"Choose the material from the list and enter the number between 0-5"<<endl;

cout<<" 0. Aluminium 1. Stainless Steel 2. Titanium Alloy 3. Iron 4. Copper 5. Silicon Carbide"<<endl;

cout<<"Enter the number: ";

cin>>MaterialType;

cout<<endl;

ModulusofElasticity = E[MaterialType];

SyofMaterial = Sy[MaterialType];

cout<<"Enter the dimensions of the material."<<endl;

cout<<"Length (m): ";

cin>>Length;

cout<<endl;

cout<<"Base of rectangular cross section (m): ";

cin>>base;

cout<<endl;

cout<<"Height (m): ";

cin>>height;

cout<<endl;

AreaMomentofInertia = (double) (base * pow(height,3))/12;

cout<<"Enter the applied load (P): ";

cin>>P;

cout<<endl;

cout<<"Enter the number of data points needed: ";

cin>>NoofDataPoints;


cout<<"Material Name: "<<Material[MaterialType]<<endl;

cout<<"E (GPa): "<<ModulusofElasticity<<endl;

cout<<"Sy (MPa): "<<SyofMaterial<<endl;

cout<<"Dimension <L,b,h>: <"<<Length<<", "<<base<<", "<<height<<">"<<endl;

cout<<"P: "<<P<<endl;

cout<<"Area moment of inertia (bh^3/12)[m^4]: "<< AreaMomentofInertia<<endl;


double center;

if(Length%2==0)

{

center =(int) Length/2;

}

else

{

center =(int) (Length+1)/2;

}

double CenterofDataPoints;

CenterofDataPoints = NoofDataPoints/2;

double Wmax = (P * pow(Length,3)) / (48 * ModulusofElasticity * AreaMomentofInertia);

cout<<"Wmax: -"<<Wmax<<endl;

double Smax = (P * Length * (height/2)) / (48 * ModulusofElasticity * AreaMomentofInertia);

cout<<"Smax: "<<Smax<<endl;

if(Smax > SyofMaterial)

{

cout<<"Plastic deformation of structure"<<endl;

}


double W ;

for(double i=0;i<center; i=(double)i+(center/(CenterofDataPoints)))

{

W = (double) ((P*i)*( (3*(pow(Length,2))) - (4*(pow(i,2))) )) / (48*ModulusofElasticity * AreaMomentofInertia);

cout<<i<<" "<<W<<endl;

}


for(double i=center;i<Length; i=(double)i+(center/(CenterofDataPoints)))

{

W = (double) ( (P*(Length-i)) * ((pow(Length,2)-(8*i)*Length) + (4*pow(i,2)))) /(49*ModulusofElasticity * AreaMomentofInertia);

cout<<i<<" "<<W<<endl;

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote