Вы находитесь на странице: 1из 1

Winter 2011 AMATH 741 / CM 750 / CS 778: Take Home Exam Due Monday 18 April at 5:00 p.m. in MC 6074.

Instructor: M. Waite

Instructions Remember to write your solutions clearly, show your work, and explain any assumptions you make. Illustrate your results with plots where possible. Submit a hard copy of your code, with comments, along with your solutions. Also upload your m-les using the drop box on UW-ACE. There are 2 questions and a total of 30 marks. This is an exam, not an assignment. You may consult any of the course materials and recommended texts. However, you may not discuss these problems with anyone but me. Evidence of collaboration on any of these problems will be treated very seriously in accordance with university policy on academic misconduct. You can solve all of these problems using only the lecture material. If you use something from a book that was not also presented in class, you must cite your source. [20] 1. Consider the equation ut + uux + uxxx = 0. A nice property of this PDE is that is possesses nonlinear traveling wave solutions of the form u(x, t) = a sech2 x ct , (2) (1)

where a is the wave amplitude, c = a/3 is the wave speed, and = 12/a is the wave length scale. Note that increasing the wave amplitude leads to faster and narrower waves. (a) Use the method of frozen coecients to perform a Von Neumann stability analysis of (1) discretized with the pseudo-spectral method and fourth order Runge-Kutta (RK4) time dierencing. (See the handout on time stepping schemes.) You may use the fact that RK4, when applied to ut = iu for R, is stable for || t 2.82. Express your result as an inequality involving t, x, and U , where U is the maximum value of u in the solution. Discuss. (b) Write a Matlab program to solve (1) on the domain [0, 2]. Assume periodic boundary conditions, and use the pseudo-spectral method with RK4 time dierencing. Discretize the nonlinear term by approximating the x-derivative of u2 /2. Initialize a wave of the form (2) with a = 1875 centred at x = 1. Use m = 256 and choose t to be as large as possible. Run your code for a long time at least 15,000 timesteps. How well does your simulation resemble (2)? (c) The stability condition you derived in (a) is quite restrictive why? Maybe time splitting can help. Use RK4 for the nonlinear term and an implicit scheme for the uxxx term. Try Backward Euler and Crank-Nicholson for the implicit scheme, and repeat the simulation from (b) with both. How large you can make t? How does the choice of implicit scheme aect your solution? (d) Modify your code from (b) to implement the Galerkin spectral method, and repeat the simulation from (b). How is your solution aected? What happens at larger a, say a = 7000? Discuss. [10] (2) Design and implement a nite element method to solve the diusion equation for u(x, t) on 0 < x < 1: ut = uxx , u(0) = 1, u(1) = 0.

This is a time-dependent problem; however, if you follow the approach from class, you should be able to derive a system of ODEs for the cj , which now depend on time. Use piecewise quadratic basis functions, and Forward Euler to approximate the time derivative. Experiment on a uniform grid with various , x and t to deduce the stability criterion for this method. Once you know how large you can make t, run your code with m = 128, = 0.001 and u(0, t) = sech(200x 100). Plot your solution at t = 1.