Information Technology Reference
In-Depth Information
time series analysis, image analysis, etc.) The graphical capabilities of Matlab are
also more convenient than those of Python, since Python graphics rely on external
packages that must be installed separately.
There is an interface pymat that allows Python programs to use Matlab as a com-
putational and graphics engine. Thus, we prefer to use Python as the programming
platform, calling up Matlab when needed.
6.5
Numerical Software Engineering
Numerical software engineering deals with methods for structuring a large piece of
numerical software such that it is easy to reuse and maintain the code. Software
engineering in general is a huge area of computer science. Many of the methods
developed in software engineering are, of course, useful for numerical software as
well, but numerical software has certain features that make special demands on soft-
ware engineering techniques. Contrary to most common non-numerical codes, one
often encounters huge data structures, very long execution times, parallel computa-
tions, and large amounts of computed numbers whose accuracy can be difficult to
verify. The codes can also be very large and complicated. It therefore makes sense
to use the term numerical software engineering for software engineering adapted to
the world of scientific computing.
6.5.1
Function Libraries
The classic way of organizing numerical codes is to implement algorithms as sub-
routines in Fortran and collect these subroutines in libraries. An application solving
a particular scientific computing problem would then define a set of arrays and other
variables and call the appropriate subroutines to get the job done.
The term subroutine is associated with Fortran. When using most other program-
ming languages one would probably refer to a function library.
Numerical Integration Library
Suppose you need to write a piece of code to integrate a function, say f.x/ D
x tanh x from 0 to 10, by a suitable numerical integration rule. Choosing the
trapezoidal rule as the method, the minimum amount of code would look like
n D 200
s D 0
x D 0
for i D 1;:::;n1
x x Ch
Search WWH ::




Custom Search