Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Với tham số đầu vào (x, y, N, xi) elseif cuối nargin == 3, xi = x; r = 1; % Với tham số đầu vào (x, y, N) kết thúc A (:, N + 1) = những người thân (M, 1), n = N: -1:1, A (:, n) = A (:, n +1) .* x;% Eq cuối (3.8.9) nếu chiều dài (r) == m m = 1: m, A, kết thúc ngày kết thúc% Eq | 198 NONLINEAR EQUATIONS Figure P4.1 Iterative method based on the fixed-point theorem. Noting that the first derivative of this iterative function ga x is g. x 3 X P4.1.4 determine which solution attracts this iteration and certify it in Fig. P4.1a. In addition run the MATLAB routine fixpt to perform the iteration P4.1.3 with the initial points x0 0 x0 2 and x0 3. What does the routine yield for each initial point b Now consider the following iterative formula Xk 1 gb xk 3 - - P4.1.5 Xk Noting that the first derivative of this iterative function gb x is 1 g b X - X2 P4.1.6 determine which solution attracts this iteration and certify it in Fig. P4.1b. In addition run the MATLAB routine fixpt to carry out the iteration P4.1.5 with the initial points x0 0.2 x0 1 and x0 3. What does the routine yield for each initial point cf This illustrates that the outcome of an algorithm may depend on the starting point. PROBLEMS 199 4.2 Bisection Method and Fixed-Point Iteration Consider the nonlinear equation treated in Example 4.2. f x tan n x x 0 P4.2.1 Two graphical solutions of this equation are depicted in Fig. P4.2 which can be obtained by typing the following statements into the MATLAB command window ezplot tan pi-x -pi 2 3 pi 2 hold on ezplot x 0 -pi 2 3 pi 2 a In order to use the bisection method for finding the solution between 1.5 and 3 Charley typed the statements shown below. Could he get the right solution If not explain him why he failed and suggest him how to make it. fp42 inline tan pi-x -x x TolX 1e-4 MaxIter 50 x bisct fp42 1.5 3 TolX MaxIter b In order to find some interval to which the bisection method is applicable Jessica used the MATLAB command find as shown below. x 0 0.5 pi y tan pi-x - x k find y 1 end-1 . y 2 end 0 x k x k 1 y k y k 1 ans 1.5000 2.0000 2.0000 2.5000 -15.6014 0.1850 0.1850 -1.7530 This shows that the sign of f x changes between x 1.5 and 2.0 and also between x 2.0 and 2.5. Noting this Jessica thought that she might use the bisection .