Code development platform for open source projects from the European Union institutions

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

allow pto activity already at drive-off, interpolate pto power between entries in cycle

parent 08f4d3a9
No related branches found
No related tags found
No related merge requests found
......@@ -242,7 +242,7 @@ namespace TUGraz.VectoCore.InputData.Reader
// vehicle stops. duplicate current distance entry with 0 waiting time
var tmp = new DrivingCycleData.DrivingCycleEntry(entry) {
StoppingTime = 0.SI<Second>(),
PTOActive = PTOActivity.Inactive,
PTOActive = entry.PTOActive,
RoadGradient = entry.RoadGradient,
VehicleTargetSpeed = i < entries.Count - 1 ? entries[i + 1].VehicleTargetSpeed : 0.SI<MeterPerSecond>()
};
......
......@@ -28,8 +28,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var powerDemand = 0.SI<Watt>();
if (left.PTOActive == PTOActivity.PTOActivityRoadSweeping) {
// todo: iterate over cycle from left to right and compute pto energy and then average power demand
powerDemand = left.PTOPowerDemandDuringDrive;
var right = DataBus.CycleData.RightSample;
powerDemand = (left.Distance - right.Distance).IsEqual(0) ? left.PTOPowerDemandDuringDrive :
VectoMath.Interpolate(
left.Distance, right.Distance, left.PTOPowerDemandDuringDrive, right.PTOPowerDemandDuringDrive, DataBus.Distance);
}
return powerDemand;
......
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