CalcEngPower() public method

public CalcEngPower ( double power ) : double
power double
return double
Example #1
0
        static public VehicleResult CreateVehicleStateData(Helpers Helper,
                                                           CEP currCep,
                                                           double time,
                                                           double inputSpeed,
                                                           double inputAcc,
                                                           double Gradient    = 0,
                                                           Correction DataCor = null)
        {
            //Declaration
            double speed = Math.Max(inputSpeed, 0);
            double acc;
            double P_pos;

            //Speed/Acceleration limitation
            if (speed == 0)
            {
                acc = 0;
            }
            else
            {
                acc = Math.Min(inputAcc, currCep.GetMaxAccel(speed, Gradient, (Helper.pClass == Constants.strBEV | Helper.uClass == Constants.strHybrid)));
            }

            //Calculate the power
            double power  = currCep.CalcPower(speed, acc, Gradient, (Helper.pClass == Constants.strBEV | Helper.uClass == Constants.strHybrid));
            double P_eng  = currCep.CalcEngPower(power);
            double Pwheel = 0;

            if (Helper.uClass == Constants.strHybrid)
            {
                Pwheel = currCep.CalcWheelPower(speed, acc, Gradient);
            }
            //Power limitation
            if (P_eng >= 0)
            {
                P_pos = power;
            }
            else
            {
                P_pos = 0;
            }

            //Calculate the result values (BEV)
            if (Helper.pClass == Constants.strBEV)
            {
                return(new VehicleResult(Helper.gClass,
                                         "",
                                         time,
                                         speed,
                                         Gradient,
                                         P_eng,
                                         P_pos,
                                         P_eng / currCep.RatedPower,
                                         P_eng / currCep.DrivingPower,
                                         acc,
                                         currCep.GetAllEmission(P_eng, speed, Helper)));
            }

            //Calculate the decel costing
            double decelCoast = currCep.GetDecelCoast(speed, acc, Gradient);

            //Calculate the result values (Zero emissions by costing, Idling emissions by v <= 0.5m / s²)
            if (acc >= decelCoast || speed <= Constants.ZERO_SPEED_ACCURACY)
            {
                if (Helper.uClass == Constants.strHybrid)
                {
                    return(new VehicleResult(Helper.gClass,
                                             "",
                                             time,
                                             speed,
                                             Gradient,
                                             P_eng,
                                             P_pos,
                                             P_eng / currCep.RatedPower,
                                             P_eng / currCep.DrivingPower,
                                             acc,
                                             currCep.GetAllEmission(Pwheel, speed, Helper)));
                }
                else
                {
                    return(new VehicleResult(Helper.gClass,
                                             "",
                                             time,
                                             speed,
                                             Gradient,
                                             P_eng,
                                             P_pos,
                                             P_eng / currCep.RatedPower,
                                             P_eng / currCep.DrivingPower,
                                             acc,
                                             currCep.GetAllEmission(P_eng, speed, Helper)));
                }
            }
            else
            {
                if (Helper.uClass == Constants.strHybrid)
                {
                    return(new VehicleResult(Helper.gClass,
                                             "",
                                             time,
                                             speed,
                                             Gradient,
                                             P_eng,
                                             P_pos,
                                             P_eng / currCep.RatedPower,
                                             P_eng / currCep.DrivingPower,
                                             acc,
                                             currCep.GetAllEmission(Pwheel, speed, Helper, true)));
                }
                else
                {
                    return(new VehicleResult(Helper.gClass,
                                             "",
                                             time,
                                             speed,
                                             Gradient,
                                             P_eng,
                                             P_pos,
                                             P_eng / currCep.RatedPower,
                                             P_eng / currCep.DrivingPower,
                                             acc,
                                             currCep.GetAllEmission(P_eng, speed, Helper, true)));
                }
            }
        }
Example #2
0
        static public VehicleResult CreateVehicleStateData(Helpers Helper,
                                                           CEP currCep,
                                                           double time,
                                                           double inputSpeed,
                                                           double inputAcc,
                                                           double Gradient = 0)
        {
            //Declaration
            double speed = Math.Max(inputSpeed, 0);
            double acc;
            double P_pos;

            //Speed/Acceleration limitation
            if (speed == 0)
            {
                acc = 0;
            }
            else
            {
                acc = Math.Min(inputAcc, currCep.GetMaxAccel(speed, Gradient));
            }

            //Calculate the power
            double power = currCep.CalcPower(speed, acc, Gradient);
            double P_eng = currCep.CalcEngPower(power);

            //Power limitation
            if (P_eng >= 0)
            {
                P_pos = power;
            }
            else
            {
                P_pos = 0;
            }

            //Calculate the result values (BEV)
            if (Helper.tClass == Constants.strBEV)
            {
                return(new VehicleResult(time,
                                         speed,
                                         Gradient,
                                         power,
                                         P_pos,
                                         P_eng / currCep.RatedPower,
                                         P_eng / currCep.DrivingPower,
                                         acc,
                                         0,
                                         currCep.GetEmission("FC", power, speed, Helper),
                                         0,
                                         0,
                                         0,
                                         0,
                                         0));
            }

            //Calculate the decel costing
            double decelCoast = currCep.GetDecelCoast(speed, acc, Gradient);

            //Calculate the result values (Zero emissions by costing, Idling emissions by v <= 0.5m/s²)
            if (acc >= decelCoast || speed <= Constants.ZERO_SPEED_ACCURACY)
            {
                return(new VehicleResult(time,
                                         speed,
                                         Gradient,
                                         power,
                                         P_pos,
                                         P_eng / currCep.RatedPower,
                                         P_eng / currCep.DrivingPower,
                                         acc,
                                         currCep.GetEmission("FC", power, speed, Helper),
                                         0,
                                         currCep.GetCO2Emission(currCep.GetEmission("FC", power, speed, Helper), currCep.GetEmission("CO", power, speed, Helper), currCep.GetEmission("HC", power, speed, Helper), Helper),
                                         currCep.GetEmission("NOx", power, speed, Helper),
                                         currCep.GetEmission("HC", power, speed, Helper),
                                         currCep.GetEmission("PM", power, speed, Helper),
                                         currCep.GetEmission("CO", power, speed, Helper)));
            }
            else
            {
                return(new VehicleResult(time,
                                         speed,
                                         Gradient,
                                         power,
                                         P_pos,
                                         power / currCep.RatedPower,
                                         power / currCep.DrivingPower,
                                         acc,
                                         0,
                                         0,
                                         0,
                                         0,
                                         0,
                                         0,
                                         0));
            }
        }
Example #3
0
        static public VehicleResult CreateVehicleStateData(Helpers Helper,
                                                           CEP currCep,
                                                           double time,
                                                           double inputSpeed,
                                                           double inputAcc,
                                                           double Gradient = 0)
        {
            //Declaration
            double speed = Math.Max(inputSpeed, 0);
            double acc;
            double P_pos;

            //Speed/Acceleration limitation
            if (speed == 0)
                acc = 0;
            else
                acc = inputAcc;

            //Calculate the power
            double power = currCep.CalcPower(speed, acc, Gradient);
            double P_eng = currCep.CalcEngPower(power);

            //Power limitation
            if (P_eng >= 0) 
                P_pos = power;
            else 
                P_pos = 0;

            //Calculate the result values (BEV)
            if (Helper.tClass == Constants.strBEV)
            {
                return new VehicleResult(time,
                                         speed,
                                         Gradient,
                                         power,
                                         P_pos,
                                         P_eng / currCep.RatedPower,
                                         P_eng / currCep.DrivingPower,
                                         acc,
                                         0,
                                         currCep.GetEmission("FC", power, speed, Helper),
                                         0,
                                         0,
                                         0,
                                         0,
                                         0);
            }

            //Calculate the decel costing
            double decelCoast = currCep.GetDecelCoast(speed, acc, Gradient);

            //Calculate the result values (Zero emissions by costing)
            if (acc >= decelCoast)
            {
                return new VehicleResult(time,
                                         speed,
                                         Gradient,
                                         power,
                                         P_pos,
                                         P_eng / currCep.RatedPower,
                                         P_eng / currCep.DrivingPower,
                                         acc,
                                         currCep.GetEmission("FC", power, speed, Helper),
                                         0,
                                         currCep.GetCO2Emission(currCep.GetEmission("FC", power, speed, Helper), currCep.GetEmission("CO", power, speed, Helper), currCep.GetEmission("HC", power, speed, Helper), Helper),
                                         currCep.GetEmission("NOx", power, speed, Helper),
                                         currCep.GetEmission("HC", power, speed, Helper),
                                         currCep.GetEmission("PM", power, speed, Helper),
                                         currCep.GetEmission("CO", power, speed, Helper));
            }
            else
            {
                return new VehicleResult(time,
                                         speed,
                                         Gradient,
                                         power,
                                         P_pos,
                                         power / currCep.RatedPower,
                                         power / currCep.DrivingPower,
                                         acc,
                                         0,
                                         0,
                                         0,
                                         0,
                                         0,
                                         0,
                                         0);
            }
        }