
- •Затверджено
- •Contents Contents
- •The purpose and the contents of laboratory works
- •Laboratory work №1 Solution of Nonlinear Equations by the Bisection method and Chord method
- •1.1 Purpose of the work
- •1.2 Tasks for laboratory work
- •1.3 The basic theoretical knowledge
- •1.3.1 Bisection method
- •Figure 1.1 – Bisection method
- •Chord method
- •Figure 1.4 – Chord method
- •1.3.3 Matlab function fzero and roots
- •1.4 Individual tasks
- •1.5 Control questions
- •Laboratory work №2 Solution of Nonlinear Equations by the newton method and simple iteratIvE method
- •Figure 2.1 – Newton method
- •Figire 2.2 - Dependence of the number of iterations on the accuracy of methods for the bisection (upper line) and the Newton method (bottom line)
- •2.3.2 The method of simple iteration
- •A sufficient condition for the convergence of the iterative process
- •Individual tasks
- •Laboratory work №3 Solution system of Linear Algebraic Equations
- •3.3.1 Direct methods
- •Inverse matrix:
- •3.3.2 Iterative methods
- •Condition number of a
- •3.4 Individual tasks
- •3.5 Control questions
- •Laboratory work №4
- •Visualization of 3d data in matlab
- •Plot3(X, y, z, 'style')
- •4.3.2 Instructions: meshgrid, plot3, meshc, surfc
- •4.3.3 Instructions: sphere, plot3, mesh
- •4.3.4 The simple animation in 3d
- •1. Working with a sphere
- •4.3.5 Summary of 3d Graphics
- •Individual tasks
- •Laboratory work №5 Solving systems of nonlinear equations
- •5.1 Purpose of the work
- •5.2 Tasks for laboratory work
- •5.3 The basic theoretical knowledge
- •5.3.1 Newton method to solve systems of non-linear equations
- •5.3.2 Matlab function for Newton method for a system of nonlinear equations
- •5.3.3 The matlab routine function fsolve
- •Input Arguments
- •Individual tasks
- •5.5 Control questions
- •List of the literature
- •Appendix a.
- •Individual tasks to Lab number 1, 2
- •Appendex b. The task for self-examination to Lab number 1, 2
1.4 Individual tasks
Variants of the tasks are presented in the Appendix A (p.77).
Found a roots of the given equations if accuracy is less than = 10-4. Use:
a) Bisection method;
b) Chord method;
Locate one of the roots with several relative errors. Compare the amount of calculations using these methods for different errors.
Along with the "manual" solution provide solutions obtained by standard means of MatLab (functions fzero and root).
1.5 Control questions
Stages of the decision of the nonlinear equations.
Cut-and-try method. Illustrate on the graph. Merits and demerits of a method.
The method of hords. Illustrate on the graph. Merits and demerits of a method.
The method of simple iteration. Illustrate on the graph. Merits and demerits of a method.
The method of tangents (Newton’s method). Illustrate on the graph. Merits and demerits of a method.
Solving Nonlinear Equation in MATLAB –functions roots and fzero.
Laboratory work №2 Solution of Nonlinear Equations by the newton method and simple iteratIvE method
2.1 Purpose of the work
This laboratory work helps students a)study of Newton and Simple Iterative methods for solving nonlinear equations; b) the use of MATLAB for solving nonlinear equations.
2.2 Tasks for laboratory work
To study the iterative methods(Newton and Chord) for solving nonlinear equations
Make a programs-functions to find the root of the Newton and Simple Iteration methods.
To carry out the individual task.
Save results of the work (the programs, listing of calculation) at your personal files.
Draw up report.
2.3 The basic theoretical knowledge
2.3.1 The method of tangent(Newton)
Consider the Taylor-series expansion of the function f(x) about a value x = xo:
f(x)= f(xo)+f'(xo)(x-xo)+(f"(xo)/2!)(x-xo)2+….
Using only the first two terms of the expansion, a first approximation to the root of the equation
f(x) = 0
can be obtained from
f(x) = 0 ≈ f(xo)+f'(xo)(x1 -xo)
Such approximation is given by,
x1 = xo - f(xo)/f'(xo).
The Newton method consists in obtaining improved values of the approximate root through the recurrent application of equation above. For example, the second and third approximations to that root will be given by
x2 = x1 - f(x1)/f'(x1),
and
x3= x2 - f(x2)/f'(x2),
respectively.
This iterative procedure can be generalized by writing the following equation, where i represents the iteration number:
xi+1 = xi - f(xi)/f'(xi).
After each iteration the program should check to see if the convergence condition, namely,
|f(x i+1)|<ε
or
|xi+1 – x i| ≤ ε,
is satisfied.
The figure below(picture 2.1) illustrates the way in which the solution is found by using the Newton method. Notice that the equation
f(x) = 0 ≈ f(xo)+f'(xo)(x1 -xo)
represents a straight line tangent to the curve y = f(x) at x = xo. This line intersects the x-axis (i.e., y =f(x) = 0) at the point xi as given by xi = xo - f(xo)/f'(xo). At that point we can construct another straight line tangent to y = f(x) whose intersection with the x-axis is the new approximation to the root of f(x) = 0, namely, x = x2. Proceeding with the iteration we can see that the intersection of consecutive tangent lines with the x-axis approaches the actual root relatively fast.
The Newton method converges relatively fast for most functions regardless of the initial value chosen. The main disadvantage is that you need to know not only the function f(x), but also its derivative, f'(x), in order to achieve a solution.