Slide 1Slide 2Slide 3Slide 4Slide 5Slide 61Integration and Differentiation2-22-20102Opening Discussion■What did we talk about last class?■Let's talk about the project for this class. What do you want to do?3Integration■Matlab has several functions for doing numerical integration.trapz uses the trapazoid rule on datacumtrapz also uses the trapazoid rule, but as a cumulative integral on dataquad and quadl do quadrature on a function (Simpson's rule with variable interval sizes.)■dblquad can be used to do 2-D integration on a function.■triplequad does 3-D integration of functions.4Differentiation■Numeric differentiation is something that is generally frowned upon. The reason is simply that difference methods are not well behaved, especially when dealing with noisy data from an experiment. If you have that type of data you should do some type of fitting and take a derivative of the fit.■Using polyfit and polyder is a good way of dealing with this type of data.■The diff function can be used for numerical derivatives. Manually doing a central difference is more accurate.5Gradients■Do you know what the meaning of a gradient is? Matlab has a built in function that will calculate a gradient for grid data.■The del2 function takes a numerical Laplacian. This measures the curvature and is basically a second order gradient.6Closing Comments■Quiz #3 is next class.■You have a week for assignment
View Full Document