APPLIED NUMERICAL METHODS USING MATLAB phần 5

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 () 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 Iterative method based on the fixed-point theorem. Noting that the first derivative of this iterative function ga x is g. x 3 X determine which solution attracts this iteration and certify it in Fig. . In addition run the MATLAB routine fixpt to perform the iteration 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 - - Xk Noting that the first derivative of this iterative function gb x is 1 g b X - X2 determine which solution attracts this iteration and certify it in Fig. . In addition run the MATLAB routine fixpt to carry out the iteration with the initial points x0 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 Bisection Method and Fixed-Point Iteration Consider the nonlinear equation treated in Example . f x tan n x x 0 Two graphical solutions of this equation are depicted in Fig. 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 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 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 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 This shows that the sign of f x changes between x and and also between x and . Noting this Jessica thought that she might use the bisection .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.