MIT OpenCourseWare http://ocw.mit.edu 18.085 Computational Science and Engineering IFall 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.18.085: Matlab Homework #4 Differential Equations. Find the exact solution to d du --(.-) = f (x)dx dx where f (x) is a delta function at x = 112 and c = 1. The boundary conditions are u(0) = O and w(1) = 0 (0 5 x 5 1). Now investigate the solution numerically using MATLAB. Solve where A is the discrete approximation to the derivative operator. Look at TWO cases: (1)boundary conditions the same as above: (2) u(0) = u(1) = 0. Try these two cases where A comes from a "centered differ-ence" scheme: (") -ui-1 dx ,i 2Ax and with an "upu~indednscheme: Comment on the results in all four cases. Now add a perturbation to the original equation: where t is very small. Again, solve this numerically and compare with the solutions above. Does t appear to be a regular or a singular per-turbation'? Plot all of your results and compare them to the exact solution found above. (Try this for a few different values of '4' where !V is the number of grid
View Full Document