SPRING, 2017 A3: STRESS AND STRAIN CALCULATIONS (using input/output files, if st
ID: 3789778 • Letter: S
Question
SPRING, 2017 A3: STRESS AND STRAIN CALCULATIONS (using input/output files, if structures, and a for loop INTRODUCTION: the task an engineer working for a company that provides material tensile lesting. Specifically, you have been given The of determining the deformation beha of an aluminum rod. Using a tensile testing machine, test specimen was stretched at a steady rate, and the force and length data were recorded the test.tst. input file, tensile test, is a comma in a file called tensile delimited file. You have for the customer (see the chart below, however you need to compute the stress and strain values, and determine the yield point to report. Stress vs Strain oot ca o des 007 The two definitions for stress and strain are either engineering or true. Since you will be computing the true stress and the true strain values, the equations for computing the values are: where a is the stress in lbin Fis the applied force in lbs A is the cross sectional area in in E is the strain in inin lis the rod length during testing in inches la is the original rod length in inches In is the natural logarithm to the base e ASSIGNMENT:Explanation / Answer
#include <stdio.h>
#include <math.h>
float cal_stress();
float cal_strain(float stress);
void output_results(float stress, float strain);
int main( )
{
float stress;
float strain;
stress = cal_stress();
strain = cal_strain(stress);
output_results(stress,strain);
//system("PAUSE");
return(0);
}
float cal_stress()
{
const float pi = 3.141593f;
float stress;
float radius;
float length;
float area;
long int p;
stress=0;
printf(" Enter the radius of the alluminium rod in inches: ");
scanf("%f", &radius);
printf(" Enter the length of the alluminium rod in inches: ");
scanf("%f", &length);
for(p = 10000; p <= 1000000; p += 100000)
{
area = (pi * radius *radius) / 4;
stress = p / area;
}
return stress;
}
float cal_strain(float stress)
{
const float E=30000000;
float strain;
strain = stress / E;
return strain;
}
void output_results (float stress, float strain)
{
printf(" Stress = %f Strain = %f ", stress, strain);
}
o/p : Enter the radius of the alluminium rod in inches:
Enter the length of the alluminium rod in inches:
Stress = 6237388021399133828037509727559678441355516867425250319664559714203598848.000000
Strain = 207912934046637781933522867540636676989909834481614910782422646784.000000
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.