{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Complexified KAM curve (standard map)\n\n$k=0.9, \\nu=0.618034$\n\n[1]J. M. Greene and I. C. Percival, Hamiltonian Maps in the Complex Plane, Physica D: Nonlinear Phenomena 3, 530 (1981).\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nimport sys\nimport glob\n\n\nk = -0.9\ntwopi=2.0*np.pi\n\ndef Q(coeff, theta):\n res = np.copy(theta) + 0.j\n for i, m in enumerate(coeff[0]):\n res += -1.j*coeff[1][i]*np.exp(1.j*theta*m) + 1.j*coeff[1][i]*np.exp(-1.j*theta*m)\n return res\n\ndef P(coeff, theta):\n return Q(coeff, theta) - Q(coeff, theta + twopi*nu) - np.sin(Q(coeff, theta))*k/2\n\n\n\ndirname = \"nu_0.618034\"\nnu = float(dirname.split(\"_\")[1])\npath = dirname + \"/fourier_coeff_j21.dat\"\ncoeff = np.loadtxt(path).transpose()\n\nfig = plt.figure()\nax = fig.add_subplot(1,1,1,projection='3d')\nax.axis('off')\n\ntraj = np.loadtxt(dirname + \"/traj.DAT\").T\nymin,ymax = 3.5, 4.5\nindex = (traj[1]>ymin) & (traj[1]