Why we use Mathematica / Wolfram Language for programming labs
This course could be taught in any language so the choice is largely
one of preference. You will be able to apply the knowledge you learn
in any language you choose to program in.
This course includes both sequence analysis and mathematical modeling
with Ordinary Differential Equations (ODEs). In the past I tried
having students program in Java for the sequence analysis part and
MatLab for the ODE part. Switching languages was a big pain with a lot
of cognitive overhead. Mathematica is convenient for both sequence
analysis and ODE modeling.
Mathematica has a wide range of functions developed consistently
within a single framework and set of interface conventions.
It covers all of mathematics, both symbolic and numerical. It is very
high level and has many useful features that you will discover
throughout the course.
It does not have the kinds of arbitrary names and ad hoc packages you
find in MatLab. For example, when I wrote a lab that required
numerical integration in MatLab, the function to integrate the ODEs
was called something like ODE47. There were a half dozen other
routines for doing similar things depending on the type of ODE system
you had. The documentation was complex and there was no
straightforward way to just try integrating the system without getting
into the details. In Mathematica, all those routines and more exist,
but you call them all by using the function Integrate, which can do
both numerical and symbolic integration of all types of systems.
Mathematica has a lot of "math artificial intelligence" built into it.
If you don't tell it how you want it to attack the problem, it will make
an educated guess. That gets you going quickly. If you find that it's
worth your while, you can later specify all kinds of options about
exactly how you want it done. But often that isn't necessary. When you
just trust Mathematica to get it right, 80% of the time that works
fine and you don't have to read all the details.
Another example is hypothesis testing to determine whether two
samples of numbers are drawn from populations with different
means. There are about ten commonly used tests for this, differing in
their distributional assumptions and statistical power. To do this in
Mathematica, you just use the function LocationTest, which runs all
the common tests, analyzes the assumptions behind them, and returns a
p-value from the most appropriate test. Or you can see the results
from all the tests and decide for yourself.
I like the mathematical generality of Mathematica, the elegant way in
which functionality is packaged into functions with highly intuitive,
fully spelled out names, the consistent interfaces, and the awesome
interactive graphics features.
When you program for your own research you can of course use any
language you like. There are good arguments to be made for R, which
has many academic freeware packages available, though they won't have
the kind of consistent interface, optimized implementation, and
detailed documentation that Mathematica functions have. But many of
you will probably come to love Mathematica so much that you choose to
write your own code in Mathematica and use programs or subroutines
written in other languages either by direct system calls and
file-based communications or through the built-in interlanguage links,
such as J/Link.