[Solved] 2 Questions Please Calculations Must Done Matlab Need Matlab Codes Please Q37196948
These 2 questions please and all calculations must be done inmatlab. I need the matlab codes please21.19 The objective of this problem is to compare second- order accurate forward, backward, and centered finite- difference approximations of the first derivative of a function to the actual value of the derivative. This will be done for f (x) = e-2x-X (a) Use calculus to determine the correct value of the deriv- ative at x 2. (b) Develop an M-file function to evaluate the centered finite-difference approximations, starting with x-0.5. Thus, for the first evaluation, the x values for the cen tered difference approximation will be x 2±0.5 or x = 1.5 and 2.5. Then, decrease in increments of 0.1 down to a minimum value of Δχ 0.01 (c) Repeat part (b) for the second-order forward and back ward differences. (Note that these can be done at the same time that the centered difference is computed in the loop.) (d) Plot the results of (b) and (c) versus x. Include the exact result on the plot for comparison. 21.34 An nth-order rate law is often used to model chemical reactions that solely depend on the concentration of a single reactant: where cconcentration (mole), time (min), reaction order (dimensionless), and k reaction rate min mole). The differential method can be used to evaluate the parameters k and n. This involves applying a logarithmic transform to the rate law to yield log(- )-log k + n log c Therefore, if the nth-order rate law holds, a plot of the log(-dc/dt) versus log c should yield a straight line witha slope of n and an intercept of logk. Use the differential method and linear regression to determine k and n for the following data for the conversion of ammonium cyanate to urea: Show transcribed image text 21.19 The objective of this problem is to compare second- order accurate forward, backward, and centered finite- difference approximations of the first derivative of a function to the actual value of the derivative. This will be done for f (x) = e-2x-X (a) Use calculus to determine the correct value of the deriv- ative at x 2. (b) Develop an M-file function to evaluate the centered finite-difference approximations, starting with x-0.5. Thus, for the first evaluation, the x values for the cen tered difference approximation will be x 2±0.5 or x = 1.5 and 2.5. Then, decrease in increments of 0.1 down to a minimum value of Δχ 0.01 (c) Repeat part (b) for the second-order forward and back ward differences. (Note that these can be done at the same time that the centered difference is computed in the loop.) (d) Plot the results of (b) and (c) versus x. Include the exact result on the plot for comparison. 21.34 An nth-order rate law is often used to model chemical reactions that solely depend on the concentration of a single reactant: where cconcentration (mole), time (min), reaction order (dimensionless), and k reaction rate min mole). The differential method can be used to evaluate the parameters k and n. This involves applying a logarithmic transform to the rate law to yield log(- )-log k + n log c Therefore, if the nth-order rate law holds, a plot of the log(-dc/dt) versus log c should yield a straight line witha slope of n and an intercept of logk. Use the differential method and linear regression to determine k and n for the following data for the conversion of ammonium cyanate to urea:
Expert Answer
Answer to These 2 questions please and all calculations must be done in matlab. I need the matlab codes please… . . .
OR

