{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ps2sol

# ps2sol - ACM 95/100c Problem Set 2 Solutions Lei Zhang Each...

This preview shows pages 1–4. Sign up to view the full content.

ACM 95/100c Problem Set 2 Solutions Lei Zhang April 10, 2006 Each Problem is worth 10 points. Each part of a multi-part problem is weighted equally. Problem 1 (Collaboration allowed) Consider the solution of the 1-D heat equation φ t = a 2 φ xx 0 < x < l with boundary conditions φ (0 , t ) = φ ( l, t ) = 0 and initial conditions φ ( x, 0) = 1 Solve this problem using a series solution obtained from separation of variables. Choose various numerical values for a 2 , x , l and decide how many terms are required to represent the solution at (a) t = 0, (b) t = 1, Solution 1 By the result from class notes, a series solution of the heat equation which satisfies the boundary condition u (0 , t ) = u ( l, t ) = 0 is u ( x, t ) = X n =1 u n sin( nπx/l ) exp( - a 2 n 2 π 2 t/l 2 ) (1) to satisfy the initial condition u ( x, 0) = 1, we need 1 = X n =1 u n sin( nπx/l ) (2) by orthogonality, u n = 2 l Z l 0 sin( nπx l ) dx (3) = 2(1 - ( - 1) n ) (4) i.e u ( x, t ) = X n =1 2(1 - ( - 1) n ) sin( nπx/l ) exp( - a 2 n 2 π 2 t/l 2 ) (5) 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
take a = 1, l = 1, choose the first 10 terms of series solution, we have the following results at t = 0 and t = 1 in Figure (1). Note that exact solution is red, and truncated series solution is blue, 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Solution at t = 0 Distance x u(x,0) exact solution series solution (a) t = 0 . 0 0.2 0.4 0.6 0.8 1 0 1 2 3 4 5 6 7 x 10 -5 Solution at t = 1 Distance x u(x,1) exact solution series solution (b) t = 1 . Figure 1: a = 1, l = 1, 10 terms. choose the first 100 terms, we have the following results at t = 0 and t = 1 in Figure (2), we can clearly see that at t = 0 the series converges nonuniformly, i.e. Gibbs phenomena. However, at t = 1, the series converges uniformly, from Figure (3) we can see even 2 terms is already a very good approximation. 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Solution at t = 0 Distance x u(x,0) exact solution series solution (a) t = 0 . 0 0.2 0.4 0.6 0.8 1 0 1 2 3 4 5 6 7 x 10 -5 Solution at t = 1 Distance x u(x,1) exact solution series solution (b) t = 1 . Figure 2: a = 1, l = 1, 100 terms. 2
now take a = 1, and different l = 1 and l = 5, we just choose first 2 terms. Compare the result at t = 1 in Figure (3), we find that with smaller l , the series converges faster. 0 1 2 3 4 5 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Solution at t = 1 Distance x u(x,1) exact solution series solution (a) l = 5 . 0 0.2 0.4 0.6 0.8 1 0 1 2 3 4 5 6 7 x 10 -5 Solution at t = 1 Distance x u(x,1) exact solution series solution (b) l = 1 . Figure 3: t = 1, a = 1, 2 terms. take different a = 0 . 1 and a = 1, with l = 1, we also choose first 2 terms. Compare the result at t = 1 in Figure (4), we find that with bigger a , the series converge faster. 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Solution at t = 1 Distance x u(x,1) exact solution series solution (a) a = 0 . 1 . 0 0.2 0.4 0.6 0.8 1 0 1 2 3 4 5 6 7 x 10 -5 Solution at t = 1 Distance x u(x,1) exact solution series solution (b) a = 1 . Figure 4: t = 1, l = 1, 2 terms Note: the convergence is in the limit of your computer’s floating point precision, since as l gets smaller or a gets bigger, the exponential decay term will be underflow very soon.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern