GetEmission() public method

public GetEmission ( string pollutant, double power, double speed, System.Helpers VehicleClass ) : double
pollutant string
power double
speed double
VehicleClass System.Helpers
return double
Ejemplo n.º 1
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));
            }
        }
Ejemplo n.º 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 = 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);
            }
        }