We validate a performance and a safety requirement in a simple model of an electrical vehicle. To do this we use the new validation functionality in the Wolfram Language. We test a design requirement for the temperature of the car battery and a performance requirement for its charge. Further analysis of the requirement validation failures easily lets us adjust our model to comply with the specified constraints. We identify design changes in the cell configuration of the battery and its resistance that improve the behavior of the system.
Lets make use of the newly introduced validation functionality in a simple model of an electric vehicle. First we perform a general exploration of the model to see the general behavior of a few variables of interest, and later we explicitly tackle 2 requirements, analyse the results and adjust the model parameters to improve our system.
The validation functionality in the Wolfram Language allows us to verify system behaviors, such as safety, performance, physical requirements or design constraints. We now have a powerful temporal statement language and can easily introduce uncertainty in parameters, initial values and inputs to match statistical validation standards. We can query information on requirement validation failures, analyse it, and easily find potential causes and fixes to accelerate our modeling workflow. Lets see this in action.

Exploration

Start with a simple model of an electrical vehicle following the US EPA Highway Fuel Economy Driving Schedule (HWFET):
In[]:=
evModel=SystemModel["DocumentationExamples.Modeling.SimpleEV"]
Out[]=
Simulate the model:
In[]:=
evSim=SystemModelSimulate[evModel]
Out[]=
SystemModelSimulationData
Model: SimpleEV
Time: 0. to 3.60×
3
10

Plot the velocity:
In[]:=
SystemModelPlot[evSim,"Velocity"]
Out[]=
mass.v
See the state of charge of the battery as the testing unfolds:
In[]:=
SystemModelPlot[evSim,"Battery SOC"]
Out[]=
battery.SOC
See the average temperature of the battery:
In[]:=
SystemModelPlot[evSim,"T",PlotRange->All]
Out[]=

Validation

The temperature in the battery can only be above 28 ºC for an interval of at most 8.5 minutes

Validate the requirement “The temperature in the battery can only be above 28 ºC for an interval of at most 8.5 minutes”:
In[]:=
valEVT=SystemModelAlwayst,!SystemModelSustain"T"[t]>28+273.15,
8.5
min
,Infinity;
In[]:=
valT=SystemModelValidate[evSim,valEVT]
Out[]=
SystemModelValidationData
Model: SimpleEV
Success rate:
0.%
, 1 failure

Show the failure plot:
In[]:=
valT["FailurePlot",1]
Out[]=
Plot the temperature with the bound:
In[]:=
SystemModelPlot[evSim,{"T",28+273.15},GridLines->{MinMax[valT["FailureIntervals",1]]/3600,None},GridLinesStyle->Directive[Thick,Darker[Red],Dashed]]
Out[]=
T
301.15
Adjust the resistance in the battery and simulate:
In[]:=
evSimT=SystemModelSimulate[evModel,<|"ParameterValues"->{"cellData.Ri"->7.1}|>]
Out[]=
SystemModelSimulationData
Model: SimpleEV
Time: 0. to 3.60×
3
10

Validate the temperature requirement:
In[]:=
SystemModelValidate[evSimT,valEVT]
Out[]=
SystemModelValidationData
Model: SimpleEV
Success rate:
100.%

Plot the temperature with the bound:
In[]:=
SystemModelPlot[evSimT,{"T",28+273.15},PlotRange->All]
Out[]=
T
301.15
While the new resistance still leads to temperatures higher that the bound, the battery does not stay hot for longer than 8.5 minutes. To see this validate the requirement “The temperature in the battery can reach at most 28 ºC” for the two values of the resistance:
In[]:=
valTRs=SystemModelValidate[{evSim,evSimT},SystemModelAlways[t,"T"[t]<=28+273.15],<|"MaxFailureIntervals"->2|>]
Out[]=
SystemModelValidationData
Model: SimpleEV
Success rate:
0.%
, 2 failures

Compute the failure interval lengths for both configurations:
In[]:=
(ArcLength/@valTRs["FailureIntervals",All])/60
Out[]=
{{0.87,8.22,8.88},{7.17,7.92}}
Less electrical power is produced with the new value of the resistance:
In[]:=
SystemModelPlot[{evSim,evSimT},{"sensor.power"},PlotRange->{All,{3000,4500}}]

The state of charge must not drop below 95% of its start value in the first half hour

Validate the requirement “The state of charge must not drop below 95% of its start value in the first half hour”:
Show the failure plot:
Redistribute the cells in the battery among the sets of those in parallel and those in series:
Use the adjusted cells and validate:
See the state of charge of the battery for both configurations:
The mileage in the second configuration is better. Extract the driving distance and used battery energy:
Compute the mileage:

Getting started

SystemModelValidate documentation page
Getting Started with Model Simulation and Analysis
New in Wolfram System Modeler
Wolfram System Modeler Documentation Center

Related talks

Wolfram Technology Conference 2024: Validating System Models
Wolfram U Webinar 2025: Simulating EV Dynamics with System Modeler

Download

Wolfram System Modeler Modelica Library Store

References

◼
  • Electrical vehicle insights: battery management system-thermal dynamics​
    by Vedat Senol, Oliver Rübenkönig and Ankit Naik​
    Wolfram Community, STAFF PICKS, July 01, 2024
    ​https://community.wolfram.com/groups/-/m/t/3202678
  • ◼
  • Electrical vehicle insights: battery management system —measurement uncertainties​
    by Vedat Şenol, Sergio Vargas and Oliver Ruebenkönig
    Wolfram Community, STAFF PICKS, July 25, 2024
    ​https://community.wolfram.com/groups/-/m/t/3234411
  • ◼
  • Electrical vehicle insights: battery management system — temperature control​
    by Vedat Şenol​
    Wolfram Community, STAFF PICKS, October 28, 2024
    ​https://community.wolfram.com/groups/-/m/t/3308846​
  • CITE THIS NOTEBOOK

    Validating performance of electrical vehicles with System Modeler and Wolfram Language​
    by Sergio Vargas​
    Wolfram Community, STAFF PICKS, August 5, 2025
    ​https://community.wolfram.com/groups/-/m/t/3524856