Take the 2-minute tour ×
Physics Stack Exchange is a question and answer site for active researchers, academics and students of physics. It's 100% free, no registration required.

I have an Hamiltonian problem whose 2D phase space exhibit islands of stability (elliptic fixed points).

I can calculate the area of these islands in some cases, but for other cases I would like to use Mathematica (or anything else) to compute it numerically.

The phase space looks like that :

alt text

This is a contour plot make with Mathematica. Could anyone with some knowledge of Mathematica provide a way to achieve this ?

share|improve this question
    
Calculate the area or plot the graph? –  KennyTM Nov 3 '10 at 6:35
    
I did the plot, from the plot, or from the function I want to calculate the area. –  Cedric H. Nov 3 '10 at 7:01
2  
This actually seems like a computing question that happens to arise in a physical application, not really a physics question. Or is it just me? –  David Z Nov 3 '10 at 7:41
    
Asking here, maybe I'll find someone using Mathematica for physics, I don't think asking in SO is a better idea. –  Cedric H. Nov 3 '10 at 8:02
6  
I think this one is grey area, leaning towards computing rather than physics. But not voting to close because you attached a nice graph. Always like a good graph. –  Alasdair Allan Nov 3 '10 at 10:29
show 3 more comments

1 Answer 1

up vote 4 down vote accepted

There is rather nice function in Mathematica 7, which allows one to integrate over an arbitrary complicated region. It is Boole:[True,False]$\to${1,0}. Below is just an example taken from Mathematica Documentation Center. If you have a 2D area defined by the inequality $4 x^4-4 x^2+y^2\leq 0$,

alt text

you can integrate any function $f(x,y)$ over this domain as follows:

Integrate[f[x,y] Boole[y^2 - 4 x^2 + 4 x^4 <= 0], {x, -Infinity,Infinity}, 
{y, -Infinity,Infinity}]

For example, if $f(x,y)$ is unity then it gives you the total volume of the integration domain:

In[1]:= Integrate[Boole[y^2 - 4 x^2 + 4 x^4 <= 0], {x, -Infinity,Infinity}, 
{y, -Infinity,Infinity}]
Out[1]= 8/3

In fact, you can use any condition you want, including that is determining your islands of stability. Numerical integration is also possible:

In[1]:= NIntegrate[Boole[y^2 - 4 x^2 + 4 x^4 <= 0], {x, -Infinity,Infinity}, 
{y, -Infinity,Infinity}]
Out[1]= 2.66667
share|improve this answer
    
By the way, Mathematica is a grate tool widely used by physicists in various areas. I think it is worth to collect questions about it here (by using the new tag "Wolfram Mathematica", not just "Mathematica"). –  Grisha Kirilin Nov 12 '10 at 2:20
    
Thanks, it is not exactly what I was looking for but it might do the trick. About the tags: these two can be made synonyms. –  Cedric H. Nov 12 '10 at 11:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.