X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fnet%2Fsf%2Fopenrocket%2Faerodynamics%2FBarrowmanCalculator.java;fp=src%2Fnet%2Fsf%2Fopenrocket%2Faerodynamics%2FBarrowmanCalculator.java;h=10da9f4639e375a9a3d624e1c638b8554a73e0b3;hb=b3c3c1071dfdca4c6b3eb9935dc461201abdaf60;hp=8ace04ac73b913df1f7cbbcc24784e73751ee5c9;hpb=fa61335265b0af5f9bc8800df953d41cde2d75f6;p=debian%2Fopenrocket diff --git a/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java b/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java index 8ace04ac..10da9f46 100644 --- a/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java +++ b/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java @@ -13,7 +13,6 @@ import net.sf.openrocket.aerodynamics.barrowman.RocketComponentCalc; import net.sf.openrocket.rocketcomponent.Configuration; import net.sf.openrocket.rocketcomponent.ExternalComponent; import net.sf.openrocket.rocketcomponent.FinSet; -import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.SymmetricComponent; import net.sf.openrocket.rocketcomponent.ExternalComponent.Finish; @@ -21,7 +20,6 @@ import net.sf.openrocket.util.Coordinate; import net.sf.openrocket.util.MathUtil; import net.sf.openrocket.util.PolyInterpolator; import net.sf.openrocket.util.Reflection; -import net.sf.openrocket.util.Test; /** * An aerodynamic calculator that uses the extended Barrowman method to @@ -809,89 +807,89 @@ public class BarrowmanCalculator extends AerodynamicCalculator { - public static void main(String[] arg) { - - PolyInterpolator interpolator; - - interpolator = new PolyInterpolator( - new double[] { 0, 17*Math.PI/180 }, - new double[] { 0, 17*Math.PI/180 } - ); - double[] poly1 = interpolator.interpolator(1, 1.3, 0, 0); - - interpolator = new PolyInterpolator( - new double[] { 17*Math.PI/180, Math.PI/2 }, - new double[] { 17*Math.PI/180, Math.PI/2 }, - new double[] { Math.PI/2 } - ); - double[] poly2 = interpolator.interpolator(1.3, 0, 0, 0, 0); - - - for (double a=0; a<=180.1; a++) { - double r = a*Math.PI/180; - if (r > Math.PI/2) - r = Math.PI - r; - - double value; - if (r < 18*Math.PI/180) - value = PolyInterpolator.eval(r, poly1); - else - value = PolyInterpolator.eval(r, poly2); - - System.out.println(""+a+" "+value); - } - - System.exit(0); - - - Rocket normal = Test.makeRocket(); - Rocket perfect = Test.makeRocket(); - normal.setPerfectFinish(false); - perfect.setPerfectFinish(true); - - Configuration confNormal = new Configuration(normal); - Configuration confPerfect = new Configuration(perfect); - - for (RocketComponent c: confNormal) { - if (c instanceof ExternalComponent) { - ((ExternalComponent)c).setFinish(Finish.NORMAL); - } - } - for (RocketComponent c: confPerfect) { - if (c instanceof ExternalComponent) { - ((ExternalComponent)c).setFinish(Finish.NORMAL); - } - } - - - confNormal.setToStage(0); - confPerfect.setToStage(0); - - - - BarrowmanCalculator calcNormal = new BarrowmanCalculator(confNormal); - BarrowmanCalculator calcPerfect = new BarrowmanCalculator(confPerfect); - - FlightConditions conditions = new FlightConditions(confNormal); - - for (double mach=0; mach < 3; mach += 0.1) { - conditions.setMach(mach); - - Map data = - calcNormal.getForceAnalysis(conditions, null); - AerodynamicForces forcesNormal = data.get(normal); - - data = calcPerfect.getForceAnalysis(conditions, null); - AerodynamicForces forcesPerfect = data.get(perfect); - - System.out.printf("%f %f %f %f %f %f %f\n",mach, - forcesNormal.pressureCD, forcesPerfect.pressureCD, - forcesNormal.frictionCD, forcesPerfect.frictionCD, - forcesNormal.CD, forcesPerfect.CD); - } - - - - } +// public static void main(String[] arg) { +// +// PolyInterpolator interpolator; +// +// interpolator = new PolyInterpolator( +// new double[] { 0, 17*Math.PI/180 }, +// new double[] { 0, 17*Math.PI/180 } +// ); +// double[] poly1 = interpolator.interpolator(1, 1.3, 0, 0); +// +// interpolator = new PolyInterpolator( +// new double[] { 17*Math.PI/180, Math.PI/2 }, +// new double[] { 17*Math.PI/180, Math.PI/2 }, +// new double[] { Math.PI/2 } +// ); +// double[] poly2 = interpolator.interpolator(1.3, 0, 0, 0, 0); +// +// +// for (double a=0; a<=180.1; a++) { +// double r = a*Math.PI/180; +// if (r > Math.PI/2) +// r = Math.PI - r; +// +// double value; +// if (r < 18*Math.PI/180) +// value = PolyInterpolator.eval(r, poly1); +// else +// value = PolyInterpolator.eval(r, poly2); +// +// System.out.println(""+a+" "+value); +// } +// +// System.exit(0); +// +// +// Rocket normal = TestRocket.makeRocket(); +// Rocket perfect = TestRocket.makeRocket(); +// normal.setPerfectFinish(false); +// perfect.setPerfectFinish(true); +// +// Configuration confNormal = new Configuration(normal); +// Configuration confPerfect = new Configuration(perfect); +// +// for (RocketComponent c: confNormal) { +// if (c instanceof ExternalComponent) { +// ((ExternalComponent)c).setFinish(Finish.NORMAL); +// } +// } +// for (RocketComponent c: confPerfect) { +// if (c instanceof ExternalComponent) { +// ((ExternalComponent)c).setFinish(Finish.NORMAL); +// } +// } +// +// +// confNormal.setToStage(0); +// confPerfect.setToStage(0); +// +// +// +// BarrowmanCalculator calcNormal = new BarrowmanCalculator(confNormal); +// BarrowmanCalculator calcPerfect = new BarrowmanCalculator(confPerfect); +// +// FlightConditions conditions = new FlightConditions(confNormal); +// +// for (double mach=0; mach < 3; mach += 0.1) { +// conditions.setMach(mach); +// +// Map data = +// calcNormal.getForceAnalysis(conditions, null); +// AerodynamicForces forcesNormal = data.get(normal); +// +// data = calcPerfect.getForceAnalysis(conditions, null); +// AerodynamicForces forcesPerfect = data.get(perfect); +// +// System.out.printf("%f %f %f %f %f %f %f\n",mach, +// forcesNormal.pressureCD, forcesPerfect.pressureCD, +// forcesNormal.frictionCD, forcesPerfect.frictionCD, +// forcesNormal.CD, forcesPerfect.CD); +// } +// +// +// +// } }