Notes 21 25
Notes 21 25
Notes 21 25
SOME DEFINITIONS 21
It must be emphasized that these numbers are typical, but unreliable. The machine may
have been performing different background tasks. Also, one could use optimizing Fortran
compilers to improve Fortran execution time. The main reason for the fast execution of the
Fortran program is that it was compiled prior to execution, whereas the MATLAB program,
using a so-called interpreted language was not. All things equal, compiled languages are typ-
ically much faster than interpreted languages. However, in most cases, interpreted languages
have been designed to be more user-friendly. Note that it is possible to use compiled versions
of MATLAB to improve its execution time significantly.
• Central Processing Unit (CPU) is, in colloquial terms, the main brain of the computer.
• One of the more important memory devices is Random Access Memory (RAM). This
memory is usually transient in that it is only active when the machine is turned on.
It is not used for permanent storage of files. Permanent storage is achieved via hard
drives, memory sticks, etc.
• A terminal is a device which allows direct input and output communications between
a user and the CPU of a machine. Terminals come in many flavors, including virtual.
• Software is an imprecise term which describes programs which allow interaction be-
tween the user and the computer. High level software is often more user-friendly and
has several layers of abstraction between the user and CPU. Low level software has
fewer levels of abstraction, is often more difficult to understand, but often tightly linked
to the CPU architecture. Microsoft Excel is a high level software tool. MATLAB is
somewhat lower level, but still at a high level. Fortran is at a lower level still, but in
many ways a high level language. So called assembly language is much closer to the
machine, and is certainly a low level software tool.
• A compiler, such as ifort, is a tool to convert a high level language such as Fortran
into a fast executable binary low level language usable by the machine. Use of com-
piled languages is highly advantageous for large scale problems in scientific computing
because of the speed of execution. For small scale problems, non-compiled interpreted
languages, such as MATLAB, are advantageous because of their relative simplicity of use.
• A text editor allows the user to alter the source code. Text editors typically refer to
tools which give the user access to the entire ASCII (American Standard Code for
Information Interchange) text of the file and avoid use of hidden and/or binary text.
• If there is more than one curve, be sure the reader knows which curve corresponds to
which case. There are a variety of ways to achieve this. The best is probably to use
combinations of solid lines, dashed lines, dotted lines, etc. Different lines can also be
assigned different colors, but one should recognize that sometimes the user will print
files with black and white printers, obscuring the meaning. Also, some colors are hard
to discern on varieties of computer screens and printers.
• Generally, reserve point markers like small circles or dots for cases where
Often it is best not to “connect the dots” especially if there is no reason to believe that
another data point, if sampled, would lie exactly on the interpolating curve.
• Generally, reserve smooth curves with no small circles or dots for cases where
• Use linear, log-linear, and log-log scaled plots as appropriate for the data at hand.
Sometimes linear scales hide the true nature of the data, and sometimes they reveal it.
The same can be said for log-linear and log-log scales. Be sure to examine your data,
and choose the most revelatory scaling.
x y
0 1
2 4
3 8
4 7
7 10
10 19
MATLAB defaults typically produce faulty plots. The following MATLAB script is an example:
x = [0,1,3,4,7,10];
y = [2,4,8,7,10,19];
plot(x,y)
This script generates the plot of Fig. 1.2. Figure 1.2 has the following problems:
20
18
16
14
12
10
2
0 1 2 3 4 5 6 7 8 9 10
• The numbers on the axes are much smaller than the font size of the surrounding text.
This problem is pervasive when MATLAB default values are used.
• The axes are not labeled.
• The raw data should be indicated with distinct points. Though optional, it is probably
best not to connect them.
25
20
15
y
10
0
0 2 4 6 8 10 12
x