コード例 #1
0
        // From SensorLogInserterRe
        public static double CalcEnergy(double drivingPower, Car car, double vehicleSpeed, double rho, double windspeed, double myu, double theta, int efficiency)
        {
            double regeneEnergy = RegeneEnergyCalculator.CalcEnergy(drivingPower, vehicleSpeed, car, efficiency);

            return(Math.Abs(ConvertLossCalculator.CalcEnergy(drivingPower, car, vehicleSpeed, efficiency))
                   + Math.Abs(RegeneLossCalculator.CalcEnergy(drivingPower, regeneEnergy, car, vehicleSpeed, efficiency))
                   + AirResistanceCalculator.CalcPower(rho, car.CdValue, car.FrontalProjectedArea, windspeed, vehicleSpeed)
                   + RollingResistanceCalculator.CalcPower(myu, car.Weight, theta, vehicleSpeed));
        }
コード例 #2
0
        public static double CalcEnergy(double drivingPower, Car car, double vehicleSpeed, int efficiency)
        {
            double consumedEnergy;

            // 力行時
            if (drivingPower >= 0)
            {
                consumedEnergy = drivingPower / efficiency * 100 / car.InverterEfficiency;
            }
            // 回生時
            else
            {
                consumedEnergy = RegeneEnergyCalculator.CalcEnergy(drivingPower, vehicleSpeed, car, efficiency);
            }
            return(consumedEnergy);
        }