Chemical reaction rates are proportional to a rate constant k that changes with
ID: 3751834 • Letter: C
Question
Chemical reaction rates are proportional to a rate constant k that changes with the temperature according to the Arrhenius equation Find the values of K for given temperatures. #include #include **CONSTANTS*** 8000 // cal/mol #define ACT ENERGY #define GAS CONSTANT 1.9870 // ca/mo! K #de fine FREQUENCY 1200 / min-1 int main) t // get input variables as given in instructions double temp; double constRate; // K temperature /7 chemical reaction rates // instruct user to enter a temperature (100K-500K) printf"Enter a temperature (100k-500k): "); scanf( "%lf", &temp ) ; /1 if temperature out of range print message and end if temp 500) printf ("Temperature out of 100-500K range. Programming ending.n" else / **COMPUTE*** /1 compute rate constant cons tRate = FREQUENCY * exp ( -ACT ENERGY / GAS CONSTANT * temp ) ) ; // display temperature and rate constant printf ( "Temperature (K) : %. 0f ", temp ); printf( "Rate Constant: %.5e ", cons tRate ) ; return 0;Explanation / Answer
/*
Please find the attached C program which has code for all possible requirement
just copy the code and run in any C compiler
Note : if you running using command line then you need to enter input accordingly
or if you running it using some online compiler then you can give all input at once : please find my input and output attached at
the end of the program.
*/
#include <stdio.h>
#include <math.h>
#define ACT_ENERGY 8000
#define GAS_CONSTANT 1.9870
#define FREQUENCY 1200
int main() {
/*
Here we need to run a loop for number of iterations we want to double
then for each iteration we will take temperature as input and if it is in the range of 100k-500k
then we will print constRate two times
1st for temperature only
2nd for new increase_in_temp
else run the loop until user enter the value in the range of 100k-500k.
*/
double temp;
double constRate;
int number_of_iterations;
printf("Enter the number of temperatures to process: ");
scanf("%d",&number_of_iterations);
printf(" ");
int i;
for(i = 1;i<=number_of_iterations;i++){
do{
printf("Enter a temperature (100k-500k): ");
scanf("%lf", &temp);
if(temp >= 100.0 && temp <= 500.0){
double increase_in_temp;
do{
printf(" Enter the increase the temperature. ");
printf("Max temperature is 500k. Maximum increase is %.1lf ",500.0-temp);
scanf("%lf", &increase_in_temp);
if(increase_in_temp <= 500.0-temp){
printf(" Temperature set #%d ",i);
constRate = FREQUENCY * exp(-1*ACT_ENERGY / (GAS_CONSTANT * temp));
printf("Temperature (K): %.0lf ",temp);
printf("Rate Constant: %.5elf ",constRate);
//Now changed temp to increase_in_temp+temp;
temp = temp+increase_in_temp;
constRate = FREQUENCY * exp(-1*ACT_ENERGY / (GAS_CONSTANT * temp));
printf("Temperature (K): %.0lf ",temp);
printf("Rate Constant: %.5elf ",constRate);
break;
}
}
while(increase_in_temp > 500.0-temp);
}
printf(" ");
}while(temp < 100.0 || temp > 500.0);
}
return 0;
}
/*
Since I am running using some online compiler so I need to enter all input once
here is my input and output will be as mentioned below.
You can run this using command it will work as per your requirement.
My input is :
2
10
555
222
333
111
300
100
My Output format is :
Enter the number of temperatures to process:
Enter a temperature (100k-500k):
Enter a temperature (100k-500k):
Enter a temperature (100k-500k):
Enter the increase the temperature.
Max temperature is 500k. Maximum increase is 278.0
Enter the increase the temperature.
Max temperature is 500k. Maximum increase is 278.0
Temperature set #1
Temperature (K): 222
Rate Constant: 1.59536e-05lf
Temperature (K): 333
Rate Constant: 6.73442e-03lf
Enter a temperature (100k-500k):
Enter the increase the temperature.
Max temperature is 500k. Maximum increase is 200.0
Temperature set #2
Temperature (K): 300
Rate Constant: 1.78116e-03lf
Temperature (K): 400
Rate Constant: 5.10297e-02lf
*/
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.