78 
scheme is based 
scheme is based 
79 
on the Taylor expansion of $T$ at time $t^{(n)}$: 
on the Taylor expansion of $T$ at time $t^{(n)}$: 
80 
\begin{equation} 
\begin{equation} 
81 
T^{(n1)}\approx T^{(n)}+T\hackscore{,t}^{(n)}(t^{(n1)}t^{(n)}) 
T^{(n)}\approx T^{(n1)}+T\hackscore{,t}^{(n)}(t^{(n)}t^{(n1)}) 
82 
=T^{(n1)}  h \cdot T\hackscore{,t}^{(n)} 
=T^{(n1)} + h \cdot T\hackscore{,t}^{(n)} 
83 
\label{DIFFUSION TEMP EQ 6} 
\label{DIFFUSION TEMP EQ 6} 
84 
\end{equation} 
\end{equation} 
85 
This is inserted into \eqn{DIFFUSION TEMP EQ 1}. By separating the terms at 
This is inserted into \eqn{DIFFUSION TEMP EQ 1}. By separating the terms at 
159 
$\delta\hackscore{ij}$ is the Kronecker symbol \index{Kronecker symbol} defined by $\delta\hackscore{ij}=1$ for 
$\delta\hackscore{ij}$ is the Kronecker symbol \index{Kronecker symbol} defined by $\delta\hackscore{ij}=1$ for 
160 
$i=j$ and $0$ otherwise. Undefined coefficients are assumed to be not present\footnote{There is a difference 
$i=j$ and $0$ otherwise. Undefined coefficients are assumed to be not present\footnote{There is a difference 
161 
in \escript of being not present and set to zero. As not present coefficients are not processed, 
in \escript of being not present and set to zero. As not present coefficients are not processed, 
162 
it is more efficient to leave a coefficient undefined insted assigning zero to it.} 
it is more efficient to leave a coefficient undefined instead of assigning zero to it.} 
163 


164 
Defining and solving the Helmholtz equation is very easy now: 
Defining and solving the Helmholtz equation is very easy now: 
165 
\begin{python} 
\begin{python} 
177 
returning the Kronecker symbol. 
returning the Kronecker symbol. 
178 


179 
The coefficients can set by several calls of \method{setValue} where the order can be chosen arbitrarily. 
The coefficients can set by several calls of \method{setValue} where the order can be chosen arbitrarily. 
180 
If a value is assigned to a coefficint several times, the last assigned value is used when 
If a value is assigned to a coefficient several times, the last assigned value is used when 
181 
the solution is calculated: 
the solution is calculated: 
182 
\begin{python} 
\begin{python} 
183 
mypde=LinearPDE(mydomain) 
mypde=LinearPDE(mydomain) 
245 
\end{python} 
\end{python} 
246 
The script is similar to the script \file{poisson.py} dicussed in \Chap{FirstSteps}. 
The script is similar to the script \file{poisson.py} dicussed in \Chap{FirstSteps}. 
247 
\code{mydomain.getNormal()} returns the outer normal field on the surface of the domain. The function \function{Lsup} 
\code{mydomain.getNormal()} returns the outer normal field on the surface of the domain. The function \function{Lsup} 
248 
imported by the \code{from esys.escript import *} statement and returns the maximum absulute value of its argument. 
imported by the \code{from esys.escript import *} statement and returns the maximum absolute value of its argument. 
249 
The error shown by the print statement should be in the order of $10^{7}$. As piecewise bilinear interpolation is 
The error shown by the print statement should be in the order of $10^{7}$. As piecewise bilinear interpolation is 
250 
used by \finley approximate the solution and our solution is a linear function of the spatial coordinates one might 
used by \finley approximate the solution and our solution is a linear function of the spatial coordinates one might 
251 
expect that the error would be zero or in the order of machine precision (typically $\approx 10^{15}$). 
expect that the error would be zero or in the order of machine precision (typically $\approx 10^{15}$). 
283 
in an area defined as a circle of radius \var{r} and center \var{xc} and zero outside this circle. 
in an area defined as a circle of radius \var{r} and center \var{xc} and zero outside this circle. 
284 
\var{q0} is a fixed constant. The following script defines \var{q} as desired: 
\var{q0} is a fixed constant. The following script defines \var{q} as desired: 
285 
\begin{python} 
\begin{python} 
286 
from esys.escript import length 
from esys.escript import length,whereNegative 
287 
xc=[0.02,0.002] 
xc=[0.02,0.002] 
288 
r=0.001 
r=0.001 
289 
x=mydomain.getX() 
x=mydomain.getX() 