Fix BasicTumbleStatus to initialize drag to non-zero.
computeTumbleDrag() is never called without this fix. The one-arg constructor is the only constructor ever used, to init this status based on the previous status, copying the tumble drag if it can. The first BasicTumbleStatus is constructed from an RK4 Status, so it's drag is not copied, but neither is the drag computed. From then on the 0 is copied from one BasicTumbleStatus to the next.
This commit is contained in:
parent
f5d09233e8
commit
7c72bc88b1
@ -18,19 +18,21 @@ public class BasicTumbleStatus extends SimulationStatus {
|
|||||||
// offset the indexes so finEff[1] is the coefficient for one fin from the table in techdoc.pdf
|
// offset the indexes so finEff[1] is the coefficient for one fin from the table in techdoc.pdf
|
||||||
private final static double[] finEff = { 0.0, 0.5, 1.0, 1.41, 1.81, 1.73, 1.90, 1.85 };
|
private final static double[] finEff = { 0.0, 0.5, 1.0, 1.41, 1.81, 1.73, 1.90, 1.85 };
|
||||||
|
|
||||||
private double drag;
|
private final double drag;
|
||||||
|
|
||||||
public BasicTumbleStatus(Configuration configuration,
|
public BasicTumbleStatus(Configuration configuration,
|
||||||
MotorInstanceConfiguration motorConfiguration,
|
MotorInstanceConfiguration motorConfiguration,
|
||||||
SimulationConditions simulationConditions) {
|
SimulationConditions simulationConditions) {
|
||||||
super(configuration, motorConfiguration, simulationConditions);
|
super(configuration, motorConfiguration, simulationConditions);
|
||||||
computeTumbleDrag();
|
this.drag = computeTumbleDrag();
|
||||||
}
|
}
|
||||||
|
|
||||||
public BasicTumbleStatus(SimulationStatus orig) {
|
public BasicTumbleStatus(SimulationStatus orig) {
|
||||||
super(orig);
|
super(orig);
|
||||||
if (orig instanceof BasicTumbleStatus) {
|
if (orig instanceof BasicTumbleStatus) {
|
||||||
this.drag = ((BasicTumbleStatus) orig).drag;
|
this.drag = ((BasicTumbleStatus) orig).drag;
|
||||||
|
} else {
|
||||||
|
this.drag = computeTumbleDrag();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +41,7 @@ public class BasicTumbleStatus extends SimulationStatus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void computeTumbleDrag() {
|
private double computeTumbleDrag() {
|
||||||
|
|
||||||
// Computed based on Sampo's experimentation as documented in the pdf.
|
// Computed based on Sampo's experimentation as documented in the pdf.
|
||||||
|
|
||||||
@ -69,6 +71,6 @@ public class BasicTumbleStatus extends SimulationStatus {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
drag = (cDFin * aFins + cDBt * aBt);
|
return (cDFin * aFins + cDBt * aBt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user