Method of Lines
The first step in constructing PDE is to drag the WorldModel
block in the diagram. The WorldModel block contains general
information about the problem, such as the number of grid points the
user wish to use to solve the problem. These information are then
"propagated" to all the blocks in the diagram that need them.
The heart of the Method of Lines Package are the integrator and
derivative blocks. Once the user know the problem it is easy to
implement it in Dymola. Typically the problem consists of a
PDE and initial and boundary conditions. The initial condition can
be passed to the IC input of the integrator block. For the
boundary conditions we must additionally specify some parameters in
the WorldModel block:
- bcl and bcr specify whether there is a boundary condition at
the left and at the right respectively (0: no, 1: yes).
- vb and ve specify the first and last unknown variable
respectively. The same applies to icb and ice, which specify the
first and last variable for which an initial condition must be
specified.
The information in the second point is redundant and could be
deduced from the first point. However, for better understanding and
use this choice was taken. In the WorldModel block the number
of grid points can be specified in the n parameter. Per
default n = 10. Let now turn our attention to the integrator
block. This block implements PDEs of the form
where u is the unknown function and R is the right
part of the equation that can contain space derivatives, constant
values and so on (See Examples). This means that if we do not have
the PDE in this form we must first convert it to this form before
passing it to the integrator. Once this step is achieved we can
build the right part of the equation and at the end pass it to the
R input of the integrator block.
Now say that one of the component of the right part of the equation
is a derivative of unknown function with respect to space. In this
case we can use the derivative blocks that the Package provide. For
example for the first-order space derivative use the u_x
block. It is important to note here that in the case of the boundary
condition of type
say at the left part of the domain, we must set the bcl
parameter in the corresponding block to -1 which tells that we are
in front of the symmetry boundary condition at the left part
of the domain. The same applies for the right part of the domain, in
which case we must set the parameter bcr to -1. Another
important point is the accuracy of the derivative computation. For
the computation of the first order space derivative for example, the
second, fourth and sixth order central difference approximations
were provided. The user can choose which one to use by specifying
the value of the u_x parameter in the WorldModel block.
Release Notes: