diff --git a/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs b/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs index 54419692ce96672412180476ae07141273fa2d1c..2ebd13aba14295285ca5fac515ba50f6e4d7cf38 100644 --- a/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs +++ b/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs @@ -388,10 +388,15 @@ namespace TUGraz.VectoCore.Models.Simulation.Data [ModalResultField(typeof(SI), caption: "P_em-{0}_el [kW]", outputFactor: 1e-3)] P_electricMotor_el_, [ModalResultField(typeof(SI), caption: "P_em-{0}_drag_max_ [kW]", outputFactor: 1e-3)] P_electricMotor_drag_max_, [ModalResultField(typeof(SI), caption: "P_em-{0}_drive_max [kW]", outputFactor: 1e-3)] P_electricMotor_drive_max_, - [ModalResultField(typeof(SI), caption: "P_em-{0}_brake [kW]", outputFactor: 1e-3)] P_electricMotor_brake_, + //[ModalResultField(typeof(SI), caption: "P_em-{0}_brake [kW]", outputFactor: 1e-3)] P_electricMotor_brake_, [ModalResultField(typeof(SI), caption: "P_em-{0}_loss [kW]", outputFactor: 1e-3)] P_electricMotorLoss_, [ModalResultField(typeof(SI), caption: "P_em-{0}_inertia_loss [kW]", outputFactor: 1e-3)] P_electricMotorInertiaLoss_, + // only for graphDrawing Testcase + [ModalResultField(typeof(SI), caption: "P_em-P2_mech [kW]", outputFactor: 1e-3)] + P_electricMotor_mech_P2, + // --> + [ModalResultField(typeof(SI), caption: "P_bat_T [kW]", outputFactor: 1e-3)] P_battery_terminal, [ModalResultField(typeof(SI), caption: "P_bat_int [kW]", outputFactor: 1e-3)] P_battery_int, [ModalResultField(typeof(SI), caption: "P_bat_loss [kW]", outputFactor: 1e-3)] P_battery_loss, diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/ElectricMotor/EfficiencyMap.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/ElectricMotor/EfficiencyMap.cs index e29a6ca53c9e085ff0ab95e4ee0756232348e90a..33787a226da223910ecf46af3101265e37531c69 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/ElectricMotor/EfficiencyMap.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/ElectricMotor/EfficiencyMap.cs @@ -97,7 +97,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data { } } - + if (batPower.IsEqual(0, 1e-3)) { + return null; + } var retVal = SearchAlgorithm.Search( maxEmTorque, elPowerMaxEM.ElectricalPower, maxEmTorque * 0.1, getYValue: x => { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricMotor.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricMotor.cs index e19b76527ceec10a13e8c3c9d268e26a962fac76..7a3afca5ce8a3a66848564261b99246ac9f3f9fe 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricMotor.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricMotor.cs @@ -90,8 +90,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var electricSystemResponse = ElectricPower.Request(absTime, dt, 0.SI<Watt>(), true); var maxBatPower = electricSystemResponse.BatteryResponse.MaxBatteryLoadCharge; - var maxBatRecuperationTorque = ModelData.EfficiencyMap.LookupTorque(maxBatPower, avgSpeed, maxEmTorque); - var maxTorqueRecuperate = VectoMath.Max(maxEmTorque, maxBatRecuperationTorque); + var maxBatRecuperationTorque = maxBatPower.IsEqual(0) ? 0.SI<NewtonMeter>() : ModelData.EfficiencyMap.LookupTorque(maxBatPower, avgSpeed, maxEmTorque); + var maxTorqueRecuperate = VectoMath.Min(maxEmTorque, maxBatRecuperationTorque); return maxTorqueRecuperate < 0 ? null : maxTorqueRecuperate; } @@ -101,7 +101,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var electricSystemResponse = ElectricPower.Request(absTime, dt, 0.SI<Watt>(), true); var maxBatPower = electricSystemResponse.BatteryResponse.MaxBatteryLoadDischarge; - var maxBatDriveTorque = ModelData.EfficiencyMap.LookupTorque(maxBatPower, avgSpeed, maxEmTorque); + var maxBatDriveTorque = maxBatPower.IsEqual(0) ? ModelData.DragCurve.Lookup(avgSpeed) : ModelData.EfficiencyMap.LookupTorque(maxBatPower, avgSpeed, maxEmTorque); var maxTorqueDrive = VectoMath.Max(maxEmTorque, maxBatDriveTorque); return maxTorqueDrive > 0 ? null : maxTorqueDrive; } @@ -167,13 +167,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl .LookupElectricPower(avgSpeed, eMotorTorque, DataBus.ExecutionMode != ExecutionMode.Declaration).ElectricalPower; var electricSupplyResponse = ElectricPower.Request(absTime, dt, electricPower, dryRun); - if (!dryRun && !(electricSupplyResponse is ElectricSystemResponseSuccess) && - electricPower > electricSupplyResponse.MaxPowerDrag) { - // can't charge all power into the battery - probably it's full - // dissipate remaining power - electricSupplyResponse = ElectricPower.Request(absTime, dt, electricSupplyResponse.MaxPowerDrag); - CurrentState.ElectricBrakePower = electricPower - electricSupplyResponse.MaxPowerDrag; - } + //if (!dryRun && !(electricSupplyResponse is ElectricSystemResponseSuccess) && + // electricPower > electricSupplyResponse.MaxPowerDrag) { + // // can't charge all power into the battery - probably it's full + // // dissipate remaining power + // electricSupplyResponse = ElectricPower.Request(absTime, dt, electricSupplyResponse.MaxPowerDrag); + // CurrentState.ElectricBrakePower = electricPower - electricSupplyResponse.MaxPowerDrag; + //} if (!dryRun && !(electricSupplyResponse is ElectricSystemResponseSuccess)) { throw new VectoException( "Invalid operating point provided by strategy! SupportPower: {0}, req. electric Power: {1}, battery demand motor: {3}, max Power from Battery: {2}", @@ -289,10 +289,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl container[ModalResultField.P_electricMotor_out_, Position] = CurrentState.OutTorque * avgSpeed; container[ModalResultField.P_electricMotor_in_, Position] = CurrentState.InTorque * avgSpeed; container[ModalResultField.P_electricMotor_el_, Position] = CurrentState.ElectricPowerToBattery; - container[ModalResultField.P_electricMotor_brake_, Position] = CurrentState.ElectricBrakePower; + //container[ModalResultField.P_electricMotor_brake_, Position] = CurrentState.ElectricBrakePower; container[ModalResultField.P_electricMotor_drag_max_, Position] = (CurrentState.DragMax ?? 0.SI<NewtonMeter>()) * avgSpeed; container[ModalResultField.P_electricMotor_drive_max_, Position] = (CurrentState.DriveMax ?? 0.SI<NewtonMeter>()) * avgSpeed; - container[ModalResultField.P_electricMotorLoss_, Position] = (CurrentState.InTorque - CurrentState.OutTorque) * avgSpeed - (CurrentState.ElectricPowerToBattery + CurrentState.ElectricBrakePower); + container[ModalResultField.P_electricMotorLoss_, Position] = (CurrentState.InTorque - CurrentState.OutTorque) * avgSpeed - (CurrentState.ElectricPowerToBattery); container[ModalResultField.P_electricMotorInertiaLoss_, Position] = CurrentState.InertiaTorqueLoss * avgSpeed; } @@ -319,7 +319,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public NewtonMeter DriveMax; public NewtonMeter DragMax; public Watt ElectricPowerToBattery; - public Watt ElectricBrakePower = 0.SI<Watt>(); + //public Watt ElectricBrakePower = 0.SI<Watt>(); public NewtonMeter InertiaTorqueLoss; } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs index 2e032bb719ead80946e85f4c88759fab4b405e32..70a3be2197a4567b89c318564eb010250a26ce8d 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs @@ -33,6 +33,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies public IDrivingCycleInfo DrivingCycle; public StopStartCombustionEngine CombustionEngine; + public ElectricMotor ElectricMotorP2; public TestPowertrain(SimplePowertrainContainer container, IDataBus realContainer) { @@ -42,6 +43,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies Battery = Container.BatteryInfo as Battery; Clutch = Container.ClutchInfo as Clutch; CombustionEngine = Container.EngineInfo as StopStartCombustionEngine; + ElectricMotorP2 = container.ElectricMotors[PowertrainPosition.HybridP2] as ElectricMotor; if (Gearbox == null) { throw new VectoException("Unknown gearboxtype in TestContainer: {0}", Container.GearboxCtl.GetType().FullName); } @@ -239,7 +241,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies //private Second lastShiftTime; - private TestPowertrain TestPoweretrain; + private TestPowertrain TestPowertrain; protected readonly VelocityRollingLookup VelocityDropData; @@ -280,7 +282,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies var testContainer = new SimplePowertrainContainer(runData); builder.BuildSimpleHybridPowertrain(runData, testContainer); - TestPoweretrain = new TestPowertrain(testContainer, DataBus); + TestPowertrain = new TestPowertrain(testContainer, DataBus); // register pre-processors var maxG = runData.Cycle.Entries.Max(x => Math.Abs(x.RoadGradientPercent.Value())) + 1; @@ -351,7 +353,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies Gear = 0 , }); } - if (DataBus.DriverInfo.DrivingAction == DrivingAction.Brake && (eval.Count == 0 || eval.All(x => double.IsNaN(x.Score)))) { + if (DataBus.DriverInfo.DrivingAction == DrivingAction.Brake && (eval.Count == 0 /*|| eval.All(x => double.IsNaN(x.Score))*/)) { eval.Add(MaxRecuperationSetting(absTime, dt, outTorque, outAngularVelocity)); } //if (DataBus.DriverInfo.DrivingAction == DrivingAction.Accelerate && eval.Count > 0 && eval.All(x => double.IsNaN(x.Score))) { @@ -364,7 +366,19 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies var best = eval.Where(x => !double.IsNaN(x.Score)).OrderBy(x => x.Score).FirstOrDefault(); // ?? eval.FirstOrDefault(); if (best == null) { - best = eval.FirstOrDefault(); + best = eval.FirstOrDefault(x => !DataBus.EngineCtl.CombustionEngineOn || !x.IgnoreReason.InvalidEngineSpeed()); // ?? eval.FirstOrDefault(); + if (best == null /*&& dryRun*/) { + var emEngaged = (!ElectricMotorCanPropellDuringTractionInterruption || (DataBus.GearboxInfo.GearEngaged(absTime) && eval.First().Response.Gearbox.Gear != 0)); + if (DataBus.DriverInfo.DrivingAction == DrivingAction.Accelerate && emEngaged) { + best = eval.MinBy(x => x.Setting.MechanicalAssistPower.Sum(e => e.Value ?? 0.SI<NewtonMeter>())); + } + if (DataBus.DriverInfo.DrivingAction == DrivingAction.Brake && emEngaged) { + best = eval.MaxBy(x => x.Setting.MechanicalAssistPower.Sum(e => e.Value ?? 0.SI<NewtonMeter>())); + } + } + if (best == null) { + best = eval.FirstOrDefault(); + } var allOverload = eval.All( x => (x.IgnoreReason & HybridConfigurationIgnoreReason.EngineTorqueDemandTooHigh) != 0); var allUnderload = eval.All( @@ -576,12 +590,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies private ResponseDryRun RequestDryRun(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, uint nextGear, HybridStrategyResponse cfg) { - TestPoweretrain.Gearbox.Gear = PreviousState.GearboxEngaged ? DataBus.GearboxInfo.Gear : Controller.ShiftStrategy.NextGear.Gear; - TestPoweretrain.Container.VehiclePort.Initialize(DataBus.VehicleInfo.VehicleSpeed, DataBus.DrivingCycleInfo.RoadGradient ?? 0.SI<Radian>()); - TestPoweretrain.HybridController.ApplyStrategySettings(cfg); - TestPoweretrain.HybridController.Initialize(Controller.PreviousState.OutTorque, Controller.PreviousState.OutAngularVelocity); - TestPoweretrain.Clutch.Initialize(DataBus.ClutchInfo.ClutchLosses); - TestPoweretrain.Battery.Initialize(DataBus.BatteryInfo.StateOfCharge); + TestPowertrain.Gearbox.Gear = PreviousState.GearboxEngaged ? DataBus.GearboxInfo.Gear : Controller.ShiftStrategy.NextGear.Gear; + TestPowertrain.Container.VehiclePort.Initialize(DataBus.VehicleInfo.VehicleSpeed, DataBus.DrivingCycleInfo.RoadGradient ?? 0.SI<Radian>()); + TestPowertrain.HybridController.ApplyStrategySettings(cfg); + TestPowertrain.HybridController.Initialize(Controller.PreviousState.OutTorque, Controller.PreviousState.OutAngularVelocity); + TestPowertrain.Clutch.Initialize(DataBus.ClutchInfo.ClutchLosses); + TestPowertrain.Battery.Initialize(DataBus.BatteryInfo.StateOfCharge); //TestPoweretrain.CombustionEngine.PreviousState.EngineOn = (DataBus.EngineInfo as CombustionEngine).PreviousState.EngineOn; //TestPoweretrain.CombustionEngine.PreviousState.EnginePower = (DataBus.EngineInfo as CombustionEngine).PreviousState.EnginePower; @@ -608,19 +622,23 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies var vDrop = DataBus.VehicleInfo.VehicleSpeed - estimatedVelocityPostShift; var vehicleSpeedPostShift = DataBus.VehicleInfo.VehicleSpeed - vDrop * ModelData.GearshiftParameters.VelocityDropFactor; - TestPoweretrain.Gearbox.Gear = nextGear; - TestPoweretrain.Container.VehiclePort.Initialize( + TestPowertrain.Gearbox.Gear = nextGear; + TestPowertrain.Container.VehiclePort.Initialize( vehicleSpeedPostShift, DataBus.DrivingCycleInfo.RoadGradient ?? 0.SI<Radian>()); } - TestPoweretrain.CombustionEngine.PreviousState.EngineOn = (DataBus.EngineInfo as CombustionEngine).PreviousState.EngineOn; - TestPoweretrain.CombustionEngine.PreviousState.EnginePower = (DataBus.EngineInfo as CombustionEngine).PreviousState.EnginePower; - TestPoweretrain.CombustionEngine.PreviousState.dt = (DataBus.EngineInfo as CombustionEngine).PreviousState.dt; - TestPoweretrain.CombustionEngine.PreviousState.EngineSpeed = (DataBus.EngineInfo as CombustionEngine).PreviousState.EngineSpeed; - TestPoweretrain.CombustionEngine.PreviousState.EngineTorque = (DataBus.EngineInfo as CombustionEngine).PreviousState.EngineTorque; - TestPoweretrain.CombustionEngine.PreviousState.EngineTorqueOut = (DataBus.EngineInfo as CombustionEngine).PreviousState.EngineTorqueOut; - TestPoweretrain.CombustionEngine.PreviousState.DynamicFullLoadTorque = (DataBus.EngineInfo as CombustionEngine).PreviousState.DynamicFullLoadTorque; - + TestPowertrain.CombustionEngine.PreviousState.EngineOn = (DataBus.EngineInfo as CombustionEngine).PreviousState.EngineOn; + TestPowertrain.CombustionEngine.PreviousState.EnginePower = (DataBus.EngineInfo as CombustionEngine).PreviousState.EnginePower; + TestPowertrain.CombustionEngine.PreviousState.dt = (DataBus.EngineInfo as CombustionEngine).PreviousState.dt; + TestPowertrain.CombustionEngine.PreviousState.EngineSpeed = (DataBus.EngineInfo as CombustionEngine).PreviousState.EngineSpeed; + TestPowertrain.CombustionEngine.PreviousState.EngineTorque = (DataBus.EngineInfo as CombustionEngine).PreviousState.EngineTorque; + TestPowertrain.CombustionEngine.PreviousState.EngineTorqueOut = (DataBus.EngineInfo as CombustionEngine).PreviousState.EngineTorqueOut; + TestPowertrain.CombustionEngine.PreviousState.DynamicFullLoadTorque = (DataBus.EngineInfo as CombustionEngine).PreviousState.DynamicFullLoadTorque; + + if (nextGear != DataBus.GearboxInfo.Gear && TestPowertrain.ElectricMotorP2 != null) { + TestPowertrain.ElectricMotorP2.PreviousState.OutAngularVelocity = + DataBus.ElectricMotorInfo(PowertrainPosition.HybridP2).ElectricMotorSpeed; + } // AMT EffShift: estimatedVelocityPostShift < MIN_SPEED => no shift // AMT EffShift: engine torqueOut close to dragCurve => no shift @@ -630,7 +648,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies // initialize with new vehicle speed // set gear - var retVal = TestPoweretrain.HybridController.NextComponent.Request(absTime, dt, outTorque, outAngularVelocity, true); + var retVal = TestPowertrain.HybridController.NextComponent.Request(absTime, dt, outTorque, outAngularVelocity, true); //if (nextGear != DataBus.GearboxInfo.Gear) { // if (retVal.Engine.TorqueOutDemand.IsSmaller(DeclarationData.GearboxTCU.DragMarginFactor * retVal.Engine.DragTorque)) { @@ -916,10 +934,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies public static bool InvalidEngineSpeed(this HybridStrategy.HybridConfigurationIgnoreReason x) { - return x == HybridStrategy.HybridConfigurationIgnoreReason.EngineSpeedTooLow || - x == HybridStrategy.HybridConfigurationIgnoreReason.EngineSpeedTooHigh || - x == HybridStrategy.HybridConfigurationIgnoreReason.EngineSpeedBelowDownshift || - x == HybridStrategy.HybridConfigurationIgnoreReason.EngineSpeedAboveUpshift; + return (x & (HybridStrategy.HybridConfigurationIgnoreReason.EngineSpeedTooLow | + HybridStrategy.HybridConfigurationIgnoreReason.EngineSpeedTooHigh | + HybridStrategy.HybridConfigurationIgnoreReason.EngineSpeedBelowDownshift | + HybridStrategy.HybridConfigurationIgnoreReason.EngineSpeedAboveUpshift)) != 0; } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/ModalDataContainer.cs b/VectoCore/VectoCore/OutputData/ModalDataContainer.cs index a4d15ba37e30c065b063075c2cf7b9b606ae1673..8b75b6fdb0bea2575f7c855751e6d6e64b48bf88 100644 --- a/VectoCore/VectoCore/OutputData/ModalDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/ModalDataContainer.cs @@ -69,7 +69,7 @@ namespace TUGraz.VectoCore.OutputData ModalResultField.P_electricMotor_in_, ModalResultField.P_electricMotor_out_, ModalResultField.P_electricMotor_mech_, ModalResultField.P_electricMotor_el_, ModalResultField.P_electricMotorLoss_, ModalResultField.P_electricMotorInertiaLoss_, - ModalResultField.P_electricMotor_brake_, ModalResultField.P_electricMotor_drive_max_, + /*ModalResultField.P_electricMotor_brake_,*/ ModalResultField.P_electricMotor_drive_max_, ModalResultField.P_electricMotor_drag_max_ }; diff --git a/VectoCore/VectoCoreTest/Integration/Hybrid/ParallelHybridTest.cs b/VectoCore/VectoCoreTest/Integration/Hybrid/ParallelHybridTest.cs index 2aa467b4f12d0952e1a41cc5f1bcd39762fff262..63443b9c1ac2458a79375241911452e770766f0f 100644 --- a/VectoCore/VectoCoreTest/Integration/Hybrid/ParallelHybridTest.cs +++ b/VectoCore/VectoCoreTest/Integration/Hybrid/ParallelHybridTest.cs @@ -44,8 +44,27 @@ namespace TUGraz.VectoCore.Tests.Integration.Hybrid public void RunBeforeAnyTests() { Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory); + + InitGraphWriter(); } + + private void InitGraphWriter() + { + //#if TRACE + GraphWriter.Enable(); + //#else + //GraphWriter.Disable(); + //#endif + GraphWriter.Xfields = new[] { ModalResultField.dist }; + + GraphWriter.Yfields = new[] { + ModalResultField.v_act, ModalResultField.altitude, ModalResultField.acc, ModalResultField.Gear, + ModalResultField.P_ice_out, ModalResultField.P_electricMotor_mech_P2 , ModalResultField.BatterySOC, ModalResultField.FCMap + }; + GraphWriter.Series1Label = "Hybrid P2"; + GraphWriter.PlotIgnitionState = true; + } //[TestCase(30, 0.8, 200), //TestCase(30, 0.3, 200), //TestCase(30, 0.8, -200), @@ -74,7 +93,7 @@ namespace TUGraz.VectoCore.Tests.Integration.Hybrid // var nextState = new StrategyState(); // var currentState = new StrategyState(); - + // run.Run(); // Assert.IsTrue(run.FinishedWithoutErrors); @@ -96,9 +115,10 @@ namespace TUGraz.VectoCore.Tests.Integration.Hybrid const bool largeMotor = true; + var modFilename = string.Format("SimpleParallelHybrid_acc_{0}-{1}_{2}.vmod", vmax, initialSoC, slope); const PowertrainPosition pos = PowertrainPosition.HybridP2; var run = CreateEngineeringRun( - cycle, string.Format("SimpleParallelHybrid_acc_{0}-{1}_{2}.vmod", vmax, initialSoC, slope), initialSoC, pos, largeMotor: true); + cycle, modFilename, initialSoC, pos, largeMotor: true); var hybridController = (HybridController)((VehicleContainer)run.GetContainer()).HybridController; Assert.NotNull(hybridController); @@ -116,6 +136,7 @@ namespace TUGraz.VectoCore.Tests.Integration.Hybrid Assert.IsTrue(run.FinishedWithoutErrors); Assert.IsTrue(modData.Rows.Count > 0); + GraphWriter.Write(modFilename); } [ @@ -144,9 +165,10 @@ namespace TUGraz.VectoCore.Tests.Integration.Hybrid const bool largeMotor = true; + var modFilename = string.Format("SimpleParallelHybrid_constant_{0}-{1}_{2}.vmod", vmax, initialSoC, slope); const PowertrainPosition pos = PowertrainPosition.HybridP2; var run = CreateEngineeringRun( - cycle, string.Format("SimpleParallelHybrid_constant_{0}-{1}_{2}.vmod", vmax, initialSoC, slope), initialSoC, pos, largeMotor: true); + cycle, modFilename, initialSoC, pos, largeMotor: true); var hybridController = (HybridController)((VehicleContainer)run.GetContainer()).HybridController; Assert.NotNull(hybridController); @@ -164,6 +186,7 @@ namespace TUGraz.VectoCore.Tests.Integration.Hybrid Assert.IsTrue(run.FinishedWithoutErrors); Assert.IsTrue(modData.Rows.Count > 0); + GraphWriter.Write(modFilename); } [ @@ -215,9 +238,10 @@ namespace TUGraz.VectoCore.Tests.Integration.Hybrid const bool largeMotor = true; + var modFilename = string.Format("SimpleParallelHybrid_stop_{0}-{1}_{2}.vmod", vmax, initialSoC, slope); const PowertrainPosition pos = PowertrainPosition.HybridP2; var run = CreateEngineeringRun( - cycle, string.Format("SimpleParallelHybrid_stop_{0}-{1}_{2}.vmod", vmax, initialSoC, slope), initialSoC, pos, largeMotor: true); + cycle, modFilename, initialSoC, pos, largeMotor: true); var hybridController = (HybridController)((VehicleContainer)run.GetContainer()).HybridController; Assert.NotNull(hybridController); @@ -235,6 +259,7 @@ namespace TUGraz.VectoCore.Tests.Integration.Hybrid Assert.IsTrue(run.FinishedWithoutErrors); Assert.IsTrue(modData.Rows.Count > 0); + GraphWriter.Write(modFilename); } public class StrategyState