- fixed bug in solar recharge percentage computation
- added recharge at the end of the year to have the same battery level
at the start and end of the year
- added battery and charger efficiency simulation
- using kWh price (without counting subscription)
@ -6,7 +6,7 @@ Vehicle energy consumption and production simulator. This tool has been created
The easiest way is to use the [online simulator](https://vhelio.org/simulateur-vhelio/).
You can also download the latest pre-built stand-alone version and open `vhelio-simulator.html` in your web browser. When executed in this way, the program will run in your browser, but won't communicate with any server, this is a purely local application.
You can also download the [latest pre-built stand-alone version](https://gitea.youb.fr/youen/vehicle-simulator/releases) and open `vhelio-simulator.html` in your web browser. When executed in this way, the program will run in your browser, but won't communicate with any server, this is a purely local application.
+(simulationResult.outOfBatteryDistance>=1?`<p><br/></p><p class="simulation-warning">/!\\ En raison d'une capacité de batterie insuffisante, il faudra faire ${Math.round(simulationResult.outOfBatteryDistance)}km/an sans assistance électrique</p>`:"");
//<p>${Math.round(100*(simulationResult.cumulatedSolarRechargeEnergy/simulationResult.vehicle.batteryEfficiency) / simulationResult.totalProducedSolarEnergy)}% de l'énergie produite par le panneau photovoltaïque sera utilisée pour recharger le vhélio.</p>
letpotentialEnergy=totalWeight*g*ascendingElevation;// Ep = m*g*h (result in Joules)
potentialEnergy=potentialEnergy/3600;// convert joules to watt-hour
// empirical measures
letmaxWeight=200;// in kg
letmaxWeightAdditionalConsumption=4;// in Wh/km
letmaxTestedElevation=500;// in meters
letmaxTestedElevationConsumption=7;// in Wh/m
letbaseConsumption=14;// in Wh/km
letbaseConsumption=13;// in Wh/km, when human power is 0
letadditionalConsumptionPerKg=0.01;// in Wh/km per kg of total vehicle weight (additional losses due to increased friction, mostly independent of speed)
batteryLevel: number[];// Remaining energy in the battery over time (one entry per hour), in Wh
gridChargeCount: number;
cumulatedGridRechargeEnergy: number;// Cumulated energy added to the battery from the power grid, in Wh of battery charge (actual power grid consumption will be slightly higer due to losses)
cumulatedSolarRechargeEnergy: number;// Cumulated energy added to the battery from the solar panel, in Wh of battery charge (actual generated power is slightly higher due to losses)
totalProducedSolarEnergy: number;// Cumulated energy produced (used or unused), before accounting for the battery recharge efficiency.
cumulatedMotorConsumption: number;// Cumulated energy consumed by the motor, in Wh. In this simulation, this is equal to the energy drawn from the battery.
cumulatedHumanEnergy: number;
cumulatedDistance: number;
flatTerrainSpeed: number;
uphillSpeed: number;
downhillSpeed: number;
averageSpeed: number;
outOfBatteryDistance: number;// distance, in km, that the driver had to pedal without assistance, because the battery was empty