diff --git a/core/src/main/java/info/openrocket/core/models/wind/MultiLevelWindModel.java b/core/src/main/java/info/openrocket/core/models/wind/MultiLevelWindModel.java index fe99f77dd..4523574f7 100644 --- a/core/src/main/java/info/openrocket/core/models/wind/MultiLevelWindModel.java +++ b/core/src/main/java/info/openrocket/core/models/wind/MultiLevelWindModel.java @@ -146,7 +146,7 @@ public class MultiLevelWindModel implements WindModel { public WindLevel(double altitude, double speed, double direction) { this.altitude = altitude; - this.speed = Math.max(speed, 0.1); + this.speed = Math.max(speed, 0); this.direction = direction; } diff --git a/core/src/main/java/info/openrocket/core/models/wind/PinkNoiseWindModel.java b/core/src/main/java/info/openrocket/core/models/wind/PinkNoiseWindModel.java index 7f0001fe7..6d8ecffcf 100644 --- a/core/src/main/java/info/openrocket/core/models/wind/PinkNoiseWindModel.java +++ b/core/src/main/java/info/openrocket/core/models/wind/PinkNoiseWindModel.java @@ -78,7 +78,7 @@ public class PinkNoiseWindModel implements WindModel { * @param average the average wind speed to set */ public void setAverage(double average) { - average = Math.max(average, 0.1); + average = Math.max(average, 0); if (average == this.average) { return; } diff --git a/core/src/main/java/info/openrocket/core/util/Quaternion.java b/core/src/main/java/info/openrocket/core/util/Quaternion.java index 4c76cb345..dbe0245d6 100644 --- a/core/src/main/java/info/openrocket/core/util/Quaternion.java +++ b/core/src/main/java/info/openrocket/core/util/Quaternion.java @@ -242,7 +242,7 @@ public class Quaternion { // return = (a,b,c,d) * (this)^-1 = (a,b,c,d) * (w,-x,-y,-z) // Assert that the w-value is zero - assert (Math.abs(a * w + b * x + c * y + d * z) < coord.max() * MathUtil.EPSILON) + assert (Math.abs(a * w + b * x + c * y + d * z) <= coord.max() * MathUtil.EPSILON) : ("Should be zero: " + (a * w + b * x + c * y + d * z) + " in " + this + " c=" + coord); return new Coordinate( diff --git a/core/src/test/java/info/openrocket/core/simulation/FlightEventsTest.java b/core/src/test/java/info/openrocket/core/simulation/FlightEventsTest.java index b04f221f7..45af0f29f 100644 --- a/core/src/test/java/info/openrocket/core/simulation/FlightEventsTest.java +++ b/core/src/test/java/info/openrocket/core/simulation/FlightEventsTest.java @@ -69,6 +69,7 @@ public class FlightEventsTest extends BaseTestCase { final Simulation sim = new Simulation(rocket); sim.getOptions().setISAAtmosphere(true); sim.getOptions().setTimeStep(0.05); + sim.getOptions ().getPinkNoiseWindModel().setAverage(0.1); rocket.getSelectedConfiguration().setAllStages(); FlightConfigurationId fcid = rocket.getSelectedConfiguration().getFlightConfigurationID(); sim.setFlightConfigurationId(fcid);