Next: , Previous: , Up: Solving problems   [Contents][Index]

3.3.5 Heat equation

The support for solving time-dependent problems is incorporated in the solution strategy using solve, but only rudimentary. More precisely, you will have to specify the number of levels for spatial refinement and several parameters specifying how many time-steps of which length are done. For example, the following code solves a one-dimensional heat equation with zero right-hand side and some initial values:

  (solve (blackboard
          :problem (cdr-model-problem
                    1 :initial #'(lambda (x) #I(sin(2*pi*x[0]^^2))))
          :start-time 0.0 :time-step 0.01
          :number-of-time-steps 20 :number-of-levels 6
          :plot t :output 1)))

First, the mesh is built up to approximate the initial values until given criteria are met (here the number of levels is prescribed). Then a time-stepping scheme with the BDF2 method and uniform time-steps is used to approximate the solution in time.