Showcase
Fleet calculator
A neutral calculator for hauliers facing the question of whether and how to electrify their fleet. It does not answer “how many battery modules do you buy”, it turns the question around: what does this operation actually need, and where is the bottleneck? Open-ended, along figures a haulier knows from the job rather than from an electrical engineering degree.
TypeScript, React, Vite. Calculation engine with no UI attached. Everything runs client-side, nothing goes to a server. 72 green tests, 3 seasonal scenarios. Tour and depot simulation, PV, BESS with peak shaving, TCO against diesel including the Swiss HGV levy. Max-min fair water-filling.
Where you can see how I think
Six decisions that shaped the tool, each with the price it cost.
One model, two interfaces
The same calculation engine carries two completely different ways in. An expert mode with every variable on the table, for someone who knows exactly what they are doing. And a guided, natural mode that radically simplifies the entry and works with defaults from practice. The reasoning: the hard part of a tool like this is not the arithmetic, it is the fear of the empty form. Someone meeting the topic for the first time needs a different way in than the professional, but both have to arrive at the same result. Two interfaces on one engine, not two tools, otherwise the results drift apart.
Diesel as the input, not kilowatt-hours
A haulier knows their diesel consumption, not their kWh per km. So diesel is the primary input and the tool estimates the electricity demand. The price: one more conversion running in the background. The gain: nobody has to enter something they do not know. And the diesel comparison falls out for free.
The empirical conversion factor, dropped
I first built a fixed factor, diesel divided by electricity. Checking it against real vehicles showed the factor is not constant, it shifts with the vehicle class. So out it went, replaced by two class tables that map the relative position within the range. That costs a second table and new logic. But the single number would have looked plausible and been wrong, and that is the most expensive kind of mistake there is.
Size for winter, calculate economics on the mix
Range moves with load and temperature. Size the infrastructure on the annual average and the depot suffocates in January. So the design is dimensioned on the winter peak week, while the economics are calculated on a realistic annual mix. Two views instead of one, because a single figure would have to answer two different questions.
Peak shaving must never put readiness at risk
You could shave the load peak as deep as possible, which lowers the demand charge. I capped it: shaving only so far that no truck is worse off in the morning than it would have been without. The purpose of the depot is that the trucks run. An optimisation that endangers that is optimising the wrong thing.
From a learning tool to a checking tool
At the start you use the calculator to work your way into the topic and understand which quantities decide the outcome. Later, when supplier quotes are on the table, the same calculator becomes a checking tool: you calculate against the quotes, compare solutions, see whether the numbers hold. The same tool, two phases, so the haulier does not get taken for a ride at the end.
The whole tool in 27 seconds
From input to verdict, no sound.
Four sentences to an answer
The first mode asks for the fleet the way you would describe it, not for key figures. The calculation underneath stays the same.







Every parameter in your hand
The same engine without the shortcuts: fleet by vehicle, week by day, charging infrastructure, storage and PV in detail, through to the full economics.
Interface shown in German. The expert mode screenshots have not been retaken in English.



