Logo IMES

Center of MechanicsStephan Kaufmann
Home
Lectures / Courses
Vorlesungen / Kurse
Ingenieur-Tool I
Books
Bücher
Software for Education
Mathematica Resources
ZSK



 

Mathematica at the IfM

 

The computer program Mathematica is an ideal general-purpose tool for engineers. It integrates several features into a unified, interactive environment: numerical and symbolic calculations, functional, procedural, rule-based, and graphics programming, as well as animations. By using Mathematica notebooks, the research work can easily be documented. Furthermore, the well designed programming language makes it an efficient tool for the development of programs, which nontrivially use its specific strengths:

- manipulation of complicated symbolic expressions,

- graphics and animation,

- arbitrary precision numerical calculations.

Mathematica is widely used as a general-purpose tool in the daily research work at our institute. Some more specialized packages have been developed for subjects which specifically use the above-mentioned strengths of the program.

Two developments in the mid 1990ies involved the graphical postprocessing of multibody simulations and asymptotic expansions for the solutions of partial differential equations.

[Top]

A semester project by Markus Friedl shows the ease of Mathematica as a graphics programming language. The package uses the data resulting from the multibody simulation program "Dynamite" (written in Fortran) and generates different kinds of plots, as well as animations of the motion.

In[1]:=

Needs["DynamitePost`"]
In[2]:=
ext = "e_Beispielsystem";
In[3]:=
subdir = "Internal:Desktop Folder:Files:\
  Computer Algebra:Mma Files:Semas:Friedl:Example";
In[4]:=
body = {{{.5, .5}, {-.7, .2}, {-.7, -.2}, {.5, -.5}}};
In[5]:=
a = ReadData["Posvel", ext, subdir];
In[6]:=
FuncPlot[a, {1, 1}]
Out[6]=
-Graphics-
In[7]:=
Picture[ext, subdir, {1}, Polygons -> body, Color -> True]
         Berechnung des 1. Bildes
Out[7]=
-Graphics-
In[8]:=
PrepareAnimation[ext, subdir, Polygons -> body,
 Info -> False, CoordinateSystems -> False,
 TimeInfo -> True, Color -> True]
         Berechnung des 1. Bildes
         Berechnung des 2. Bildes
         Berechnung des 3. Bildes
         Berechnung des 4. Bildes
         Berechnung des 5. Bildes
         Berechnung des 6. Bildes
         Berechnung des 7. Bildes
         Berechnung des 8. Bildes
         Berechnung des 9. Bildes
         Berechnung des 10. Bildes
         Berechnung des 11. Bildes
         Berechnung des 12. Bildes
         Berechnung des 13. Bildes
         Berechnung des 14. Bildes
         Berechnung des 15. Bildes
         Berechnung des 16. Bildes
         Berechnung des 17. Bildes
         Berechnung des 18. Bildes
         Berechnung des 19. Bildes
         Berechnung des 20. Bildes
         Berechnung des 21. Bildes
Out[8]=
{{-Graphics-, -Graphics-, -Graphics-, -Graphics-, -Graphics-, -Graphics-, 
   -Graphics-, -Graphics-, -Graphics-, -Graphics-, -Graphics-, -Graphics-,
    -Graphics-, -Graphics-, -Graphics-, -Graphics-, -Graphics-, -Graphics-, 
   -Graphics-, -Graphics-, -Graphics-}, 
  {{-1.73692, 1.68658}, {-1.57067, 1.85283}}, {}}
In[9]:=
Motion[%]
Out[9]=

(double-click the icon to launch the QuickTime movie!)

{-Graphics-, -Graphics-, -Graphics-, -Graphics-, -Graphics-, -Graphics-,
   -Graphics-, -Graphics-, -Graphics-, -Graphics-, -Graphics-, -Graphics-, 
  -Graphics-, -Graphics-, -Graphics-, -Graphics-, -Graphics-, -Graphics-, 
  -Graphics-, -Graphics-, -Graphics-}

[Top]

The package SKPackages`PerturbationPDE` (developed as a semester project by Roger Breu) defines tools for perturbation expansions and the manipulation of partial differential equations in Mathematica. This session shows how a partial differential equation (together with boundary conditions) is defined. The unknown functions are then expanded as a power series in the small parameter "eps". The resulting equations (corresponding to the powers 0, 1, and 2 of "eps") are formatted in a nicely readable form, using an index notation. You may also have a look at the complete notebook in its HTML Version.

In[1]:=

Needs["SKPackagesPerturbationPDE`"]
In[2]:=
equ = {eps D[sigma[x][x,y],x] + 
        D[tau[x,y][x,y],y] == b D[u[x][x,y,t],{t,2}],
       eps D[sigma[y][x,y],y] + D[tau[x,y][x,y],x] ==
        b D[u[y][x,y,t],{t,2}],
       sigma[x][0,y] == 0, tau[x,y][x,g] == h};
In[3]:=
PolyOrderListPDE[equ,
  {sigma[x][x,y], sigma[y][x,y], tau[x,y][x,y]},
   eps, 2];
In[4]:=
IndexForm[%,
  AdditionalFunctions -> {u[x][x,y,t], u[y][x,y,t]}]
Out[4]//IndexForm=
     (0)                             (0)
tau        == b u               tau        == b u
   xy   ,y       x,tt              xy   ,x       y,tt
         (0)                  (0)
   sigma    [0,y] == 0   tau     [x,g] == h
        x                   xy
      (0)          (1)                (0)          (1)
sigma       + tau        == 0   sigma       + tau        == 0
     x   ,x      xy   ,y             y   ,y      xy   ,x
         (1)                  (1)
   sigma    [0,y] == 0   tau     [x,g] == 0
        x                   xy
      (1)          (2)                (1)          (2)
sigma       + tau        == 0   sigma       + tau        == 0
     x   ,x      xy   ,y             y   ,y      xy   ,x
         (2)                  (2)
   sigma    [0,y] == 0   tau     [x,g] == 0
        x                   xy

[Top]

[Top]


24-Feb-2012 | Stephan Kaufmann | ZfM | ETH