Compute the stress and strain in steel columns subject to compression loads vary
ID: 3555684 • Letter: C
Question
Compute the stress and strain in steel columns subject to compression loads varying from 10.000 lbs to 100.000 lbs in increments of 5.000 lbs. The stress is given by the formula: a = The strain is given by: Where sigma is the stress in lb/in2 or psi epsilon is the strain which is no dimensional, p is the load in pounds. d is the diameter in inches, and E is the modulus of elasticity in psi. for steel this value is 30x106 psi The diameter of the column must be entered by the user. Your program must store the load, stress, and strain in separate one-dimensional arrays. Your program must display in table format the values for the load, stress and strain.Explanation / Answer
#include <stdio.h>
#define pi 3.14
#define elasticity 3*(10^6)
int main(void) {
float strain,stress,load,diameter;
float loadArray[19],strainArray[19],stressArray[19];
int i;
load = 10000;
printf("please enter diameter ");
scanf("%f",&diameter);
for(i=0;i<19;i++){
stress = (4*load)/(pi*diameter*diameter);
strain = stress/elasticity;
stressArray[i] = stress;
strainArray[i] = strain;
loadArray[i] = load;
load= load + 5000;
}
printf("load stress strain");
for(i=0;i<19;i++){
printf(" ");
printf("%f %f %f",loadArray[i]," ",stressArray[i]," ",strainArray[i]);
}
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.