DONT TAKE THE DIFFICULT PATH IN SOLVING SYSTEMS

  • Slides: 17
Download presentation
DON’T TAKE THE DIFFICULT PATH IN SOLVING SYSTEMS OF NONLINEAR EQUATIONS Mordechai Shacham and

DON’T TAKE THE DIFFICULT PATH IN SOLVING SYSTEMS OF NONLINEAR EQUATIONS Mordechai Shacham and Michael Elly Ben Gurion University of the Negev Beer-Sheva, Israel Michael B. Cutlip University of Connecticut Storrs, CT

Use of Realistic Examples in Computational and “Numerical Methods” Courses Ø In computation and

Use of Realistic Examples in Computational and “Numerical Methods” Courses Ø In computation and numerical methods related courses, artificial examples and assignments are often used for demonstration and training. Ø We have found that using Ch. E related problems for demonstration and training can increase considerably a student's motivation to learn such subjects. ØSuitable problems can be found in textbooks (such as our book 1) and web-based resources (such as Learn. Chem. E 2) 1 Cutlip and Shacham, Problem Solving in Cemical and Biochemical Engineering with POLYMATH, Excel and MATLAB, 2008 2“Learn. Chem. E – Educational Resources for Chemical Engineering” website of the University of Colorado, Boulder.

Screencast of a Suitable Example

Screencast of a Suitable Example

Suggested Formulation of the Implicit Equation Set for Solution with Polymath Ten implicit algebraic

Suggested Formulation of the Implicit Equation Set for Solution with Polymath Ten implicit algebraic equations require ten initial estimates some difficult to find Functions undefined for negative (or zero) variable values may prevent convergence of the solution algorithm

Reformulation and rearrangement of the NLE System for Alleviating the Solution Process Ø Identify

Reformulation and rearrangement of the NLE System for Alleviating the Solution Process Ø Identify expressions with discontinuities (like logarithm, square root, division by unknowns, etc. ). Modify such expressions as to eliminate the discontinuities (replacing log by exp. , for example. ) Ø Select a unique "output" variable from each of the equations, where an output variable only appears on the left hand side (l. h. s) of one (and only one) of the equations. Leave the equations from which no output variable can be selected in an implicit form. Ø Mark the unknowns that could not be selected as output variables as of "known" (value) and arrange the explicit equations in a sequence so that only "known" variables appear in the r. h. s. of the equations and the "output" variable on the l. h. s. Explicit equations that cannot be arranged in this form should be rewritten as implicit equations.

Original Equation set is rewritten by modifying Eqs. 1, 2, 6 and 7 and

Original Equation set is rewritten by modifying Eqs. 1, 2, 6 and 7 and selecting output variables No unique output variable can be selected

Computational Sequencing with Variable Mapping Table In the variable mapping Table when the input

Computational Sequencing with Variable Mapping Table In the variable mapping Table when the input variable is known the output variable can be calculated. To start the sequencing an initial guess for need to be specified Computational sequence (T), 1, 2, 9, 10, 8, 6, 7, 3, 4, 5[f(T)]

The Equation Set is Rewritten as a System of 9 Explicit and 1 Implicit

The Equation Set is Rewritten as a System of 9 Explicit and 1 Implicit NLEs Initial guess for T Nine explicit algebraic equations One implicit equation

The Poly. Math. Lite App* *Poly. Math. Lite is an Android app produced by

The Poly. Math. Lite App* *Poly. Math. Lite is an Android app produced by Poly. Math Software. (http: //www. polymathlite. com)

Partial Poly. Math. Lite Program and Results for the Example

Partial Poly. Math. Lite Program and Results for the Example

Poly. Math. Lite Generated MATLAB for Solving the Example Poly. Math. Lite generates a

Poly. Math. Lite Generated MATLAB for Solving the Example Poly. Math. Lite generates a completely functional MATLAB program for solving the same problem. The changes include: 1. Arranging the equations in a sequential order. 2. Changing the Polymath syntax to MATLAB syntax 3. Calling the appropriate library function according to the problem type

Poly. Math. Lite Generated MATLAB for Solving the Example The Poly. Math. Lite generated

Poly. Math. Lite Generated MATLAB for Solving the Example The Poly. Math. Lite generated MATLAB program can serve as a basis for a MATLAB programming exercise (for example, solving the system of equations for various liquid composition and pressure values and plotting the results).

Conclusions ØA simple, systematic procedure that enables simplifying and alleviating the solution of problems

Conclusions ØA simple, systematic procedure that enables simplifying and alleviating the solution of problems that require numerical solution of systems of nonlinear equations has been presented and demonstrated. ØA realistic chemical engineering problem was solved using the proposed method in order to demonstrate the importance of numerical problem solving tools in chemical and biochemical engineering studies. ØUsing realistic examples and combination of Polymath and MATLAB programming improved considerably the student’s performance in numerical methods and programming courses

Reaction Equilibrium by Minimization of the Gibbs Energy*. Ø Ethane is steam cracked to

Reaction Equilibrium by Minimization of the Gibbs Energy*. Ø Ethane is steam cracked to form hydrogen over a cracking catalyst at temperature T = 1000 K and pressure of P = 1 atm. Ø The feed contains 4 moles of H 2 O per mole of CH 4. Ø It is assumed that only the compounds 1. CH 4, 2. C 2 H 4, 3. C 2 H 2, 4. CO 2, 5. CO, 6. O 2, 7. H 2, 8. H 2 O and 9. C 2 H 6 present in the equilibrium mixture. Ø Calculate the equilibrium composition of the effluent mixture. The solution of this problem involves the minimization of the total Gibbs energy given by *Balzisher, R. E. Samuels, M. R. and Eliassen, J. D. , Chemical Engineering Thermodynamics, Prentice-Hall, Englewood Cliffs, NJ, 1972

Original Formulation of the Gibbs Energy Minimization Problem There are 12 implicit and 2

Original Formulation of the Gibbs Energy Minimization Problem There are 12 implicit and 2 explicit algebraic equations with 14 variables. Ten variables are (strictly) constrained to > 0 values. Most solution methods fail ( reaching ≤ 0 value of some of the variables).

Revised Formulation of the Gibbs Energy Minimization Problem There are 4 implicit and 10

Revised Formulation of the Gibbs Energy Minimization Problem There are 4 implicit and 10 explicit algebraic equations with 14 variables. Only 4 variables are strictly constrained strictly to > 0 values.

Revised Formulation of the Gibbs Energy Minimization Problem The tear variables which are constrained

Revised Formulation of the Gibbs Energy Minimization Problem The tear variables which are constrained strictly to > 0 values are actually >> 0. Variables with very small values (O 2, C 2 H 2, etc) do not prevent converhence even if they obtain negative values during iterations.