//Jimmy Corno //April 29, 2004 //Relaxing loop program for periodic orbits in constant flow. class RosslerDescent{ static int m = 100; //Number of segments in the guess loop. static int n = 10; //Number of points per segment static double[][] guessLoop = new double[m][3]; static double[][] delta = new double[m][3]; static double[][] L = new double[m][3]; static double[][] Lhat = new double[m][3]; static double[] magL = new double[m]; static double[][][] pos = new double[m][n+1][3]; static double[][][] vel = new double[m][n+1][3]; static double[][] COS = new double[m][n+1]; static double[][] magV = new double[m][n+1]; static double[] F2 = new double[m]; static double F2new, F2old; static double c = 2.5; static double[] Gamma = new double[m]; static int q = 0; static double bunchingTolerance = 3.0; public static void main( String[] Args ) { //gamma is the modifier for the descent; smaller gamma decreases step //size double gamma = 0.5; //q is the number of steps //this for loop lays out the guess loop for(int i=0; i 0.05) && (q<100000)); //distance from the origin to a point on the loop; should be 1 for //correct loop /* double r = Math.sqrt(guessLoop[2][0]*guessLoop[2][0] + guessLoop[2][1]*guessLoop[2][1]); System.out.println(q + "," + r); */ //prints guess loop points to screen for( int i=0; i bunchingTolerance ){ unkink(i); } } } //same as loopSegments, but this one is for specific segments. public static void loopSegments( int i) { int k = (i+m-1)%m; L[i][0] = guessLoop[(i+1)%m][0] - guessLoop[i][0]; L[i][1] = guessLoop[(i+1)%m][1] - guessLoop[i][1]; L[i][2] = guessLoop[(i+1)%m][2] - guessLoop[i][2]; magL[i] = Math.sqrt( L[i][0]*L[i][0] + L[i][1]*L[i][1] + L[i][2]*L[i][2] ); Lhat[i][0] = L[i][0] / magL[i]; Lhat[i][1] = L[i][1] / magL[i]; Lhat[i][2] = L[i][2] / magL[i]; L[k][0] = guessLoop[(k+1)%m][0] - guessLoop[k][0]; L[k][1] = guessLoop[(k+1)%m][1] - guessLoop[k][1]; L[k][2] = guessLoop[(k+1)%m][2] - guessLoop[k][2]; magL[k] = Math.sqrt( L[k][0]*L[k][0] + L[k][1]*L[k][1] + L[k][2]*L[k][2] ); Lhat[k][0] = L[k][0] / magL[k]; Lhat[k][1] = L[k][1] / magL[k]; Lhat[k][2] = L[k][2] / magL[k]; } //loopPoints determines the position, flow velocity, and cosine between //flow velocity and loop velocity for the integration points. public static void loopPoints() { for( int i=0; i