AdvancedAnalysis_1.gif > AdvancedAnalysis_2.gif

SIMULATIONTOOLS TUTORIAL AdvancedAnalysis_3.gif

Advanced Analysis

Once simulation data has been loaded into Mathematica as DataTable or DataRegion objects, the full power of Mathematica can be used.  The data can remain in discrete form, for example as a DataRegion, or it can be interpolated to provide a continuous function.  In the latter case, it can be used with functions like NDSolve, NIntegrate, FindRoot etc.  We now give some examples of more sophisticated data analysis that can be performed with simulation data.

Line Integral

The first example is to integrate the grid function phi along the line joining the two black holes in the example data.  (This has no physical significance; it’s just a demonstration.)

Load the data:

In[1]:=

AdvancedAnalysis_4.gif

Out[1]=

AdvancedAnalysis_5.gif

Plot the data:

In[2]:=

AdvancedAnalysis_6.gif

Out[2]=

Graphics:Binary Black Hole Conformal Factor (x > 0)

Construct a 2-dimensional interpolating function from the data:

In[3]:=

AdvancedAnalysis_8.gif

Out[3]=

AdvancedAnalysis_9.gif

The coordinate time of this data:

In[4]:=

AdvancedAnalysis_10.gif

Out[4]=

AdvancedAnalysis_11.gif

The coordinate positions of the black holes at this time:

In[5]:=

AdvancedAnalysis_12.gif

Out[5]=

AdvancedAnalysis_13.gif

In[6]:=

AdvancedAnalysis_14.gif

Out[6]=

AdvancedAnalysis_15.gif

The line joining the two can be expressed in parametric form

In[7]:=

AdvancedAnalysis_16.gif

Out[7]=

AdvancedAnalysis_17.gif

and used in ParametricPlot.  Mathematica plots can be combined using Show:

In[8]:=

AdvancedAnalysis_18.gif

Out[8]=

Graphics:Binary Black Hole Conformal Factor (x > 0)

We can now plot phi along this line:

In[9]:=

AdvancedAnalysis_20.gif

Out[9]=

AdvancedAnalysis_21.gif

Note that the @@ (Apply) is needed because the InterpolatingFunction phiFn takes two separate coordinate arguments, whereas bhLine is a list containing the two coordinates.

Finally, we can compute the integral along the line:

In[10]:=

AdvancedAnalysis_22.gif

Out[10]=

AdvancedAnalysis_23.gif

In[11]:=

AdvancedAnalysis_24.gif

Out[11]=

AdvancedAnalysis_25.gif

Surface Integral

We can compute surface integrals in a similar way.  First load a 3D data set:

In[12]:=

AdvancedAnalysis_26.gif

Out[12]=

AdvancedAnalysis_27.gif

In[13]:=

AdvancedAnalysis_28.gif

Out[13]=

AdvancedAnalysis_29.gif

Find the initial position of the first black hole:

In[14]:=

AdvancedAnalysis_30.gif

Out[14]=

AdvancedAnalysis_31.gif

Interpolate the 3D data:

In[15]:=

AdvancedAnalysis_32.gif

Out[15]=

AdvancedAnalysis_33.gif

Choose a surface of radius 2 centred on the black hole:

In[16]:=

AdvancedAnalysis_34.gif

Plot phi as a function of θ and φ:

In[17]:=

AdvancedAnalysis_35.gif

Out[17]=

AdvancedAnalysis_36.gif

Compute the surface integral:

In[18]:=

AdvancedAnalysis_37.gif

AdvancedAnalysis_38.gif

AdvancedAnalysis_39.gif

AdvancedAnalysis_40.gif

AdvancedAnalysis_41.gif

Out[18]=

AdvancedAnalysis_42.gif

(The warnings are a result of the poor convergence of the numerical integral on discretely-sampled data)

Spikey Created with Wolfram Mathematica 9.0