Nonlinear Equations. Not guaranteed to have any real solutions, but generally do for astrophysical problems.

Similar documents
Numerical Methods. Root Finding

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane.

3.1 Introduction. Solve non-linear real equation f(x) = 0 for real root or zero x. E.g. x x 1.5 =0, tan x x =0.

Solving Non-Linear Equations (Root Finding)

Newton-Raphson. Relies on the Taylor expansion f(x + δ) = f(x) + δ f (x) + ½ δ 2 f (x) +..

Nonlinearity Root-finding Bisection Fixed Point Iteration Newton s Method Secant Method Conclusion. Nonlinear Systems

Lecture 5: Random numbers and Monte Carlo (Numerical Recipes, Chapter 7) Motivations for generating random numbers

Chapter 6. Nonlinear Equations. 6.1 The Problem of Nonlinear Root-finding. 6.2 Rate of Convergence

x 2 x n r n J(x + t(x x ))(x x )dt. For warming-up we start with methods for solving a single equation of one variable.

CLASS NOTES Models, Algorithms and Data: Introduction to computing 2018

Root Finding: Close Methods. Bisection and False Position Dr. Marco A. Arocha Aug, 2014

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 5. Nonlinear Equations

Numerical Methods Lecture 3

(One Dimension) Problem: for a function f(x), find x 0 such that f(x 0 ) = 0. f(x)

Nonlinear Equations. Chapter The Bisection Method

1. Method 1: bisection. The bisection methods starts from two points a 0 and b 0 such that

Bisection and False Position Dr. Marco A. Arocha Aug, 2014

CLASS NOTES Computational Methods for Engineering Applications I Spring 2015

Solution of Algebric & Transcendental Equations

SOLUTION OF ALGEBRAIC AND TRANSCENDENTAL EQUATIONS BISECTION METHOD

Numerical Methods in Informatics

A Few Concepts from Numerical Analysis

Scientific Computing. Roots of Equations

Today s class. Numerical differentiation Roots of equation Bracketing methods. Numerical Methods, Fall 2011 Lecture 4. Prof. Jinbo Bi CSE, UConn

ROOT FINDING REVIEW MICHELLE FENG

Scientific Computing: An Introductory Survey

PART I Lecture Notes on Numerical Solution of Root Finding Problems MATH 435

Numerical Analysis: Solving Nonlinear Equations

Goals for This Lecture:

Roots of Equations. ITCS 4133/5133: Introduction to Numerical Methods 1 Roots of Equations

Computational Methods CMSC/AMSC/MAPL 460. Solving nonlinear equations and zero finding. Finding zeroes of functions

Solution of Nonlinear Equations

Root-finding and nonlinear systems. Unit II. Root-Finding and Nonlinear Systems. Numerical equation solving. Single-variable (nonlinear) equations

Quiescent Steady State (DC) Analysis The Newton-Raphson Method

Outline. Scientific Computing: An Introductory Survey. Nonlinear Equations. Nonlinear Equations. Examples: Nonlinear Equations

15 Nonlinear Equations and Zero-Finders

MATH 3795 Lecture 12. Numerical Solution of Nonlinear Equations.

Numerical Methods Dr. Sanjeev Kumar Department of Mathematics Indian Institute of Technology Roorkee Lecture No 7 Regula Falsi and Secant Methods

Unit 2: Solving Scalar Equations. Notes prepared by: Amos Ron, Yunpeng Li, Mark Cowlishaw, Steve Wright Instructor: Steve Wright

Root Finding (and Optimisation)

Chapter 11 ORDINARY DIFFERENTIAL EQUATIONS

Integration, differentiation, and root finding. Phys 420/580 Lecture 7

SUPPLEMENTARY INFORMATION

Lecture 7. Root finding I. 1 Introduction. 2 Graphical solution

Nonlinearity Root-finding Bisection Fixed Point Iteration Newton s Method Secant Method Conclusion. Nonlinear Systems

Introductory Numerical Analysis

GENG2140, S2, 2012 Week 7: Curve fitting

CHAPTER-II ROOTS OF EQUATIONS

Possible Extra Credit Option

CS 450 Numerical Analysis. Chapter 5: Nonlinear Equations

The Birth Of Stars. How do stars form from the interstellar medium Where does star formation take place How do we induce star formation

Appendix 8 Numerical Methods for Solving Nonlinear Equations 1

Root Finding and Optimization

cha1873x_p02.qxd 3/21/05 1:01 PM Page 104 PART TWO

Physical Processes in Astrophysics

1. Nonlinear Equations. This lecture note excerpted parts from Michael Heath and Max Gunzburger. f(x) = 0

Line Search Methods. Shefali Kulkarni-Thaker

Mathematical modelling Chapter 2 Nonlinear models and geometric models

Midterm Review. Igor Yanovsky (Math 151A TA)

Consequences of Continuity and Differentiability

Chapter 16 Lecture. The Cosmic Perspective Seventh Edition. Star Birth Pearson Education, Inc.

Astronomy 8824: Numerical Methods Notes 2 Ordinary Differential Equations

Variable. Peter W. White Fall 2018 / Numerical Analysis. Department of Mathematics Tarleton State University

Review of Classical Optimization

Math Numerical Analysis

CS 257: Numerical Methods

CS 323: Numerical Analysis and Computing

Outline. Math Numerical Analysis. Intermediate Value Theorem. Lecture Notes Zeros and Roots. Joseph M. Mahaffy,

Numerical Analysis. EE, NCKU Tien-Hao Chang (Darby Chang)

6. Interstellar Medium. Emission nebulae are diffuse patches of emission surrounding hot O and

Chapter 4. Solution of Non-linear Equation. Module No. 1. Newton s Method to Solve Transcendental Equation

BEKG 2452 NUMERICAL METHODS Solution of Nonlinear Equations

NOTES FOR NUMERICAL METHODS MUHAMMAD USMAN HAMID

Nonlinear Equations. Your nonlinearity confuses me.

CHAPTER 4 ROOTS OF EQUATIONS

Lecture 34 Minimization and maximization of functions

Optimization. Charles J. Geyer School of Statistics University of Minnesota. Stat 8054 Lecture Notes

1.10 Continuity Brian E. Veitch

Key Concepts: Economic Computation, Part III

Determining the Roots of Non-Linear Equations Part I

5 Finding roots of equations

Ordinary Differential Equations

1.1: The bisection method. September 2017

Photodissociation Regions Radiative Transfer. Dr. Thomas G. Bisbas

Photoionization Modelling of H II Region for Oxygen Ions

Numerical Methods. Roots of Equations

MITOCW watch?v=vu_of9tcjaa

Kinetics - Chapter 14. reactions are reactions that will happen - but we can t tell how fast. - the steps by which a reaction takes place.

Figure 1: Graph of y = x cos(x)

Zeroes of Transcendental and Polynomial Equations. Bisection method, Regula-falsi method and Newton-Raphson method

Chapter 1. Root Finding Methods. 1.1 Bisection method

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science

Gas 1: Molecular clouds

Root Finding For NonLinear Equations Bisection Method

Nonlinear equations. Norms for R n. Convergence orders for iterative methods

Math 473: Practice Problems for Test 1, Fall 2011, SOLUTIONS

Extended Introduction to Computer Science CS1001.py. Lecture 8 part A: Finding Zeroes of Real Functions: Newton Raphson Iteration

PHYS 410/555 Computational Physics Solution of Non Linear Equations (a.k.a. Root Finding) (Reference Numerical Recipes, 9.0, 9.1, 9.

ECE133A Applied Numerical Computing Additional Lecture Notes

Lecture 8. Root finding II

Transcription:

Nonlinear Equations Often (most of the time??) the relevant system of equations is not linear in the unknowns. Then, cannot decompose as Ax = b. Oh well. Instead write as: (1) f(x) = 0 function of one variable (1-D) (2) f(x) = 0 x = (x 1,x 2,...,x n ), f = (f 1,f 2,...,f n ) (n-d) Not guaranteed to have any real solutions, but generally do for astrophysical problems.

Solutions in 1-D Generally, solving multi-d equations is much harder, so we'll start with the 1-D case first... By writing f(x) = 0 we have reduced the problem to solving for the roots of f. In 1-D it is usually possible to trap or bracket the desired roots and hunt them down. Typically all root-finding methods proceed by iteration, improving a trial solution until some convergence criterion is satisfied.

Function Pathologies Before blindly applying a root-finding algorithm to a problem, it is essential that the form of the equation in question be understood: graph it! For smooth functions good algorithms will always converge, provided the initial guess is good enough. Pathologies include discontinuities, singularities, multiple or very close roots, or no roots at all!

Numerical Root Finding Suppose f(a) and f(b) have opposite sign. Then, if f is continuous on the interval (a,b), there must be at least one root between a and b (this is the Intermediate Value Theorem). Such roots are said to be bracketed. Bracketed root Many roots No roots

Example Application Use root finding to calculate the equilibrium temperature of the ISM. The ISM is a very diffuse plasma. Heated by nearby stars and cosmic rays. Cooled by a variety of processes: Bremsstrahlung: collisions between electrons and ions Atom-electron collisions followed by radiative decay Thermal radiation from dust grains

Example, Cont'd Equilibrium temperature given when: Rate of Heating H = Rate of Cooling C Often H is not a function of temperature T. Usually C is a complex, nonlinear function of T. To solve, find T such that H - C(T) = 0.

Bracketing and Bisection NRiC 9.1 lists some simple bracketing routines. Once bracketed, root is easy to find by bisection: Evaluate f at interval midpoint (a + b) / 2. Root must be bracketed by midpoint and whichever a or b gives f of opposite sign. Bracketing interval decreases by 2 each iteration: ε n+1 = ε n / 2. Hence to achieve error tolerance of ε starting from interval of size ε 0 requires n = log 2 (ε 0 /ε) steps.

Convergence Bisection converges linearly (first power of ε). Methods in which ε n+1 = (constant) (ε n ) m m > 1 are said to converge superlinearly. Note error actually decreases exponentially for bisection. It converges "linearly" because successive figures are won linearly with computational effort.

Tolerance What is a practical tolerance ε for convergence? Cannot be less than round-off error. For single-precision (float) accuracy, typically take ε = 10-6 in fractional error. i.e. ~ where x = numerical solution, x r = actual root. When f(xr ) = 0 this fails, so use ε = 10-6 as absolute error (or perhaps use ε( a + b )/2).

Newton-Raphson Method Can one do better than linear convergence? Duh! Expand f(x) in a Taylor series: f(x + δ) = f(x) + f '(x) δ + f "(x) δ 2 /2 +... For δ << x, drop higher order terms, so: f(x + δ) = 0 δ = - f(x) / f '(x) δ is correction added to current guess of root: i.e. x i+1 = x i + δ

Newton-Raphson, Cont'd Graphically, Newton-Raphson (NR) uses tangent line at x i to find zero crossing, then uses x at zero crossing as next guess: Note: only works near root (δ << x)...

Newton-Raphson, Cont'd When higher order terms important, NR fails spectacularly. Other pathologies exist too: Shoots to infinity Never converges

Newton-Raphson, Cont'd Why use NR if it fails so badly? Rate of convergence: ε i+1 = ε i - f(x i ) / f '(x i ) Taylor expand f(xi ) & f '(x i ) to get: ε i+1 = - ε i2 f ''(x i ) / f '(x i ) [quadratic!] Note both f(x) and f '(x) must be evaluated each iteration, plus both must be continuous near root. Best use of NR is to "polish-up" bisection root.

Nonlinear Systems of Equations Consider the system f(x,y) = 0, g(x,y) = 0. Plot zero contours of f & g: No information in f about g, and vice versa. In general, no good method for finding roots.

Nonlinear Systems, Cont'd If you are near root, best bet is NR. e.g. For F(x) = 0, choose x i+1 = x i + δ, where F'(x) δ = - F(x) This is a matrix equation: F'(x) is a matrix with elements F i / x j. The matrix is called the Jacobian. Written out: = =

Nonlinear Systems, Cont'd Given initial guess, must evaluate matrix elements and RHS, solve system for δ, and compute next iteration x i+1. Then repeat (must solve 2 2 linear system each time). Essentially the non-linear system has been linearized to make it easier to work with. NriC 9.7 discusses a global convergence strategy that combines multi-d NR with "backtracking" to improve chances of finding solutions.

Example: Interstellar Chemistry ISM is multiphase plasma consisting of electrons, ions, atoms, and molecules. Originally, the ISM was thought to be too hostile for molecules. But in 1968-69, radio observations discovered absorption/emission lines of NH 3, H 2 CO, H 2 O,... Lots of organic molecules, e.g. CH 3 CH 2 OH (ethanol).

Example, Cont'd In some places, all atoms have been incorporated into molecules. For example, molecular clouds: dense, cold clouds of gas composed primarily of molecules. (T ~30 K, n ~10 6 cm -3, M ~10 5-6 M, R ~ 10-100 pc). How do you predict what abudances of different molecules should be, given n and T? Need to solve a chemical reaction network.

Example, Cont'd Consider reaction between two species A and B: A + B AB reaction rate = n A n B R AB Reverse also possible: AB A + B In equilibrium: reaction rate = n AB R' AB (1) n A n B R AB = n AB R' AB (2) n A + n AB = n A 0 (3) n B + n AB = n B 0 \ Normalizations: # / A & B conserved

Example, Cont'd Substitute normalization equations into reaction equations to get quadratic in n AB, easily solved. However, many more possible reactions: AC + B AB + C (exchange reaction) ABC AB + C (dissociation reaction) Wind up with large nonlinear system describing all forward/reverse reactions, involving known reaction rates R. Must solve given fixed n 0 & T.

Numerical Derivatives For NR and function minimization, often need derivatives of functions. It's always better to use an analytical derivative if it's available. If you're stuck, could try: However, this is very susceptible to RE. Better: Read NriC 5.7 before trying this!