View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Automotive Electrical System Simulation and Control

4.6 | 7 ratings Rate this file 66 Downloads (last 30 days) File Size: 306 KB File ID: #25674 Version:
image thumbnail

Automotive Electrical System Simulation and Control


Robyn Jackey (view profile)


28 Oct 2009 (Updated )

A conventional vehicle electrical system model with alternator, battery, loads, and idle control.

| Watch this File

File Information

This model shows an example of a conventional vehicle electrical system model, which was shown in the webinar "Optimizing Vehicle Electrical Design through System-Level Simulation". The model is intended to study component sizing, selection, and control.
The electrical system model contains a Simscape lead-acid battery model as described in SAE Paper 2007-01-0778. There are two choices for battery size.

The model also contains data-driven alternator model options using either look-up tables or Model-Based Calibration Toolbox blocks. The alternator model is described in SAE Paper 2007-01-3471.

Control may be added to monitor the system condition, and increase idle speed to compensate for bad conditions in the vehicle charging system.

Vehicle loads are modeled as variable resistive elements.


Simulink Design Optimization can be used to estimate battery parameters from experimental battery data. To see how, please watch this video (5 min):

Parameter estimation for these models from measured data sets at different temperature and current data is a complex task. To learn how MathWorks Consulting can teach you this technique, please contact us or see:

MathWorks Consulting: Battery Simulation and Controls



Lithium Battery Model, Simscape Language And Simulink Design Optimization inspired this file.

This file inspired Lithium Battery Model, Simscape Language And Simulink Design Optimization.

Required Products Simscape
MATLAB release MATLAB 7.9 (R2009b)
Other requirements Optional requirements: Stateflow Model-Based Calibration Toolbox
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (13)
29 Nov 2016 Anish Salvi

13 Oct 2015 Robyn Jackey

Robyn Jackey (view profile)

Hi Raghuveer,

The battery block re-runs the initialization file ssc_lead_acid_battery_XXAh_ini.m when the simulation starts. You should modify the file directly to change theta_init. You will also need to set Qe_init differently at the end of the file because the spline didn't work right. I just set it to zero and it worked.

Note the under hood temperature in the Vehicle Inputs block will cause the battery temp to rise over time.

Comment only
01 Oct 2015 Raghuveer Sivakumar

Hi Robyn

I have been using your model and find it very useful. I was wondering if its possible to change the simulation condition to represent a cold setting i.e. temperatures of -10 degrees. I did try and change Theta_init, but when I ran the simulation it changed back to 25. Can you please tell me how to achieve cold simulation


25 Sep 2014 Robyn Jackey

Robyn Jackey (view profile)


You will need to remove the 3D lookup as you mention. If you want to control power output, you will also need to modify the control loop that is adjusting alternator current to meet the voltage setpoint that was coming out of that lookup before.

If you want to discuss more or want some consulting assistance with this, please go to the "contact author" link to email me directly.

Comment only
24 Sep 2014 Christopher

Hia Robyn,

Unsure if this is the right place to try and contact you, but I really enjoy the model and think it's a fantastic approach to solving the problem of no alternator/battery plant model.

I hate to ask a question, however, I'm trying to figure out how to modify it a bit so that I can give it a setpoint to try and regulate to based on a given vehicle load and engine speed speed; I'm looking to see the generator duty cycle modulate based on trying to maintain a power output given a battery voltage of my choosing.

Hopefully that makes sense!

This is instead of the 3d lookup based voltage setpoint that's based on temperature/current/engine rpm... do you have any suggestions as an easy way to do that?

12 Sep 2014 Vinicius

29 Jul 2014 Rani V.S

Rani V.S (view profile)

07 Mar 2014 Bella

Bella (view profile)

Hi Robyn,

I have read your SAE paper on battery modelling and I would like to know if it would eb possible for you to provide a Simulink-only version of the battery model.

Thanks in advance!

Comment only
09 Dec 2013 Nyeinsu

Hi, the model is great.
I am very new to simulink and I need to implement lead acid battery model.
May I know how to do the lead acid model with blocks.

Comment only
03 Apr 2013 Robyn Jackey

Robyn Jackey (view profile)

Hi David,

Roughly speaking, change the Costar parameter (capacity at 0°C – I think units are either Amp-seconds or Amp-hours) to match the capacity you want. Other resistance parameters may be inversely proportional to the change in capacity, so if you cut the capacity by half you would double the resistances.

If you need a detailed match to a specific model of battery, it gets a bit more complicated. I offer consulting service to help teach techniques to match the model to measured data.


Comment only
02 Apr 2013 David

David (view profile)

The model is good, I am just wondering how to get a lower A/h battery like 21 A/h?

Comment only
02 Jul 2012 Arpita

Arpita (view profile)

30 Jun 2010 Charlene (Fatima) Leung-Wai

02 Dec 2009 1.2

Updated model settings.

07 Dec 2009 1.3

updated broken webinar link in description

07 Dec 2009 1.5

Minor update to directions in Readme.txt.
Changed solver setting to "nonadaptive" to avoid warnings.

05 Nov 2012 1.6

Updated the description with new webinar link. Referenced alternator paper available from SAE.

05 Jun 2013 1.7

Added an updated model for R2012b and later.

28 Jan 2014 1.8

Updated description only. No file changes.

18 Apr 2014 1.9

Updated the description and acknowledgement

01 Sep 2016

Updated license

Contact us