Exemplo n.º 1
0
        /// <summary>
        ///     Run the Acceleration model
        ///
        ///     All function calls have been listed here to simplify application flow.
        /// </summary>
        /// <returns>Forward Velocity</returns>
        public double Run()
        {
            // Powertrain
            PowerTrain.ThrottleInput = ThrottleInput;

            PowerTrain.ForwardVelocityInput     = ForwardVelocityInput;
            VehicleModel.CurrentForwardVelocity = ForwardVelocityInput;

            PowerTrain.CalculateGear();
            PowerTrain.CalculateTransmission();
            PowerTrain.CalculateRpm();
            PowerTrain.CalculateTorque();
            PowerTrain.CalculateDeliveredDrivingPower();

            // Vehicle Model
            VehicleModel.BrakeInput            = BrakeInput;
            VehicleModel.DeltaT                = DeltaT;
            VehicleModel.DeliveredDrivingPower = PowerTrain.DeliveredDrivingPower;

            VehicleModel.CalculateAirResistance();
            VehicleModel.CalculateRollingResistance();
            VehicleModel.CalculateBraking();
            VehicleModel.CalculateSumForces();

            VehicleModel.CalculateForwardVelocity();

            return(VehicleModel.CurrentForwardVelocity);
        }