       Hamiltonian System with NDSolve

• To: mathgroup at smc.vnet.net
• Subject: [mg87956] Hamiltonian System with NDSolve
• From: Grandpa <acloninger at wustl.edu>
• Date: Mon, 21 Apr 2008 03:25:50 -0400 (EDT)

```So I'm trying to solve the following Hamiltonian system using Mathematica.

solution = NDSolve[{x'[t] == 2p[t], x == 2,
p'[t] == I*(2 + 1/2)(I*x[t])^(1 + 1/2), p == 1-2*I},          {x, p}, {t,0,10}, MaxSteps -> Infinity][];

I'm letting E=1, so at all points t, it should be that
(p[t]/.solution)^2-(I*x[t]/.solution)^(2+1/2)=1.

That is the case until the function crosses a branch cut on the complex x-plane that runs from 0 to i*(Infinity).  Once the function crosses the branch cut, the system no longer preserves E and the value changes to something around 1.3.

How can I go about fixing this problem?  I've already tried working with the precision and accuracy goals, and that didn't work.  I'm not sure what else to consider.  Any help would be appreciated.

Thanks,
Alex

```

• Prev by Date: Re: Mathematica Player Pro!
• Next by Date: Re: Very Long Wait for the Kernel after Reboot
• Previous by thread: returning inverse Hessian from FindMinimum
• Next by thread: Re: Hamiltonian System with NDSolve