Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MatLab R = 1.987 Formula: k = k0*exp(-Q/(R*T)); Arrhenius equation function Review the description of HW2 about the Arrhenius equation. We were using the script
MatLab
R = 1.987
Formula: k = k0*exp(-Q/(R*T));
Arrhenius equation function Review the description of HW2 about the Arrhenius equation. We were using the script file to calculate teh reaction rate for a special condition with given Q, KO and T. Now, you need to write a function to calculate reaction rate (k). A function allows us to re-use the function for various conditions. For example, we can claculate the reaction rate of same chemicals at different temperature(T). The syntax of this function should has 2 output (line 1 and line2) and three inputs (ko, Q and T). line 1 and line2 are formatted output compiled by sprintf command. The syntax of sprintf is the same as fprintf except it can assign the output to variavle. In this homework, you need to format the output as the following example when Q=8000, ko=1200, and T=500 Given that the activation energy is 8.00+03 cal/mol and the reaction constant is 1.20+03 1/min, the reation rate at temperature of 500 K is 0.38203 Note: All numerical values use field width of 8 except Temperature. The second line does not include a period at the end Function Save C Reset MATLAB Documentation 1 function [line1, line2] = ArrheniusEQ(????) 2 % k = ArrheniusEQ(k0, ActivitionEnergy, Temperature) calculate the reaction rate k based on the Arrhenius Eq. 3 % This functino will generate a formatted result as the following example + in 5 % Given the activation energy is 8.002+03 cal/mol and the reaction constant is 1.200+03 1/min. 6 % The reation rate at temperature of 500 K is 0.38203. 8 % R is a constant which will not change, therefore, we do not use it as an input. 9 % Define R first. Add ; to suppress the ressult 10 R=; 11 % New, calculate k use the input variables based on the Arrhenius Eq % Use ; at the end to suppress the result as well. 13 k=; 14 % Now, use sprintf to assign the formattted result to line1 and line2. All filed width is 8 except the Temper 15 line1=sprintf(???) % add at the end to change line 16 line2=sprintf(???) 17 end Code to call your function C Reset 1 [line1, line2]=ArrheniusEQ(1200, 8000, 500); Assessment: Check the output of line1 when T=300 Check the output of line 2 when T=500Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started