tailieunhanh - Elementary mathematical and computational tools for electrical and computer engineers using Matlab - Chapter 5

Root Solving and Optimization MethodsTrong chương này, trước tiên chúng ta tìm hiểu một số kỹ thuật số tiểu học và sử dụng các lệnh fsolve fzero từ thư viện MATLAB để có được những nguồn gốc thực sự (số không) của một chức năng tùy ý. Sau đó, chúng tôi thảo luận việc sử dụng của các gốc lệnh MATLAB cho việc tìm kiếm các nguồn gốc của một đa thức. Sau này, chúng ta xem xét phương pháp Mục Vàng và fmin và fmins MATLAB lệnh để tối ưu hóa (tìm kiếm những giá trị tối thiểu. | 5__ Root Solving and Optimization Methods In this chapter we first learn some elementary numerical techniques and the use of the fsolve and fzero commands from the MATLAB library to obtain the real roots or zeros of an arbitrary function. Then we discuss the use of the MATLAB command roots for finding all roots of a polynomial. Following this we consider the Golden Section method and the fmin and fmins MATLAB commands for optimizing finding the minimum or maximum value of a function over an interval. Our discussions pertain exclusively to problems with one and two variables input and do not include the important problem of optimization with constraints. Finding the Real Roots of a Function This section explores the different categories of techniques for finding the real roots zeros of an arbitrary function. We outline the required steps for computing the zeros using the graphical commands the numerical techniques known as the Direct Iterative and the Newton-Raphson methods and the built-in fsolve and fzero functions of MATLAB. Graphical Method In the graphical method we find the zeros of a single variable function by implementing the following steps 1. Plot the particular function over a suitable domain. 2. Identify the neighborhoods where the curve crosses the x-axis there may be more than one point and at each such point the following steps should be independently implemented. 3. Zoom in on the neighborhood of each intersection point by repeated application of the MATLAB axis or zoom commands. 2001 by CRC Press LLC 4. Use the crosshair of the ginput command to read the coordinates of the intersection. In problems where we desire to find the zeros of a function that depends on two input variables we follow conceptually the same steps above but use 3-D graphics. In-Class Exercises Pb. Find graphically the two points in the x-y plane where the two surfaces given below intersect z1 7 -yj 25 x2 y2 z2 4 - 2x - 4y Hint .