0. Background
Solving equations is one of the most important problems in engineering calculations. This chapter focuses on different methods for determining the solution x of an equation.
Why do I need to know more than one method of solving equations? The choice of method depends on the cost required to evaluate the function or its derivative. Different usage scenarios have different convergence speed and computational complexity requirements for the solution method.
forward error and reverse error
The approximate solution we get for solving the equation is , and the exact solution of the equation is
forward error:
Backward error:
Backward error, measured vertically, is usually much smaller than forward error measured horizontally.
The termination criteria for the equation solving method can be based on forward or backward errors.
sensitive issue
If a small error in the input, in which case the problem is solved, causes a large problem in the output, such a problem is called a sensitivity problem. Suppose a small change is made to the input
Sensitive formula for root:
The previous coefficient is the error amplification factor, which is defined as {relative forward error}/{relative backward error}
1. Dichotomy
The main idea
According to the median value theorem, first roughly determine the location of the root, judge whether it is located in the left half or the right half of the existing interval, and then further subdivide the interval where the root is located.
specific algorithm
Assuming that the initial interval is , after n times of bisection, the resulting interval is of length , and the midpoint is chosen as the best estimate of the value.
theorem
If the error is less than , the solution is accurate to one decimal place.
features
In the process of binary iteration, it is not necessary to know the entire curve of the function, only to calculate the value of the function at the necessary position.
For the dichotomy method, once the expected accuracy is determined, the necessary number of iterations can be calculated through theorem.
2. Fixed point iterative FPI
definition
When , the real numbers are the fixed points of the function.
The main idea
All equations can be transformed into a fixed- point iterative problem, and the same equation can have multiple transformation forms, some transformation forms can converge to the fixed point, and some forms cannot converge. It is essentially a linear convergence and divergence problem of errors.
specific algorithm
First rewrite it into a suitable form;
given = initial estimate;
execute ;
until
theorem
Assuming the function is continuously differentiable, , , then the fixed point iteration converges to the fixed point linearly with velocity for a sufficiently close initial estimate .
features
The dichotomy can guarantee linear convergence, the fixed point iteration is only local convergence, and when the fixed point iteration converges, it converges linearly. The dichotomy removes 1/2 of the uncertainty at each step, while in FPI the uncertainty is multiplied at each step , so the fixed point iteration may be faster or slower than the dichotomy, depending on S in 1/2 size relationship.
Moreover, the fixed point iteration method does not guarantee that it will converge to .
3. Newton's method
Newton's method is an improved algorithm of FPI, also known as Newton-Raphson method.
The main idea
From the beginning, draw the tangent to the function , and mark the intersection with the x-axis as the next approximation to the root of the function, and repeat the whole process.
specific algorithm
= initial value;
...
theorem
Assuming that the function is a second-order continuous differentiable function, , if , then Newton’s method converges locally quadratically , and the error of the first step satisfies:
in,
features
Newton's method does not always converge quadratically, it converges linearly at multiple root locations, where the coefficient of linear convergence .
where m multiple roots are defined as:
If , but .
4. Secant method and its variants
The reason why the Newton method can achieve a faster iteration speed is because more information is used, especially the information of the tangent direction of the function obtained through the function derivative. But in some cases, it may be difficult to compute the derivative, in which case the secant method is a replacement for Newton's method, which uses the approximate secant instead of the tangent, and converges about as fast.
The specific process of secant method
= initial estimate
The difference quotient is used instead of the derivative, so the method requires two initial estimates.
The secant method has three generalized forms: trial position method, Muller method, and inverse quadratic difference method IQI.
Specific process of trial position method
Given a range such that
It can be seen that the main idea of the test position method is to continuously update the root-containing interval. It starts to perform better than the dichotomy method and the secant method, and has the best properties of the two, but it cannot guarantee that it can be eliminated at every step like the dichotomy method. 1/2 uncertainty.
Muller method and inverse quadratic difference method IQI
These two methods both use parabolas to replace straight lines (both require three initial estimates for parabolic interpolation). The difference is that the parabola used by the Muller method has multiple intersections with the x-axis, while the inverse quadratic difference method IQI The parabolic form adopted will only have one intersection point with the x-axis.
5. Brent method
The Brent method is a hybrid method. The original intention is to combine the guaranteed convergence properties of the bisection method with the fast convergence properties of more complex methods, and the Brent method does not require derivative calculations.