ParabolicPDE

scalation.dynamics.ParabolicPDE
class ParabolicPDE(k: Double, dt: Double, dx: Double, xm: Double, ic: FunctionS2S, bc: (Double, Double))

The `ParabolicPDE' class is used to solve parabolic partial differential equations like the Heat Equation. Let 'u(x, t)' = temperature of a rod at position '0 <= x <= xm' and time 't' > 0. Numerically solve the

Heat Equation: u_t = k * u_xx with initial conditions u(x, 0) = ic(x) boundary conditions (u(0, t), u(xm, t)) = bc

Value parameters

bc

the boundary conditions as a 2-tuple for end-points 0 and 'xm'

dt

delta 't'

dx

delta 'x'

ic

the initial conditions as a function of position 'x'

k

the thermal conductivity

xm

the length of the rod

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def solve(t: Double): VectorD

Solve for the temperature of the rod at time 't', returning the vector of temperatures representing the temperature profile of the rod over its length. This method uses an Explicit Finite Difference technique to solve the PDE.

Solve for the temperature of the rod at time 't', returning the vector of temperatures representing the temperature profile of the rod over its length. This method uses an Explicit Finite Difference technique to solve the PDE.

Value parameters

t

the time the solution is desired

Attributes

def solveCN(t: Double): VectorD

Solve for the temperature of the rod at time 't', returning the vector of temperatures representing the temperature profile of the rod over its length. This method uses the Implicit Crank-Nicolson technique to solve the PDE, which provides greater stability and accuracy. Implicit recurrence equation: -ru(i-1, j2) + 2.(1.+r)u(i, j2) - ru(i+1, j2) = ru(i-1, j1) + 2.(1.-r)u(i, j1) + ru(i+1, j1) This equation is solved simultaneously: solve for 'u' in 'mat * u = vec'

Solve for the temperature of the rod at time 't', returning the vector of temperatures representing the temperature profile of the rod over its length. This method uses the Implicit Crank-Nicolson technique to solve the PDE, which provides greater stability and accuracy. Implicit recurrence equation: -ru(i-1, j2) + 2.(1.+r)u(i, j2) - ru(i+1, j2) = ru(i-1, j1) + 2.(1.-r)u(i, j1) + ru(i+1, j1) This equation is solved simultaneously: solve for 'u' in 'mat * u = vec'

Value parameters

t

the time the solution is desired

Attributes

See also

people.sc.fsu.edu/~jpeterson/5-CrankNicolson.pdf