diff --git a/src/jat/examples/ThreeBodyExample/ThreeBodyAPL.java b/src/jat/examples/ThreeBodyExample/ThreeBodyAPL.java index f1d5d07..0cabaaa 100644 --- a/src/jat/examples/ThreeBodyExample/ThreeBodyAPL.java +++ b/src/jat/examples/ThreeBodyExample/ThreeBodyAPL.java @@ -18,7 +18,9 @@ public class ThreeBodyAPL extends ThreeBody implements FirstOrderDifferentialEqu public ArrayList ysol = new ArrayList(); public ArrayList zsol = new ArrayList(); protected double[] randv[]; + public ThreeBodyAPL(double G, double m1, double m2, double m3) { + //constructor super(G, m1, m2, m3); this.randv(); } @@ -65,13 +67,14 @@ public class ThreeBodyAPL extends ThreeBody implements FirstOrderDifferentialEqu } public StepHandler stepHandler = new StepHandler() { + //step handler for dp853 integrator public void init(double t0, double[] y0, double t) { } public void handleStep(StepInterpolator interpolator, boolean isLast) { double t = interpolator.getCurrentTime(); double[] y = interpolator.getInterpolatedState(); - System.out.println(t + " " + y[0] + " " + y[1]+ " " + y[2]); + System.out.println(t + " " + y[0] + " " + y[1]+ " " + y[2]); //prints time and xyz positions time.add(t); xsol.add(y[0]); ysol.add(y[1]); diff --git a/src/jat/examples/ThreeBodyExample/ThreeBodyExample.java b/src/jat/examples/ThreeBodyExample/ThreeBodyExample.java index e9243c8..b55c7e9 100644 --- a/src/jat/examples/ThreeBodyExample/ThreeBodyExample.java +++ b/src/jat/examples/ThreeBodyExample/ThreeBodyExample.java @@ -95,6 +95,7 @@ public class ThreeBodyExample { double[] max = { plotSize, plotSize }; p.setFixedBounds(min, max); + // test outputs // output derivatives for (int i = 0; i< derivs.length; i++)