Share this document with a friend

36

Transcript

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Partial Differential Equations II

CS 205A:Mathematical Methods for Robotics, Vision, and Graphics

Justin Solomon

CS 205A: Mathematical Methods Partial Differential Equations II 1 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Almost Done!

I Homework 7: 12/2 (two days late!)

I Homework 8: 12/9 (optional)

I Section: 12/6 (final review)

I Final exam: 12/12, 12:15pm (Gates B03)

Go to office hours!

CS 205A: Mathematical Methods Partial Differential Equations II 2 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Course Reviews

On Axess!Additional comments: [email protected]

CS 205A: Mathematical Methods Partial Differential Equations II 3 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Request for Help

CS 205A notesyour help!7−−−−−−−→ Textbook

I Review text

I Write reference implementations

I Solidify your CS205A knowledge

CS 205A: Mathematical Methods Partial Differential Equations II 4 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Final Exam

I CumulativeI Similar format to midterm

I Two sheets of notes

CS 205A: Mathematical Methods Partial Differential Equations II 5 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

This Week

Couple relationships between derivatives.

I Pressure gradient determining fluid flow

I Image operators using x and y derivatives

Partial Differential Equations (PDE)

CS 205A: Mathematical Methods Partial Differential Equations II 6 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Boundary Value Problems

I Dirichlet conditions: Value of f(~x) on ∂Ω

I Neumann conditions: Derivatives of f(~x) on ∂Ω

I Mixed or Robin conditions: Combination

CS 205A: Mathematical Methods Partial Differential Equations II 7 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Second-Order Model Equation

∑ij

aij∂f

∂xi∂xj+∑i

bi∂f

∂xi+ cf = 0

(∇>A∇ +∇ ·~b + c)f = 0

CS 205A: Mathematical Methods Partial Differential Equations II 8 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Classification of Second-Order PDE

(∇>A∇+∇ ·~b+ c)f = 0

I If A is positive or negative definite, system is elliptic.

I If A is positive or negative semidefinite, the systemis parabolic.

I If A has only one eigenvalue of different sign fromthe rest, the system is hyperbolic.

I If A satisfies none of the criteria, the system isultrahyperbolic.

CS 205A: Mathematical Methods Partial Differential Equations II 9 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Derivative Operator Matrix

h2 ~w = L1~y

−2 11 −2 1

1 −2 1. . . . . . . . .

1 −2 11 −2

Dirichlet

CS 205A: Mathematical Methods Partial Differential Equations II 10 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

What About First Derivative?

I Potential for asymmetry at boundary

I Centered differences: Fencepost problem

I Possible resolution: Imitate leapfrog

CS 205A: Mathematical Methods Partial Differential Equations II 11 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Fencepost Problem

CS 205A: Mathematical Methods Partial Differential Equations II 12 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Big Idea

Derivatives : Functions :: Matrices : Vectors

CS 205A: Mathematical Methods Partial Differential Equations II 13 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Elliptic PDE

Lf = g 7−→ L~y = ~b

Example: Laplace’s equation on a line

CS 205A: Mathematical Methods Partial Differential Equations II 14 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Elliptic PDE

Lf = g 7−→ L~y = ~bExample: Laplace’s equation on a line

CS 205A: Mathematical Methods Partial Differential Equations II 14 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Common Theme

Elliptic PDE 7→ Positive definite matrix

L = −D>D,D =

1−1 1−1 1

. . . . . .−1 1−1

Review: Name two ways to solve.

CS 205A: Mathematical Methods Partial Differential Equations II 15 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Common Theme

Elliptic PDE 7→ Positive definite matrix

L = −D>D,D =

1−1 1−1 1

. . . . . .−1 1−1

Review: Name two ways to solve.

CS 205A: Mathematical Methods Partial Differential Equations II 15 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Common Theme

Elliptic PDE 7→ Positive definite matrix

L = −D>D,D =

1−1 1−1 1

. . . . . .−1 1−1

Review: Name two ways to solve.

CS 205A: Mathematical Methods Partial Differential Equations II 15 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Time Dependence

Choice:

1. Treat t separate from ~x (“semidiscrete”)

2. Treat all variables democratically

(“fully discrete”)

CS 205A: Mathematical Methods Partial Differential Equations II 16 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Semidiscrete Heat Equation

ft = fxx

7−→ ft = Lf

Stability for elliptic spatialoperator (parabolic PDE)

CS 205A: Mathematical Methods Partial Differential Equations II 17 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Semidiscrete Heat Equation

ft = fxx 7−→ ft = Lf

Stability for elliptic spatialoperator (parabolic PDE)

CS 205A: Mathematical Methods Partial Differential Equations II 17 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Semidiscrete Heat Equation

ft = fxx 7−→ ft = Lf

Stability for elliptic spatialoperator (parabolic PDE)

CS 205A: Mathematical Methods Partial Differential Equations II 17 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Semidiscrete Time Stepping

Left with a multivariable ODE problem!

I Forward/backward Euler, RK, and friends

I Implicit vs. explicit (vs. symplectic)

I Alternative: Eigenvector methods

(low-frequency approximation)

CS 205A: Mathematical Methods Partial Differential Equations II 18 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Semidiscrete Time Stepping

Left with a multivariable ODE problem!

I Forward/backward Euler, RK, and friends

I Implicit vs. explicit (vs. symplectic)

I Alternative: Eigenvector methods

(low-frequency approximation)

CS 205A: Mathematical Methods Partial Differential Equations II 18 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Semidiscrete Time Stepping

Left with a multivariable ODE problem!

I Forward/backward Euler, RK, and friends

I Implicit vs. explicit (vs. symplectic)

I Alternative: Eigenvector methods

(low-frequency approximation)

CS 205A: Mathematical Methods Partial Differential Equations II 18 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Fully Discrete PDE

I Discretize ~x and t simultaneously

I Can create larger linear algebra problems

I Philosophical point: What is “fully” discrete?

CS 205A: Mathematical Methods Partial Differential Equations II 19 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Gradient Domain Inpainting

http://groups.csail.mit.edu/graphics/classes/CompPhoto06/html/lecturenotes/10_Gradient.pdf

CS 205A: Mathematical Methods Partial Differential Equations II 20 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Gradient Domain

Pipeline for image I(x, y):

1. Compute gradient: ~v(x, y) = ∇I(x, y)

2. Edit: ~v 7→ ~v′

3. Reconstruct: ∇g ?= ~v′

CS 205A: Mathematical Methods Partial Differential Equations II 21 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Gradient Domain Reconstruction

ming

∫Ω

‖∇g − ~v′‖22 dA

7→ ∇2g = ∇ · ~v′Elliptic!

CS 205A: Mathematical Methods Partial Differential Equations II 22 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Gradient Domain Reconstruction

ming

∫Ω

‖∇g − ~v′‖22 dA

7→ ∇2g = ∇ · ~v′Elliptic!

CS 205A: Mathematical Methods Partial Differential Equations II 22 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Incompressible Navier-Stokes

ρ

(∂~v

∂t+ ~v · ∇~v

)= −∇p+ µ∇2~v + ~f

I t ∈ [0,∞): Time

I ~v(t) : Ω→ R3: Velocity

I ρ(t) : Ω→ R: Density

I p(t) : Ω→ R: Pressure

I ~f(t) : Ω→ R3: External forces (e.g. gravity)

CS 205A: Mathematical Methods Partial Differential Equations II 23 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Lagrangian vs. Eulerian

I Lagrangian: Track parcels of fluid

I Eulerian: Fluid flows past a point in space

CS 205A: Mathematical Methods Partial Differential Equations II 24 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Marker-and-Cell (MAC) Grid

http://students.cs.tamu.edu/hrg/image/MAC.bmp

CS 205A: Mathematical Methods Partial Differential Equations II 25 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Splitting for Incompressible Flow

∇ · ~u = 0 (divergence-free)

ρt + ~u · ∇ρ = 0 (density advection)

~ut + ~u · ∇~u +∇pρ

= ~g (velocity advection)

http://www.stanford.edu/class/cs205b/lectures/lecture17.pdf

CS 205A: Mathematical Methods Partial Differential Equations II 26 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Steps for Flow (on board)

1. Adjust ∆t

2. Advect velocity

3. Apply forces

4. Solve for pressure: ∇ · ∇pρ = ∇ · ~u;

divergence-free projection

5. Advect density

http://www.proxyarch.com/util/techpapers/papers/Fluidflowfortherestofus.pdf

CS 205A: Mathematical Methods Partial Differential Equations II 27 / 28

Reminders Review Numerical PDEs Gradient Domain Inpainting Fluids

Semilagrangian Advection

ecmwf.int/newsevents/training/rcourse_notes/NUMERICAL_METHODS/NUMERICAL_METHODS/Numerical_methods6.html

Next

CS 205A: Mathematical Methods Partial Differential Equations II 28 / 28

Recommended