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

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

restructuring code

parent 1c87d891
No related branches found
No related tags found
No related merge requests found
......@@ -188,9 +188,28 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
}
protected Newton DriverAcceleration(MeterPerSquareSecond accelleration)
{
var retVal = ((_data.TotalVehicleWeight() + _data.ReducedMassWheels) * accelleration).Cast<Newton>();
Log.Debug("DriverAcceleration: {0}", retVal);
return retVal;
}
protected internal Newton SlopeResistance(Radian gradient)
{
var retVal = (_data.TotalVehicleWeight() * Physics.GravityAccelleration * Math.Sin(gradient.Value())).Cast<Newton>();
Log.Debug("SlopeResistance: {0}", retVal);
return retVal;
}
protected internal Newton AirDragResistance(MeterPerSquareSecond acceleration, Second dt)
{
var vAverage = _previousState.Velocity + acceleration * dt / 2;
if (vAverage.IsEqual(0)) {
return 0.SI<Newton>();
}
var result = (ComputeAirDragPowerLoss(_previousState.Velocity, _previousState.Velocity + acceleration * dt, dt) /
vAverage).Cast<Newton>();
......@@ -244,7 +263,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return VectoMath.Interpolate(p.Item1.X, p.Item2.X, p.Item1.Y, p.Item2.Y, x);
}
protected Point[] CalculateAirResistanceCurve(AirDrag.AirDragEntry values)
{
// todo: get from vehicle or move whole procedure to vehicle
......@@ -285,21 +303,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return points.ToArray();
}
protected Newton DriverAcceleration(MeterPerSquareSecond accelleration)
{
var retVal = ((_data.TotalVehicleWeight() + _data.ReducedMassWheels) * accelleration).Cast<Newton>();
Log.Debug("DriverAcceleration: {0}", retVal);
return retVal;
}
protected internal Newton SlopeResistance(Radian gradient)
{
var retVal = (_data.TotalVehicleWeight() * Physics.GravityAccelleration * Math.Sin(gradient.Value())).Cast<Newton>();
Log.Debug("SlopeResistance: {0}", retVal);
return retVal;
}
public class VehicleState
{
......
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