Synthetic electric vehicle (EV) charging session data for Tangier,
# Synthetic--EV--charging-session-data-for-Tangier
Synthetic electric vehicle (EV) charging session data for Tangier,
Overview
This project generates synthetic electric vehicle (EV) charging session data for Tangier, Morocco, using a physics-aware, behavior-driven simulation tied to real stations and a fixed fleet of EVs in Tangier.
It produces:
- tangier_ev_charging_synthetic.csv — per-session records (station, EV model, timestamps, SOC in/out, kWh, ambient temperature, queue wait, etc.)
- station_daily_report.csv — daily per-station KPIs (sessions, energy, utilization, peak concurrency, queue stats)
---
## What the Code Does
This README reflects the current MATLAB script in this repo. Where helpful, we mention inspiration; however, the formulas below are exactly what the code implements.
1) Daily driving -> need to charge
Each vehicle draws a daily distance from a mixture of log-normals to create diversity of trip lengths:
- Probabilities 0.45 / 0.40 / 0.15 for short (logN(mu=log 12, sigma=0.5)), medium (logN(log 35, 0.5)), long (logN(log 90, 0.6), capped at 250 km).
Temperature-dependent energy per km:
- e_km(T) = e0 * (1 + a*max(0,20 - T) + b*max(0, T - 30)), with e0=0.16, a=0.008, b=0.004.
Trip energy: E_trip = D * e_km(T). SOC update: dSOC = 100 * E_trip / B (battery B in kWh).
The probability of attempting to charge today is a range-based logistic (different thresholds for AC vs DC urgency):
- p_AC = 1 / (1 + exp((range_km - Rth_AC)/k_AC)), with Rth_AC=40 km, k_AC=20.
- p_DC = 1 / (1 + exp((range_km - Rth_DC)/k_DC)), with Rth_DC=120 km, k_DC=25.
- p_need = max(p_AC, 0.25 * p_DC).
Why: This yields emergent, city-level arrivals without forcing a Poisson process. It couples the charging need to the actual remaining range after daily driving.
2) Arrival time within the day
Given the vehicle decides to charge, we draw one timestamp within the day using a two-peak intraday profile (morning & evening), sharpened by a shape knob lambda0_time_shape:
- w(h) pr …