2. In class we discussed a problem involving two reversible chemical reactions as an example of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. In class we discussed a problem involving two reversible chemical reactions as an example of a system of nonlinear equations. After simplifying, the equations can be written as f (C, C) = C + C k(ao 2c - C) (bo C) = 0, g (C, C) = = C + C - k(ao 2c c) (do c) = 0, - where C, C are the equilibrium product concentrations arising from the two reactions, k, k2 are the equilibrium reaction constants, and ao, bo, do are the initial concentrations of the reactants. Let ao = 20 mole/liter, bo = do = 10 mole/liter, k 1.63 10-4, k = 3.27 10-. The Matlab code on the back of this sheet applies Newton's method to solve for C, C. The code takes six steps starting from initial guess c = C2 = 0.5 mole/liter and it prints the results in a table with the following format. column 1: n (step index) column 2: C column 3: C column 4: f(c, C) column 5: g(C, C) = Your assignment is to run the code and present the table of results in your writeup. You may put the code into an M-file. In order to run the code, you must fill in the two functions f(C, C), g(C, C) and the Jacobian matrix. % % MTH 422, exercise on Newton's method for solving a nonlinear system % function Newton clear; format long; c1 = 0.5; c2 = 0.5; for n = 1:6 result (n, 1) = n-1; result (n, 2) = c1; result (n, 3) = c2; result (n, 4) result (n,5) = answer = f(c1, c2); g(c1, c2); [c1; c2] jacobian (c1, c2)\[f(c1, c2); g(c1, c2)]; c1 = answer (1); c2 = answer (2); end result % function ffun = f(c1, c2) a0 = 20; b0 = 10; d010; k1 = 1.63e-4; k2= 3.27e-3; ffun = % fill in 1st function % function gfun a0 = 20; bo gfun = % fill in 2nd function % function j = jacobian (c1, c2) a0 = 20; b0 = 10; d0 = 10; k1 = 1.63e-4; k2 = 3.27e-3; j11 % fill in 11 element = j12 % fill in 12 element g(c1, c2) = 10; do 10; k1 = 1.63e-4; k2 = 3.27e-3; j = j21 % fill in 21 element = j22 = % fill in 22 element [j11 j12; j21 j22]; = 2. In class we discussed a problem involving two reversible chemical reactions as an example of a system of nonlinear equations. After simplifying, the equations can be written as f (C, C) = C + C k(ao 2c - C) (bo C) = 0, g (C, C) = = C + C - k(ao 2c c) (do c) = 0, - where C, C are the equilibrium product concentrations arising from the two reactions, k, k2 are the equilibrium reaction constants, and ao, bo, do are the initial concentrations of the reactants. Let ao = 20 mole/liter, bo = do = 10 mole/liter, k 1.63 10-4, k = 3.27 10-. The Matlab code on the back of this sheet applies Newton's method to solve for C, C. The code takes six steps starting from initial guess c = C2 = 0.5 mole/liter and it prints the results in a table with the following format. column 1: n (step index) column 2: C column 3: C column 4: f(c, C) column 5: g(C, C) = Your assignment is to run the code and present the table of results in your writeup. You may put the code into an M-file. In order to run the code, you must fill in the two functions f(C, C), g(C, C) and the Jacobian matrix. % % MTH 422, exercise on Newton's method for solving a nonlinear system % function Newton clear; format long; c1 = 0.5; c2 = 0.5; for n = 1:6 result (n, 1) = n-1; result (n, 2) = c1; result (n, 3) = c2; result (n, 4) result (n,5) = answer = f(c1, c2); g(c1, c2); [c1; c2] jacobian (c1, c2)\[f(c1, c2); g(c1, c2)]; c1 = answer (1); c2 = answer (2); end result % function ffun = f(c1, c2) a0 = 20; b0 = 10; d010; k1 = 1.63e-4; k2= 3.27e-3; ffun = % fill in 1st function % function gfun a0 = 20; bo gfun = % fill in 2nd function % function j = jacobian (c1, c2) a0 = 20; b0 = 10; d0 = 10; k1 = 1.63e-4; k2 = 3.27e-3; j11 % fill in 11 element = j12 % fill in 12 element g(c1, c2) = 10; do 10; k1 = 1.63e-4; k2 = 3.27e-3; j = j21 % fill in 21 element = j22 = % fill in 22 element [j11 j12; j21 j22]; =
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Calculating Manufacturing Overhead Rates Windsor Company, accumulated the following data for 2017: Milling Department manufacturing overhead $187,200 Finishing Department manufacturing overhead...
-
find one example from the news media that you can link --either videos, podcasts, articles, reports, television broadcasts, etc.--that exhibit what you take to be a valid and sound deductive argument.
-
Justin is considering majoring in bioinformatics. He is considering three career options: working for a Silicon Valley start-up, working for a large pharmaceutical firm, or working for a university...
-
In Exercises 7192, find and simplify the difference quotient f(x +h)-f(x) h -, h = 0
-
Mirror M1 in Figure 37.22 is displaced a distance L. During this displacement, 250 fringe reversals (formation of successive dark or bright bands) are counted. The light being used has a wavelength...
-
Folders Office Supply makes two types of paper pads, legal and regular. A box of legal pads requires 20 minutes to produce and a box of regular pads requires 10 minutes to produce. Two people work on...
-
In a study of high school football players that suffered concussions, researchers placed the players in two groups. Players that recovered from their concussions in 14 days or less were placed in...
-
Two years ago, Agro, Inc., purchased an ACE generator that cost $250,000. Agro had to pay an additional $50,000 for delivery and installation, and the investment in the generator required the firm to...
-
4. Find the equation of the tangent line to the graph of y = 2% at x = 1. Show complete analytic work finding the derivative, evaluating at the point, and using the slope and a point to find the...
-
During 2023, a township issued $3,000 in fines for failure to keep real property in 'acceptable' condition. The township estimates that $300 of the fines issued in 2023 will be uncollectible. The...
-
Q3- IE company produces and sells T-shirts. Its fixed costs amount to 400,000 approximately, whereas each T-shirt costs 12 to be produced. The company sells its products at the price of 20 each. Can...
-
What are the requiremnets to be considered selfemployed for tax purposes in Canada?
-
What is an example of a report that must be printed before you can proceed to other steps in the Order Entry module?
-
As we try to improve our models, we need to balance underfitting and overfitting. What do we call this phenomena?
-
Looking at the below code snippet, is this code error free and if so, what will it print to the console? If the code does have errors, then describe all syntax, run-time, and logic errors and how...
-
What is the health tax rate for a BC charity with over $4,500,000 in payroll?
-
Calculate the factor of financial leverage (leverage) in the conditions when the company achieved a rate of increase in gross profit (profit before taxes) of 212% and an increase in business...
-
Vince, Inc. has developed and patented a new laser disc reading device that will be marketed internationally. Which of the following factors should Vince consider in pricing the device? I. Quality of...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family. Ivan and Irene have the following investment income, in addition to that reported in Chapter 1: Dividends...
-
John Fuji (age 37) moved from California to Washington in December 2011. He lives at 468 Cameo Street, Yakima, WA 98901. John's Social Security number is 571-78-5974 and he is single. His earnings...
-
Indicate, in each of the following situations, the number of exemptions the taxpayers are entitled to claim on their 2012 income tax returns. Number of Exemptions a. Donna, a 20-year-old single...
-
Explain why only normal or zero economic profits are possible in a perfectly contestable market.
-
In what ways does the theory of contestable markets suggest that firm behaviour will be affected by the threat of entry into a market?
-
Are sunk costs, by definition, non-recoverable?
Study smarter with the SolutionInn App