Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Commit e5b5d07

Browse files
Merge pull request #343 from kimlaberinto/fix_heat_example_readme_uanalytic
Fix missing formula (u_analytic) in Heat Eq. example in README
2 parents f5589cb + b0cbdc3 commit e5b5d07

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ sol = solve(prob,Tsit5(),saveat=0.1)
7070
```julia
7171
using DiffEqOperators, OrdinaryDiffEq
7272

73+
# # Heat Equation
74+
# This example demonstrates how to combine `OrdinaryDiffEq` with `DiffEqOperators` to solve a time-dependent PDE.
75+
# We consider the heat equation on the unit interval, with Dirichlet boundary conditions:
76+
# ∂ₜu = Δu
77+
# u(x=0,t) = a
78+
# u(x=1,t) = b
79+
# u(x, t=0) = u₀(x)
80+
#
81+
# For `a = b = 0` and `u₀(x) = sin(2πx)` a solution is given by:
82+
u_analytic(x, t) = sin(2*π*x) * exp(-t*(2*π)^2)
83+
7384
nknots = 100
7485
h = 1.0/(nknots+1)
7586
knots = range(h, step=h, length=nknots)

0 commit comments

Comments
 (0)