Stored DT in intervals.
authorBill Kuker <bkuker@billkuker.com>
Fri, 17 Apr 2009 04:26:36 +0000 (04:26 +0000)
committerBill Kuker <bkuker@billkuker.com>
Fri, 17 Apr 2009 04:26:36 +0000 (04:26 +0000)
Made more of interval data public. I should do something better than that.

src/com/billkuker/rocketry/motorsim/Burn.java

index 924b1ba71d0b7e9a4095e221f83fb73765019816..1ced62947a75ba6e4b90ff7b28f4d0d66a64c7b6 100644 (file)
@@ -36,14 +36,15 @@ public class Burn {
        private static double densityRatio = 0.96;\r
        \r
        public class Interval{\r
-               Amount<Duration> time;\r
+               public Amount<Duration> time;\r
+               public Amount<Duration> dt;\r
                public Amount<Length> regression;\r
                public Amount<Pressure> chamberPressure;\r
                Amount<Mass> chamberProduct;\r
-               Amount<Force> thrust;\r
+               public Amount<Force> thrust;\r
 \r
                public String toString(){\r
-                       return time + " " + regression + " " + chamberPressure + " " + chamberProduct;\r
+                       return time + " " + dt + " " + regression + " " + chamberPressure + " " + chamberProduct;\r
                }\r
        }\r
        \r
@@ -76,6 +77,7 @@ public class Burn {
                \r
                Interval initial = new Interval();\r
                initial.time = Amount.valueOf(0, SI.SECOND);\r
+               initial.dt = Amount.valueOf(0, SI.SECOND);\r
                initial.regression = Amount.valueOf(0, SI.MILLIMETER);\r
                initial.chamberPressure = atmosphereicPressure;\r
                initial.chamberProduct = Amount.valueOf(0, SI.KILOGRAM);\r
@@ -95,6 +97,7 @@ public class Burn {
                        log.debug("Burn Rate: " + burnRate);\r
                        \r
                        Amount<Duration> dt = regStep.divide(burnRate).to(Duration.UNIT);\r
+                       next.dt = dt;\r
                        \r
                        data.put(data.lastKey().plus(dt), next);\r
                        \r
@@ -193,7 +196,7 @@ public class Burn {
                                break;\r
                        }\r
                }\r
-                               \r
+\r
        }\r
        \r
        @SuppressWarnings("unchecked")\r