User Tools

Site Tools


gibson:teaching:spring-2014:iam950:hw1

**This is an old revision of the document!** ----

A PCRE internal error occured. This might be caused by a faulty plugin

====== IAM 950 HW1 ====== **Problem 1.** Write numerical simulation for the heat eqn $u_t = \nu u_{xx}$ on a periodic domain $[-L_x/2, L_x/2]$ using Fourier spatial discretization and Crank-Nicolson temporal discretization. Verify that your code works correctly by simulating the Gaussian-decay solution <latex> u(x,t) = (4 \pi \nu t)^{-1/2} e^{-x^2/4\nu t} </latex> from t = 1 to 100 for parameters $\nu = 2$, Lx=100, dt=1/16, Nx=128 (number of x gridpoints). Initialize your numerical code with u(x,1) and then compare the results of the numerical time integration with u(x,t) evaluated from the above formula. I suggest plotting both quantities versus x at regular intervals in time during the simulation, using "pause" (matlab) to stop the simulation temporarily. Make a plot of the numerical solution and the Gaussian solution versus x at t=100 to turn in. Are the two entirely consistent? If not, why not? **Problem 2.** Copy and revise your heat equation code so that it simulated the 1d Swift-Hohenberg equation, $u_t = (r-1) u - 2 u_{xx} - u_{xxxx} - u^3$ on a periodic domain $[0,L_x]$ using Fourier spatial discretization and Crank-Nicolson/Adams-Bashforth semi-implicit temporal discretization. Use the initial condition $u(x,0) = \cos(ax) + 0.1 \cos(2ax)$ where $a=2\pi/L_x$, parameter values r = 0.2, Lx = 100, Nx = 256 (number of x gridpoints), dt = 1/16, and integrate from t=0 to 100. Make a colorplot of $u(x,t)$ in the $x,t$ plane (using every x gridpoint but plotting t at a larger interval than dt, perhaps at intervals of 1/2 or 1. It should look something like this {{:gibson:teaching:spring-2014:iam950:sh.png?direct&400|Simulations of Swift-Hohenberg eqn}} When you are satisfied with the correctness of your simulation, make a plot of $u(x,100)$ versus x for the above parameters and initial conditions to turn in. Now play around with the forcing parameter in the range 0 < r < 1 and the initial condition, by changing the wavelengths and magnitudes of the the cosines, and possibly the total integration time, if you don't see patterns develop by t=100. Answer the following questions - Does the wavelength of the final pattern depend on r or the initial condition? - Does the wavelength of the final pattern match you expectation from linear analysis? - Can you relate the amplitude of the final pattern or the time scale of its growth from the initial condition to the Swift-Hohenberg equation? **Problem 3.** Copy and revise your Swift-Hohenberg code so that it simulates the 1d Kuramoto-Sivashinsky equation, $u_t = - u_{xx} - u_{xxxx}- u u_x$, with parameters Lx = 100, Nx = 512, and dt = 1/16, initial condition $u(x,0) = \cos(ax) + 0.1 \cos(2ax)$ (same as before), and integrate from t=0 to t=100. Make a colorplot of $u(x,t)$ as before. It should look like this {{:gibson:teaching:spring-2014:iam950:ks.png?direct&400|Kuramoto-Sivashinsky simulation}} Make a plot of $u(x,100)$ versus x to turn in. Now play around with the domain size Lx (adjusting Nx so that Lx/Nx is approximately constant), try replacing the initial condition with random numbers of order 0.01, and answer the following questions - Does the wavelength of the final pattern depend on r or the initial condition? - Does the wavelength of the final pattern match you expectation from linear analysis? - What qualitative changes in behavior do you observe as L increases from small (L=1) to large (L=100)? **Problem 4.** For each of the above codes, fix the initial condition and parameters, and run the simulation with dt = 1/8, 1/4, .... What happens? Why? **Note on Matlab ordering of FFT:**

gibson/teaching/spring-2014/iam950/hw1.1393513818.txt.gz · Last modified: 2014/02/27 07:10 by gibson