Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 80d590e6 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

speedup for search braking power (linear search part)

parent 70a47b14
No related branches found
No related tags found
No related merge requests found
......@@ -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>
......
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment