diff --git a/VectoCore/Configuration/Constants.cs b/VectoCore/Configuration/Constants.cs index 076772cc9b3a15316639a5a87a02614f0c7554ed..d7c6e3c120730a266f4c2bf0f1f5d0090a24952e 100644 --- a/VectoCore/Configuration/Constants.cs +++ b/VectoCore/Configuration/Constants.cs @@ -72,11 +72,6 @@ namespace TUGraz.VectoCore.Configuration public static Meter DriverActionDistanceTolerance = 0.25.SI<Meter>(); - /// <summary> - /// The initial search interval for the breaking power search in the driver. - /// </summary> - public static readonly Watt BreakingPowerInitialSearchInterval = 20.SI().Kilo.Watt.Cast<Watt>(); - /// <summary> /// The initial search interval for the operating point search in the driver. /// </summary> diff --git a/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/Models/SimulationComponent/Impl/Driver.cs index 1616ce94117f6ed41c8ce6ce726566e7d403bda2..eb8118aa528a33ab89c464b74ca2c703cb7a997c 100644 --- a/VectoCore/Models/SimulationComponent/Impl/Driver.cs +++ b/VectoCore/Models/SimulationComponent/Impl/Driver.cs @@ -478,8 +478,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var debug = new List<dynamic>(); // only used while testing - var searchInterval = Constants.SimulationSettings.BreakingPowerInitialSearchInterval; - var operatingPoint = new OperatingPoint() { SimulationDistance = ds, Acceleration = acceleration }; Watt origDelta = null; initialResponse.Switch(). @@ -491,6 +489,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl throw new UnexpectedResponseException("cannot use response for searching braking power!", r); }); + // braking power is in the range of the exceeding delta. set searching range to 2/3 so that + // the target point is approximately in the center of the second interval + var searchInterval = origDelta.Abs() * 2 / 3; + debug.Add(new { brakePower = 0.SI<Watt>(), searchInterval, delta = origDelta, operatingPoint }); var brakePower = searchInterval * -origDelta.Sign();