{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ChBE521_PDE_notes_hw7

# ChBE521_PDE_notes_hw7 - Partial Differential Equations(cont...

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

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

View Full Document

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.

Unformatted text preview: Partial Differential Equations (cont.) ChBE 521 Applied Mathematics November 19, 2008 Time dependence Last time, recall that we solved the one-dimensional steady-state problem (Poisson equation), Lu = f, where L = d 2 dx 2 , using both finite differences and collocation. Although this is not a PDE by definition (no time depen- dence), we’ve demonstrated that we can discretize space and obtain a numerical approximation to the solution by linearizing the spatial operator into a matrix equation. That is, we’ve gone from Lu = d 2 u dx 2 = f ⇒ Au = f, where (given that the 1-D domain is discretized into an N-point grid), A is an N × N matrix and u and f are N × 1 vectors. We can now use this as the framework to solve the time-dependent problem. 1 Going back to the original PDE for diffusion ∂u ∂t = D ∂ 2 u ∂x 2 , we recognize that spatial operator L = D ∂ 2 ∂x 2 on the right hand side of the equation can be linearized into matrix form as in the previous problem, as long as we can discretize the domain. So again, using the finite difference method (FDM), we can convert the problem to ∂u ∂t = D ∂ 2 u ∂x 2 = Lu ⇒ ∂u ∂t = Au, where the latter is a matrix equation ˙ u = Au. ( A is N × N and u is N × 1.) We can solve this problem either by solving u ( t ) = u (0)exp( At ) , using the matrix exponential, or by the various numerical methods (explicit Euler, implicit Euler, Runge-Kutta, etc...) we’ve discussed to solve ODEs. MATLAB has an extensive library of functions for solving ODEs. For most situations, the following built-in ODE solvers are useful/sufficient. • ode15s: stiff, 1st-5th order implicit, low to medium accuracy. • ode23s: nonstiff, 2nd/3rd order explicit Runge-Kutta-Fehlberg, low accuracy (but may be more stable than ode15s), • ode45: nonstiff, 4th/5th order explicit Runge-Kutta-Fehlberg, medium accuracy. Time stepping can also be implemented manually, which we will discuss later. Boundary conditions Let us now demonstrate how to implement various boundary conditions to a numerical PDE solution using the 1-D diffusion example, ∂u ∂t = D ∂ 2 u ∂x 2 . Dirichlet BCs (Fixed Boundary Condition) e.g. u (0) = u , u (1) = u. Given a domain discretized by N = 5 nodes, we know that nodes 1 and 5 represent boundary nodes, while 2-4 are the interior nodes. From the boundary conditions we have u 1 = u and u 5 = u . Given these are fixed in value, we know ˙ u 1 = ˙ u 5 = 0. Thus it suffices to determine the evolution of the interior node values. For the interior nodes, we know the spatial operator D ∂ 2 u ∂x 2 can be numerically represented using finite differences. Nothing is different in the interior, so ˙ u 2 = D Δ 2 ( u 1- 2 u 2 + u 3 ) , ˙ u 3 = D Δ 2 ( u 2- 2 u 3 + u 4 ) , ˙ u 4 = D Δ 2 ( u 3- 2 u 4 + u 5 ) ....
View Full Document

{[ snackBarMessage ]}

### Page1 / 11

ChBE521_PDE_notes_hw7 - Partial Differential Equations(cont...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online