12 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
13 


14 
\section{Why \esc?} 
\section{Why \esc?} 
15 
\esc is a scripting environment for mathematical modeling based on the partial 
\esc is a scripting environment for mathematical modelling based on partial 
16 
differential equations (PDEs). It provides a highlevel of abstraction from the 
differential equations (PDEs). It provides a highlevel of abstraction from the 
17 
underlying numerical schemes and their implementations. By freeing the user from 
underlying numerical schemes and their implementations. By freeing the user from 
18 
considerations like data constructs, meshing and parallelisation, the user can 
considerations like data constructs, meshing and parallelisation, the user can 
20 
the powerful mathematical capabilities of PDEs. 
the powerful mathematical capabilities of PDEs. 
21 


22 
\esc is built upon the interpreted programming language \pyt\footnote{see 
\esc is built upon the interpreted programming language \pyt\footnote{see 
23 
\url{www.python.org}}; a scripting language with many intrinsic functions and 
\url{www.python.org}}, a scripting language with many intrinsic functions and 
24 
capabilities. Additionally, there are also a large number of software packages 
capabilities. Additionally, there are also a large number of software packages 
25 
for \pyt which can be used in conjunction with \esc. These packages include 
for \pyt which can be used in conjunction with \esc. These packages include 
26 
functions and data constructs for linear algebra, statistics, visualisation, 
functions and data constructs for linear algebra, statistics, visualisation, 
32 
with no modifications to the scripts. 
with no modifications to the scripts. 
33 


34 
There are many benefits for using a software platform like \esc for projects 
There are many benefits for using a software platform like \esc for projects 
35 
that involve mathematical modelling. Building on the top of an existing 
that involve mathematical modelling. Building on top of an existing environment 
36 
environment such as \esc is in many cases much simpler and more cost effective 
such as \esc is in many cases much simpler and more cost effective than 
37 
than building an original implementation from the ground up. A modelling 
building an original implementation from the ground up. A modelling environment 
38 
environment needs data structures and solution algorithms which take time to 
needs data structures and solution algorithms which take time to develop and 
39 
develop and test properly, \esc has already covered these aspects and its 
test properly, \esc has already covered these aspects and its implementation 
40 
implementation has been widely tested for bugs. Although existing environments 
has been widely tested for bugs. Although existing environments may not provide 
41 
may not provide the user with the fastest algorithms for their problems, it is 
the user with the fastest algorithms for their problems, it is generally the 
42 
generally the case, that the overall time needed to identify, implement and test 
case, that the overall time needed to identify, implement and test the optimal 
43 
the optimal algorithm will exceed the time needed to implement and solve the 
algorithm will exceed the time needed to implement and solve the problem with 
44 
problem with predeveloped and tested software. This is particularly true if a 
predeveloped and tested software. This is particularly true if a simulation 
45 
simulation does not need to be executed repetitively, or has relatively short 
does not need to be executed repetitively, or has relatively short lifetime. 
46 
lifetime. A model for a publication or thesis would be one such instance. 
A model for a publication or thesis would be one such instance. 
47 


48 
When it comes to solving partial differential equations, \esc is ideal, as it is 
When it comes to solving partial differential equations, \esc is ideal as it is 
49 
especially designed for this task. Other implementations are merely an addon to 
especially designed for this task. Other implementations are merely an addon to 
50 
a linear algebra focused system (\textit{e.g.} MATLAB). The \esc approach gives 
a linear algebra focused system (\textit{e.g.} MATLAB). The \esc approach gives 
51 
the user a cleaner environment to work with and provides better efficiency when 
the user a cleaner environment to work with and provides better efficiency when 
52 
dealing with PDE coefficients. Data structures in \esc allow the user to 
dealing with PDE coefficients. Data structures in \esc allow the user to 
53 
abstract away details such as data types of these coefficients. For example; if 
abstract away details such as data types of these coefficients. For example, if 
54 
a model has been tested with a constant PDE coefficient, then the unchanged 
a model has been tested with a constant PDE coefficient then the unchanged 
55 
script can be run with variable coefficients from a database or as a function of 
script can be run with variable coefficients from a database or as a function of 
56 
a dependent variable. This capability of \esc is possible because \esc uses the 
a dependent variable. This capability of \esc is possible because \esc uses the 
57 
language of PDEs (as opposed to linear algebra) to describe a model. As it turns 
language of PDEs (as opposed to linear algebra) to describe a model. As it turns 
61 
At the same time, this arrangement also allows for the implementation of complex 
At the same time, this arrangement also allows for the implementation of complex 
62 
model coupling on a higherlevel. 
model coupling on a higherlevel. 
63 


64 
The use of \pyt as the platform for \esc makes the development of models simple 
The use of \pyt as the platform for \esc makes the development of models simple 
65 
from a user prospective, as \pyt is intuitive and easy to learn. This simplicity 
from a user perspective, as \pyt is intuitive and easy to learn. This simplicity 
66 
does not hamper experienced users either as \pyt also provides access to a very 
does not hamper experienced users either as \pyt also provides access to a very 
67 
large number of tools. This makes it an attractive environment to work in. Best 
large number of tools. This makes it an attractive environment to work in. Best 
68 
of all, \esc is released under an open software license and is freely available 
of all, \esc is released under an open software license and is freely available 
72 
This manual is written with the intention of giving new users a practical 
This manual is written with the intention of giving new users a practical 
73 
introduction to \esc. It demonstrates how to solve a variety of problems from 
introduction to \esc. It demonstrates how to solve a variety of problems from 
74 
simple to advanced. We recommend that new users work through the 
simple to advanced. We recommend that new users work through the 
75 
the \textit{first few sets of examples} in Chapters \ref{CHAP HEAT DIFF}, 
\textit{first few sets of examples} in Chapters \ref{CHAP HEAT DIFF}, 
76 
\ref{CHAP HEAT 2a} and \ref{CHAP HEAT 2}). 
\ref{CHAP HEAT 2a} and \ref{CHAP HEAT 2}). 
77 
These chapters contain the necessary basic knowledge, and explain some of the 
These chapters contain the necessary basic knowledge, and explain some of the 
78 
common aspects and modules of \esc. The simple examples demonstrate how to 
common aspects and modules of \esc. The simple examples demonstrate how to 
79 
create, solve and visualise PDE based models. 
create, solve and visualise PDE based models. 
80 
Future chapters (as they are added to this tutorial) will cover more advanced 
Future chapters (as they are added to this tutorial) will cover more advanced 
81 
topics with more complex models and methods. Further examples are available in 
topics with more complex models and methods. Further examples are available in 
82 
the \esc user guide. 
the \esc user guide. 
88 
problems. 
problems. 
89 


90 
% All of the examples in this cookbook have been developed on a Linux based 
% All of the examples in this cookbook have been developed on a Linux based 
91 
operating system. 
% operating system. 
92 
% Unfortunately Windows and Mac support cannot be guaranteed. However, in most 
% Unfortunately Windows and Mac support cannot be guaranteed. However, in most 
93 
cases minor modifications to the scripts will generally solve any problems. 
% cases minor modifications to the scripts will generally solve any problems. 
94 


95 
\input{quickstart} 
\input{quickstart} 
96 
\input{escpybas} 
\input{escpybas} 