Mathematica in Theory and Practice

Conrad Wolfram

An increasingly technical world

Quantification

No question that the world is getting more technical...

Most fields follow this path of "quantification"...some hundreds of years ago, some in the last 15 eg. finance, biological sciences.

Consequences

Larger number need to be able to USE more maths...

More separation between required calculation and how to calculate.

Specialisation of technical skills

Optimisation, accuracy of models critical

More coordination and organization

Need a standard for communication between specialised disciplines

How can Mathematica technology help?

Some unique characteristics...

From conception: All-in-one technical computing

Significant to: quality of results, workday efficiency, coherence of a typical project, education and understanding

Functions represent TASKS not ALGORITHMS: intelligence applied for "automated" calculations

"Industrial strength" but made for education too

What's there, what's new?

First audience to see Mathematica 5.1...

Mathematica 5: Speed. Scope. Scalability. 5.1: "data functions release".

Aim here: give you a taste of what Mathematica can do.

Solving equations

The largest range of solving with a very small number of functions.

Algebraic and calculus

DSolve and piecewise functions

DSolve[Max[t, (t^2)] y[t]+y'[t]==UnitStep[t]&&y[0] == 1,y[t],t]

NDSolve and the event handler

Matching patterns

An easy way to program

log[a_ b_] :=  log[a] +  log[b]
\(log[a_\^n_] := n\ log\ a\)

But powerful...

Impedence[Resistor[r_], ω_] :=  r
Impedence[Capacitor[c_], ω_] :=  
      (1/(I ω c))
Impedence[
        Inductor[
          l_], ω_] :=  I ω l

    
Impedence[InSeries[e_], ω_] :=  
      Apply[Plus,  
        Map[Impedence[#, ω] &, e]]
Impedence[InParallel[e_], ω_] :=  
      1/Apply[Plus,  1/Map[Impedence[#, ω] &, e]]

Impedence[
      InSeries[{InParallel[{Inductor[l], Capacitor[c],  Resistor[r]}], 
          InParallel[{Resistor[2  r],  
              Capacitor[2  c]}]}], ω]

Plot[
      Abs[%  /.  {l -> 1,  r -> 1,  c -> 1}],  {ω, 
        0, 10}]

Now with strings...

StringReplace[dna, 
        p : ("a" ~~ x_ ~~ "a" ~~ x_) :> 
          ColorIt[p, Blue]] // ShowIt

Analysing data

Fitting

Just use FindFit...

({{\(Fitting\ an\ exponential\ decay\ model

              f(t) = \(e\^\(\(-a\)\ t\)\) \(sin(b\ t)\)\), Fitting  a special function model 
f(t)=a Ai(b+t)}, {, }, {Fitting  a  differential equation model
f'(x)=={({{10 - f(x),  x < p}, {-f(x), x ≥ p}}), Fitting a piecewise function 
f(t)={({{\(a | 
                            t | , \ \(\(|\)\(t\)\(|\)\(\(≤\)\(5\)\)\)\)}, {\(b, \ \(\(|\)\(t\)\(|\)\(\(≤\)\(5\)\(\ \)\)\)\)}})}, {, }})

Image Processing

photo = 
        Import["C:\\Documents and Settings\\conrad\\My Documents\\My \
Pictures\\Derivative for web, screen\\Grasshoper in Arizona.jpg"];

Show[photo]

datafromphoto  =  (photo  /.  
            Graphics[Raster[data_, __], __]  ->  
              data);
monodatafromphoto  =  
        Map[Mean,  datafromphoto,  {2}];

ListDensityPlot[monodatafromphoto]

edgedetected=ListConvolve[(({{1, 1, 1}, {1, -8, 1}, {1, 1, 1}})),monodatafromphoto];

ListDensityPlot[edgedetected]

Data formats

- Pasting TEX
- Over 50 formats including Excel, Binary, and specialised such as DICOM

Interfacing with your results

Notebooks

Active content

One source, multiple media

Standards compatibility: XML, MathML, HTML etc.

Typeset paper

Alternatives

Built using the GUIkit...just released.

EquationTrekker[{ x''[t]  +  γ x'[ t]  -  
            x[t]  +  x[t]^3  ==  ϵ Cos[ω t]}, 
      x,  {t, 0, 20}, PlotRange -> {{-2, 2}, {-3, 3}}, 
      TrekParameters -> {γ -> 
            Parameter[0.15],  ϵ -> 
            Parameter[0.3],  ω -> 
            Parameter[1,  {0, 2}]}]

Key capabilities...

Giganumerics

Automatic algorithm selection

Why is this so important?
- We estimate that Mathematica has more than xx algorithms
- NDSolve alone has more than xx
- If each user has to know which algorithm to use, they are very limited in scope...or they pick the wrong one
- Scope and reliability worse

Symbolics

Keeping accuracy and understanding as far as possible into calculation—now quite far.

History

Precomputer: mostly symbolic
Early computing: all numeric
Now: optimisation of the best of both worlds.

Precision control

Every day serious mistakes occur because computers get the wrong numerical result.

Typical problem

Iterate 11x - 2 with initial x=0.2 eg. in Excel

\(\(\(precisiontest[x_] := 11\ x - 2\)\(
\)
    \)\)
NestList[precisiontest, 0.2`30, 30]

Precision control example

Plot[
      (1/(1  +  a (x^3))) /.  a -> 1,  {x, -2, 2}]

Taking assigned input precision, providing justifiable output precision.

example  /.  {a -> 1`50, 
        x -> -1.000000000001`50}

Exact input with precribed output precision. Automatic internal precision increase to get desired output accuracy.

N[example  /.  {a -> 1,  
          x ->  -10000000000000000000000001/
              10000000000000000000000000}, 50]

Different Mathematica technology deployments

Mathematica itself

Add-on applications

webMathematica

gridMathematica

CalculationCenter

Calculus Wiz: concentrate on concepts not computations

Mathematical Explorer: Journey to the Frontiers of Mathematics

NKSx

Publicon—now released: XML/Technical Authoring made Easy

...Organisation-wide...

Licensing covers all Wolfram products in one...

"Mathematica site license" ⟶ "Wolfram product site license"

Changing the world with maths!

For education

Need to integrate computers fully in technical teaching. Open versus closed-ended.

What does maths consist of?

For professionals

Efficiency and insight from integrating workflow

Symbolics and numerical accuracy do matter.

Mathematica: the example of Mathematica based development