#include #include #include #include "Vector.hh" #include "Matrix.hh" #include "Solve.hh" #include "Clock.hh" #include "Random.hh" #include "PeriodicOrbit.hh" #include #include "lorenz.hh" #include "lorenz1.hh" #include "lorenz2.hh" #include "lorenz3.hh" #include "lorenz4.hh" #include "lorenz5.hh" #include static int NUMITNS; //leaves a long trajectory in out.dat //this is loaded using DATA/scr1.m //a snapshot is generated using DATA/scr2.m //a guess is generated and left in DATA/in.dat DATA/T.dat using DATA/scr3.m void LorenzA(){ Random rng(clock()); Solve ode1(lorenz, lorenzJ, 3, 128*10000, RK7); // double T = 150; Vector v(3); v(0) = rng.randn(); v(1) = rng.randn(); v(2) = rng.randn(); ode1.setStart(v, 1.0/128.0); ode1.advance(128*1000); ode1.getSolnAtT(1000.0, v); cout<<"x = "<>T; ifile.close(); cout<<"T = "<getm(), po->getn()); double wstep; int i; for(i=0; i < 10000; i++){ PO.smooth(); err = PO.relativeResidualError(); cout<<"RELATIVE ERROR: "<=1; n--){ err = findAmBn(m,n); if(err>1e-8) break; } } //saves distances between pos and the saddle at zero in DATA3 void Lorenz3f(){ char dir[200] = "DATA3/"; ofstream ofile("DATA3/DistFromZeroX.dat"); ofile.precision(20); ofile.setf(ios::scientific, ios::floatfield); int i; Vector zero(3); zero(0) = 0; zero(1) = 0; zero(2) = 0; for(i=2507; i <= 2524; i++){ Matrix *po; double T; double err; po = loadANDreturnOrbit(dir, i, T, err); double dist = returnMinDist(*po, zero); cout<getm(), po->getn()); double wstep; int i; for(i=0; i < 4000; i++){ PO.smooth(); err = PO.relativeResidualError(); cout<<"RELATIVE ERROR: "<0)?'A':'B'; } //generates orbits with random symbol sequences //saves in dir2/ with INDX //finds distance between po and po with one last symbol missing //saves data about distances in ofile void Lorenz5(){ char s[200]; int i; char dir1[100] = "DATA1/"; char dir2[100] = "DATA5/"; ofstream ofile("DATA5/SYMDIST.DAT"); loadOrbits(dir1, 1, 1375); Matrix *po; double T; double err; for(i=5; i <= 50; i++){ int LENGTH=i; int INDX=i; randomString(s, LENGTH); cout< 1e-10) dist = 100.0; else dist = returnMinDist(*po, *potwin); cout<<"Distance is: "< 0); sprintf(fname, "DATA6/pt%d.dat", indx); ofstream ofile(fname); sprintf(fname, "DATA6/N%d.dat", indx); ofstream ofilex(fname); ofilex<<"reciprocal of timestep is "< 27) && (v(1) < 0)){ ofile< 1e-10) trfile<<"error in po too high"<