Re: Hamiltonian System with NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg87972] Re: Hamiltonian System with NDSolve
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Mon, 21 Apr 2008 06:38:39 -0400 (EDT)
- Organization: Uni Leipzig
- References: <fuhfhi$ira$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi, you need a symplectic method and NDSolve[] has implemente one as Method ->{"SymplecticPartitionedRungeKutta", ..} Regards Jens Grandpa wrote: > So I'm trying to solve the following Hamiltonian system using Mathematica. > > solution = NDSolve[{x'[t] == 2p[t], x[0] == 2, > p'[t] == I*(2 + 1/2)(I*x[t])^(1 + 1/2), p[0] == 1-2*I}, {x, p}, {t,0,10}, MaxSteps -> Infinity][[1]]; > > 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 >