Add logging for easier debugging later
Dump interpolation parameters so I can create a good unittest
This commit is contained in:
parent
5412f89419
commit
a2341f4c18
@ -18,7 +18,8 @@ import net.sf.openrocket.util.MathUtil;
|
|||||||
import net.sf.openrocket.util.PolyInterpolator;
|
import net.sf.openrocket.util.PolyInterpolator;
|
||||||
import net.sf.openrocket.util.Transformation;
|
import net.sf.openrocket.util.Transformation;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the aerodynamic properties of a <code>SymmetricComponent</code>.
|
* Calculates the aerodynamic properties of a <code>SymmetricComponent</code>.
|
||||||
@ -32,6 +33,8 @@ import net.sf.openrocket.util.Transformation;
|
|||||||
*/
|
*/
|
||||||
public class SymmetricComponentCalc extends RocketComponentCalc {
|
public class SymmetricComponentCalc extends RocketComponentCalc {
|
||||||
|
|
||||||
|
private final static Logger log = LoggerFactory.getLogger(SymmetricComponentCalc.class);
|
||||||
|
|
||||||
public static final double BODY_LIFT_K = 1.1;
|
public static final double BODY_LIFT_K = 1.1;
|
||||||
|
|
||||||
private final double length;
|
private final double length;
|
||||||
@ -376,6 +379,15 @@ public class SymmetricComponentCalc extends RocketComponentCalc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// dump transonic/supersonic knots, in a format easily imported into python
|
||||||
|
String vel = "vel = [ ";
|
||||||
|
String cd = "cd = [ ";
|
||||||
|
for (double m : interpolator.getXPoints()) {
|
||||||
|
vel = vel + m + ", ";
|
||||||
|
cd = cd + interpolator.getValue(m) + ", ";
|
||||||
|
}
|
||||||
|
log.debug(vel + "]");
|
||||||
|
log.debug(cd + "]");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now the transonic/supersonic region is ok. We still need to interpolate
|
* Now the transonic/supersonic region is ok. We still need to interpolate
|
||||||
@ -392,6 +404,9 @@ public class SymmetricComponentCalc extends RocketComponentCalc {
|
|||||||
double cdMach0 = 0.8 * pow2(sinphi);
|
double cdMach0 = 0.8 * pow2(sinphi);
|
||||||
double minDeriv = (interpolator.getValue(min + 0.01) - minValue) / 0.01;
|
double minDeriv = (interpolator.getValue(min + 0.01) - minValue) / 0.01;
|
||||||
|
|
||||||
|
log.debug("cdMach0 = " + cdMach0);
|
||||||
|
log.debug("minDeriv = " + minDeriv);
|
||||||
|
|
||||||
// These should not occur, but might cause havoc for the interpolation
|
// These should not occur, but might cause havoc for the interpolation
|
||||||
if ((cdMach0 >= minValue - 0.01) || (minDeriv <= 0.01)) {
|
if ((cdMach0 >= minValue - 0.01) || (minDeriv <= 0.01)) {
|
||||||
return;
|
return;
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user