Actually, scrap that, allow 0-speed wind

This commit is contained in:
SiboVG 2024-09-14 02:48:16 +01:00
parent ff638366a2
commit c3614330b9
4 changed files with 4 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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(

View File

@ -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);