Lab 9 involves Chapter 9 of Gilat­using Numerical Methods to approximate solutions.    g5c9p313x02 (fzero): We will use the "fzero" command (pp296­298) to solve an equation. 

advertisement
Lab 9 involves Chapter 9 of Gilat­using Numerical Methods to approximate solutions. g5c9p313x02 (fzero): We will use the "fzero" command (pp296­298) to solve an equation. Note that we should move all terms to one side and plot the resulting function first to determine starting guesses (or intervals) to find solutions. Note the different ways the function can be entered in the fzero command (illustrated on p297 example­I personally prefer defining as an anonymous function­pp231­233. Since they will be plotting, they should use element­by­element operations in the function!) g5c9p313x03: Same as above, but we should find all solutions (NOTE: If you try to find whether there is a solution between 0 and 1, please try finding it with MATLAB. In this case, it will give an error because there is no solution) g5c9p315x09 (fminbnd): We will use the "fminbnd" command (pp298­299) to find the minimum and maximum of a function (emphasize bottom of p299 for maxima). Note the different syntax if you want to find the LOCATION of the minimum (x­value) vs the actual minimum (y­value). g5c9p316x22 (quad): Experienced MATLAB users will recall that the help for the "quad" command states that it is being phased out. It has been saying this for 3 years now, so we will stick with the text (pp300­302) and use it. Derivatives may be done by hand. Also keep in mind that you have plotted a parametrized curve in Lab 5 (g5c5p166x13). g5c9p319x30 (ode45): First, the differential equation for exponential growth and decay y' = ky and that the solution to this is y = Ce^(kt). Differential equations are extremely practical in engineering, and most cannot be solved explicitly­the best that can be done is to numerically approximate the solutions (they will learn how this works in MATH 308). The steps for doing so in MATLAB are on pp303­307 and summarized here: 1) Make sure the problem is in the form dy/dx = f(x,y) 2) define a function (function file or anonymous) for f ("ODEfun") 3) We will stick with ode45 as the "solver_name" 4) follow the syntax on p305 (plotting example on p307) 
Download