It is well known that the yield strength of metals is dependent on the size of t
ID: 3842398 • Letter: I
Question
It is well known that the yield strength of metals is dependent on the size of the poly-crystals that make up the microstructure. The yield strength, sigma, can be related to the average grain diameter by the Hall-Petch equation: sigma = sigma_0 + Kd^-1/2 where sigma_0 and K are material-specific constants and d is the average grain size. Create a function called HallPetch. The function should take 3 scalar inputs (sigma_0, K, d) which it then uses to calculate the yield strength. Make a table of yield strengths for grain sizes going from 0.1 to 10 mm in 0.1 mm increments. Your function should not take a vector input. Use a loop to call the function multiple times. Take sigma = 12,000psi and K = 9600psi squareroot mm. The table should have the following form:Explanation / Answer
Implementation of Hall-Petch function in C++
#include<iostream.h>
#include <iomanip>
#include<math.h>
float HallPetch(int constant, int K, double d){
double yield_strength;
yield_strength = constant + K / pow(d, 0.5);
return yield_strength;
}
void main(){
double d;
d= 0.1;
cout << "Grain Size(mm) " << Yield Strength(psi)
while (d < 10.1){
cout << d << " " << setprecision(2) << HallPetch(12000, 9600,d);
d = d+0.1;
}
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.