# Root Finding and Nonlinear Sets of Equations part 2

Chia sẻ: Dasdsadasd Edwqdqd | Ngày: | Loại File: PDF | Số trang:5

0
72
lượt xem
8

## Root Finding and Nonlinear Sets of Equations part 2

Mô tả tài liệu

Tham khảo tài liệu 'root finding and nonlinear sets of equations part 2', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả

Chủ đề:

Bình luận(0)

Lưu

## Nội dung Text: Root Finding and Nonlinear Sets of Equations part 2

1. 350 Chapter 9. Root Finding and Nonlinear Sets of Equations for (i=1;i
2. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copying of machine- readable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMs visit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America). Figure 9.1.1. Some situations encountered while root ﬁnding: (a) shows an isolated root x1 bracketed a sign change in the function near a double root (in fact, there is not necessarily a root!); (c) is a by two points a and b at which the function has opposite signs; (b) illustrates that there is not necessarily pathological function with many roots; in (d) the function has opposite signs at points a and b, but the 351 a x2 x3 b b b 9.1 Bracketing and Bisection x1 a x1 d a c f points bracket a singularity, not a root. e (b) (d) (a) (c)
3. 352 Chapter 9. Root Finding and Nonlinear Sets of Equations #include #define FACTOR 1.6 #define NTRY 50 int zbrac(float (*func)(float), float *x1, float *x2) Given a function func and an initial guessed range x1 to x2, the routine expands the range geometrically until a root is bracketed by the returned values x1 and x2 (in which case zbrac returns 1) or until the range becomes unacceptably large (in which case zbrac returns 0). visit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America). readable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMs Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copying of machine- Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) { void nrerror(char error_text[]); int j; float f1,f2; if (*x1 == *x2) nrerror("Bad initial range in zbrac"); f1=(*func)(*x1); f2=(*func)(*x2); for (j=1;j