13.07.2015 Views

CHEN 2450 - HOMEWORK 2

CHEN 2450 - HOMEWORK 2

CHEN 2450 - HOMEWORK 2

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Problem 1 (10 pts)This problem should be done by hand (show your work) and submitted as a report. You can either typeset thesein your favorite word processing application or write them neatly and scan them as a PDF.1. (2 pts) Define ∆x and x i in terms of i, n and L. Hint: carefully study Figure 1.1 2 n-1 nΔxx=0 x=LFigure 1: Schematic of domain. Circles indicate points where we solve for T.2. (8 pts) Define the system of equations for n = 4 and then solve that using the Thomas algorithm.Problem 2 (20 pts)For this problem, you should submit a report (as a separate PDF file) that contains a discussion of the results youfind, along with plots. Be sure to also submit your MATLAB file(s) that solve this problem. Note that it will be wellworth your time to create a function to implement the Thomas algorithm (and test it against your hand-calculationin problem 1 as well as the example in the class notes).1. (14 pts) Solve this system for n = 20 and n = 40 using the Thomas algorithm and Matlab. Plot the twosolutions for T(x), along with the analytic solution given by (2) on the same plot. Comment on what youobserve, and try to explain the behavior of the n = 20 line. Hint: you may want to plot S(x) to help you seewhat is going on here.2. (6 pts) Plot the L 2 norm of the error, ɛ =∥∥T − T analytic ∥ ∥∥2, as a function of the number of points in the solutionover the range n = [10, 3 × 10 5 ] on a log-log plot. You should see three distinct regions in the plot, with oneregion that is linear (on the log-log plot). What explanation can you provide for the three regions observed?Hints:• Consider the various kinds of error that we have discussed. Your results from part 1 may also help youanswer part of this question.)• The “norm” is a measure of a vector. The L 2 norm of a vector ⃗u of length n is given as‖⃗u‖ 2=( n∑u 2 ii=1) 1/2This is the generalization of a vector magnitude that you learned in physics to vectors of any length.Note that in Matlab you can∥ calculate this using the norm command. For this problem you will need to∥calculate ɛ = ∥T − T analytic ∥∥2for each solution (value for n) and then save that so you can plot ɛ as afunction of n.2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!