Asia/Kolkata
Driveline TCO - Alternative Drivetrain Comparison & Route Analysis Platform
ProjectsApril 15, 2026

Driveline TCO - Alternative Drivetrain Comparison & Route Analysis Platform

image
Fleet operators evaluating alternative drivetrains - diesel, HVO, eFuels, biofuel, hydrogen ICE, hydrogen FCEV, battery electric - sit between marketing brochures and PhD-grade simulators. They need a tool that takes operating conditions and returns honest numbers across all seven options, with the assumptions visible. Driveline TCO is that tool. It does three jobs: predict consumption, calculate total cost of ownership across the holding period, and check whether a chosen drivetrain can actually complete the routes the fleet runs. Engineering lead on a client engagement (March - April 2026) for an automotive firm in Munich. Scope was user-facing structural improvements to an existing TCO comparison tool: tightening the calculation surface, reshaping the four-page Streamlit UI, hardening the route-feasibility solver, and growing the test suite to 115 cases. Milestones landed ahead of schedule. Ownership is not a slogan when you are the only engineer on the engagement. Every decision documented here - from which formula to use for battery degradation to whether the language toggle should reset state - was mine to make and mine to defend. Calculation Core
Three independent engines: a consumption model using multiplicative correction factors, an eleven-component TCO calculator, and a route feasibility solver that treats stop planning as constraint satisfaction. Each engine is a Python module with its own test suite. The UI consumes them, never the other way around.
Configuration Layer
Every default lives in defaults.json. Drivetrain specs, WTW efficiencies, fuel prices, residual value matrices, charging infrastructure costs - all of it. The UI exposes overrides for every value. When the underlying numbers move, the file moves; the code does not.
UI Layer
A four-page Streamlit app. Dashboard with a radar chart across all seven drivetrains. Consumption and range with adjustable conditions. TCO calculator with a multi-year cost breakdown. Route feasibility with a map and stop planning across European routes.
Data
JSON-driven from end to end. Drivetrain configurations, route definitions, refueling and charging station catalogs - all under version control, all human-editable.
Multiplicative correction factors for consumption.
Adjusted consumption is base times topography times load times temperature times the cwA and rolling-resistance ratios. Each factor is independent and tunable. First-order approximation is enough for relative comparison between drivetrains; chasing VECTO-grade absolute accuracy was scope I refused.
Composable cost components for TCO.
Eleven independent line items - vehicle, financing, energy, maintenance, tires, tolls, taxes, insurance, depreciation, battery replacement, charging infrastructure - each computed in isolation and summed. Sliders mutate inputs and the breakdown re-renders in real time.
Stop planning as constraint satisfaction.
Route feasibility does not simulate a driver. It asks whether, given range, available stations, and the route polyline, a valid sequence of stops exists. The answer is a recursive search that fails fast on infeasible drivetrain-route pairs.
Battery degradation modeled within the validated envelope.
Field-validated state-of-health data exists up to 120,000 km per year. The tool refuses to extrapolate beyond what has been measured; higher mileages are documented in text but not surfaced in calculations. Honest beats impressive.
Three policy scenarios for post-2031 toll exemptions.
Zero-emission vehicles are toll-exempt in Germany until June 30, 2031. What happens after is unknown. The tool models three futures - full rate, 75% discount, exemption extended - as a user-toggleable input rather than a hardcoded assumption.
Bilingual UI through a single label registry.
Roughly 200 strings keyed by language; the toggle swaps the active map. Switching language triggers a Streamlit rerun, which resets widget state. Documented in the user guide rather than over-engineered around.
Scope discipline
Every feature request had a "do we need this for the decision?" gate. Real-time fuel-price APIs, machine-learned consumption models, multi-currency support - all proposed, all deferred. The tool ships because what is in it earns its keep.
Working within client confidentiality
Cost defaults are informed by client-supplied industry data that cannot be exposed. The toll module, by contrast, references only public legislation: BFStrMG amendments, EU Directive 2022/362, published Toll Collect rates. Public modules stay independently citable; confidential inputs stay sealed.
Reproducibility
Every analysis exports to CSV with the full input set. A stakeholder can replay a calculation a year from now with the exact assumptions that produced it. No "I think we used these numbers" emails.
Seven drivetrains modeled with full WTW pathways and cost curves.
Eleven cost components in the TCO breakdown.
Three calculation engines with independent test suites.
115 tests passing across consumption, TCO, and route feasibility.
~6,800 lines of Python, German and English UI, four European routes mapped.
Ahead of schedule on every milestone; user-facing improvements suggested and shipped within the engagement window.
Python 3.9+ · Streamlit · NumPy · Pandas · Plotly · Folium · pytest · Docker

Related projects

@testdino/playwright - Streaming Playwright Results Out of CI

@testdino/playwright - Streaming Playwright Results Out of CI

The client half of a CI test-observability platform, published on npm. A Playwright reporter and CLI that streams each result as it completes, with dual-transport failover, byte-aware batching, and a liveness heartbeat that tells a slow test apart from a dead shard. Principal author across nine months alongside five other contributors.
Saral - AI-Powered Recruiting Search Platform

Saral - AI-Powered Recruiting Search Platform

Designed the platform architecture and owned backend, infrastructure, and the search data flow. Semantic candidate search over 119k profiles with progressive backfill, LLM fallback, and per-page credit billing.
TestDino - AI-Powered Test Intelligence Platform

TestDino - AI-Powered Test Intelligence Platform

Forward deployed engineering from day one. Architected a SaaS platform handling 2M+ test executions for 80+ organizations. Built the backend, led the team, shipped to production.
TestGenX - AI-Ready Parallel Test Execution Engine

TestGenX - AI-Ready Parallel Test Execution Engine

Platform engineering project: Built a distributed test execution system from scratch. 200 parallel VMs, 7 hours saved weekly, zero-touch automation.