Shell Eco-Marathon Vehicle Simulation — V8

Stateflow hysteresis control, corrected powertrain geometry, shaft-power fuel accounting, and parameter sweep optimization.


Overview

Version 8 represents a major accuracy overhaul across three independent subsystems. While V6 introduced the burn-coast control philosophy, several fundamental modeling errors were identified and corrected in V8 that significantly affect simulation fidelity and fuel predictions.

The most impactful corrections were a wheel radius error that had been halving the engine RPM throughout the powertrain, a driver strategy that lacked an upper speed cutoff causing the engine to run continuously, and an energy model computing fuel consumption from net vehicle force rather than engine shaft power. Each of these issues independently produced incorrect results — together they made quantitative fuel predictions unreliable.

V8 also introduces the first full parameter sweep with Shell competition scoring (km/L), producing actionable design sensitivity rankings for the engineering team.


V8 Changelog

FIX Wheel radius correctedr_w was set to 0.508 m (the wheel diameter) instead of 0.254 m (the radius). This caused engine RPM to be calculated at half the true value, pushing the operating point below the valid engine map range and returning NaN torque values.
FIX RPM idle limit correctedRPM_idle was set to 1800 RPM, below the engine map minimum of 2708 RPM. Updated to match the dyno map lower bound.
NEW Stateflow hysteresis driver strategy — The V6 burn-coast controller only implemented a lower speed threshold, meaning the engine had no upper cutoff and ran continuously past the target speed. A Stateflow state machine replaces the comparator-switch logic with a proper two-state hysteresis controller. The engine burns when velocity drops below v_low_on and coasts when velocity exceeds v_high_on.
FIX Energy model rebuilt on shaft power — The V6 energy model computed fuel from F_net × v, which underestimates fuel input. The corrected path integrates engine shaft power (T_engine × ω_engine), then divides by engine efficiency and fuel LHV.
FIX LHV constant corrected — The EnergyModeling block contained 4,400,000 J/kg instead of the correct 44,000,000 J/kg, producing fuel estimates 10× too high.
NEW Shell scoring metric (km/L) — All parameter sweeps now report km/L equivalent, matching the Shell Eco-Marathon competition scoring formula.
NEW Four-parameter sweep with sensitivity ranking — SweepV8b evaluates burn-coast speed band, gear ratio, vehicle mass, and drag coefficient independently using a middle-80% window averaging method to eliminate startup and end-cycle artifacts.
PENDING BSFC map — Engine efficiency is currently fixed at 20%. A 2D brake-specific fuel consumption map will replace this once the senior team completes dyno runs.

Driver Strategy — Stateflow Hysteresis

V6 Strategy — Single Threshold (Incomplete)

V8 Strategy — Stateflow Two-State Machine

Stateflow chart Stateflow State Machine — V8 DriverStrat
Throttle command square wave Throttle Command — clean square wave with correct upper cutoff

Velocity Profile — Coast Curve Validation

With the corrected wheel radius and Stateflow upper cutoff, the velocity profile now behaves physically correctly — the vehicle accelerates during burn, peaks at v_high_on, then decelerates along an exponential decay curve during coast.

Coast Shape Diagnostic Result (V8)

Linear fit RMSE:     0.00525 m/s
Exponential fit RMSE: 0.00066 m/s

Result: CURVED (exponential) — physics correct ✓
The exponential fit is 8× more accurate than linear, confirming aerodynamic and rolling resistance forces are correctly modeled.
Vehicle velocity vs time Velocity vs Time — correct oscillation between v_low_on and v_high_on
Coast shape diagnostic Coast Shape Diagnostic — exponential fit confirms correct physics

Baseline Simulation Results (V8)

Standard run: v_low=6.5, v_high=7.5, G=10, m=100 kg, Cd=0.30, t_end=200s

1451 m
Distance Covered
7.23 m/s
Average Speed
7.91 m/s
Max Speed
2.8 kJ
Mechanical Energy
2.02 g
Fuel Consumed
651 km/L
Shell Score (est.)
Note on fuel estimate: Engine RPM at v_target = 7 m/s with G = 10 and r_w = 0.254 m is approximately 2632 — just below the map minimum of 2708 RPM. The RPM saturation block clamps to the map boundary. Fuel estimates will improve once dyno data below 2708 RPM and a BSFC map are available.

Parameter Sweep Results

SweepV8b evaluated four design parameters independently across a 1000s simulation window. Middle-80% window averaging eliminates startup transients and incomplete end-cycles.

Sweep 1 — Burn-Coast Speed Band

Sweep 2 — Gear Ratio

Gear ratio swept from G=7 to G=14. The km/L variation across this entire range was only ±3.3%, confirming gear ratio has minimal effect on efficiency. The practical constraint is keeping engine RPM within the valid dyno map range (2708–8708 RPM) at operating speed.

Sweep 3 — Vehicle Mass

Mass swept from 80 kg to 200 kg. Every 10 kg of additional mass costs approximately 30–40 km/L. Rolling resistance scales directly with mass, requiring more frequent and longer burn cycles to maintain speed.

Sweep 4 — Drag Coefficient

Cd swept from 0.10 to 0.50. Reducing Cd from 0.50 to 0.10 nearly doubles the Shell score from 500 to 933 km/L.


Design Sensitivity Ranking

Percentage improvement from worst to best value within each sweep range — higher value means higher design priority.

Drag Coeff 86.5%
Mass 75.3%
Speed Band 26.0%
Gear Ratio 3.3%

Key takeaway: Aerodynamic drag reduction and mass minimization are nearly equal in importance and both have far more impact than drivetrain tuning. Gear ratio only needs to keep engine RPM within the valid map range — beyond that it is not a meaningful optimization lever.

Simulation Gallery


Model Architecture (V8)


Command Window Output

Representative output from analyzeV8_shell_eco.m and SweepV8b.m.

=== Shell Eco Run Results (V8) ===
Distance:          1451.1 m
Energy (mech):     2.8 kJ
Fuel consumed:     2.02 g
Avg Speed:         7.23 m/s
Shell Score:       536.1 km/L

--- Coast Shape Fit ---
Linear RMSE:       0.00525 m/s
Exponential RMSE:  0.00066 m/s
Result:            CURVED (exponential) — physics correct

--- Sweep Summary (V8b) ---
Speed band:   v_low=5.5, v_high=7.0 → 704.5 km/L
Gear ratio:   G=13.00 (RPM=3421)    → 659.3 km/L
Mass:         m=80 kg                → 734.7 km/L
Drag coeff:   Cd=0.10                → 933.2 km/L

--- Sensitivity Ranking ---
Speed band:   26.0%
Gear ratio:   3.3%
Mass:         75.3%
Drag coeff:   86.5%

MATLAB & Simulink Scripts

View Source Code on GitHub


Future Work (V9)