MATLAB

profilealdennim
matlab.zip

TGTS-021504172925-1.pdf

Project 5 MAT 362 Due Friday April 17th

The goal of this project is to apply several methods to approximate solutions to the Heat Equation in one space dimension:

ut = c2uxx, t > 0, x ∈ (0, 1), u(t, 0) = 0 = u(t, 1), u(0, x) = f(x).

First test each algorithm with f(x) = sin πx, then with a few other initial temper- atures requiring infinite Fourier Sine series to solve exactly.

(1) Code and test the Explicit method. Experimentally find the maximum value of α = c2∆t

(∆x)2 for stability. (2) Code and test the Implicit method. Experimentally observe that the method

is unconditionally stable. (3) Code and test the Crank-Nicolson method. Experimentally observe that

the method is unconditionally stable. (4) Using V and D appropriately filled with orthonormal eigenvectors and

eigenvalues of −D2, compute approximate solution via general solution for- mula and numerical integration for Fourier Sine series. There are several ways to do this, with various advantages and disadvantages. One method would be:

u = V ∗ (E . ∧ t) ∗ a,

where E = diag(exp(−c2 ∗ diag(D))) and a = (V ′ ∗ f(x̂s)/n). (5) Code and test the Method of Lines, first using Euler’s method, and then

using Runga-Kutta. Determine experimentally if the methods are condi- tionally or unconditionally stable.

Note: These methods can easily be simultaneously implemented in a single time- step loop, making for easy comparison between results and the known exact solution. Keep in mind that conditionally stable methods can only be used for small alpha, whereas you can and should use larger α when running your unconditionally stable codes.

Final Project Ideas: Repeat some or all of the above for ut = ∆u on the unit square (0, 1)2. The system can be defined using sparse, block matrices. The exact solution can be computed using two space dimensional Fourier Sine series. There are many more extensions: different boundary conditions, convection term, sources or sinks, different regions (tough), and so on.

__MACOSX/._TGTS-021504172925-1.pdf

TGTS-021504172925-2.pdf

Project Guidelines

• Report should have a title and the authors’ names. • Provide a brief intro stating the problem(s), algorithms, techniques, and relevant

theory. • Include notation, statement of important, relevant theorems and definitions. Some

Mathematics! • Put your name somewhere in the file names of Matlab codes that you upload. • Code should be at least slightly documented; author(s), algorithm name,

assignment number/due date, and key code blocks. • If minor modifications are all that is needed for one code to serve multiple

purposes, just submit one code with brief instructions. • Summarize data using graphics and tables. Analyze data. Make conclusions!

Where possible, compare approximations to actual solutions in convincing ways. • Don’t be excessive or highly redundant in your data inclusion. • Give at least some caption or label to all graphics and tables. • Be honest in citing your sources, what you understand versus what you are not so

sure about, actual results versus expected results, etc. A concluding section might be a good place to say these things.

__MACOSX/._TGTS-021504172925-2.pdf