Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added comments
  • Loading branch information
jic13003 committed Dec 7, 2015
1 parent cdf88d4 commit 8b46a14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/jat/examples/ThreeBodyExample/ThreeBodyAPL.java
Expand Up @@ -18,7 +18,9 @@ public class ThreeBodyAPL extends ThreeBody implements FirstOrderDifferentialEqu
public ArrayList<Double> ysol = new ArrayList<Double>();
public ArrayList<Double> zsol = new ArrayList<Double>();
protected double[] randv[];

public ThreeBodyAPL(double G, double m1, double m2, double m3) {
//constructor
super(G, m1, m2, m3);
this.randv();
}
Expand Down Expand Up @@ -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]);
Expand Down
1 change: 1 addition & 0 deletions src/jat/examples/ThreeBodyExample/ThreeBodyExample.java
Expand Up @@ -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++)
Expand Down

0 comments on commit 8b46a14

Please sign in to comment.