def test_eccentric_anomaly_solver(self): self.assertEqual(0.0,solve.solve_for_eccentric_anomaly(0,0)) self.assertEqual(1.0885977582695519,solve.solve_for_eccentric_anomaly(1,0.1)) self.assertEqual(1.8620866869674508,solve.solve_for_eccentric_anomaly(1,0.9))
#!/usr/bin/python import solve ecc=0.65 N=2000 M=200 x=[] y=[] for n in range(0,N): x.append(n*1.0/M) y.append(solve.solve_for_eccentric_anomaly((n*1.0/M),ecc)) fh=open('anomaly.gnuplot','w') for n in range(N): fh.write(str(x[n])) fh.write(" ") fh.write(str(y[n])) fh.write("\n") fh.close()