Code covered by the BSD License  

Highlights from
Lithium Battery Model, Simscape Language and Simulink Design Optimization

4.66667

4.7 | 3 ratings Rate this file 162 Downloads (last 30 days) File Size: 944 KB File ID: #36019
image thumbnail

Lithium Battery Model, Simscape Language and Simulink Design Optimization

by

 

19 Apr 2012 (Updated )

Multi-temperature lithium battery model using Simscape language and Simulink Design Optimization

| Watch this File

File Information
Description

This file contains multi-temperature lithium battery model examples with thermal dynamics that are implemented using the Simscape language. There are equivalent circuit model examples containing 1 RC branch and 2 RC branches, plus an 80-cell battery pack model. The number of branches can be chosen to balance fidelity and parameter estimation complexity. These models are implemented using Simulink and Simscape language.
----------------------------------------------------------------------------
Simulink Design Optimization can be used to estimate battery parameters from experimental battery data. To see how, please watch this video (5 min):
http://www.mathworks.com/videos/estimating-parameters-of-a-battery-68957.html
Automating parameter estimation to match multiple measured data sets at different temperature and current data is a complex task that can be automated. To learn how MathWorks Consulting can teach you this technique, please see these:

Webinar: Automating Battery Model Parameter Estimation using Experimental Data
http://www.mathworks.com/videos/automating-battery-model-parameter-estimation-using-experimental-data-81987.html

MathWorks Consulting: Battery Simulation and Controls
http://www.mathworks.com/services/consulting/proven-solutions/battery-simulation-and-controls.html

SAE 2013: Battery Model Parameter Estimation Using a Layered Technique
http://www.mathworks.com/tagteam/76117_SAE%203013%20-%20Battery%20Estimation%20Layered%20Technique.pdf

----------------------------------------------------------------------------

These additional available publications and recorded webinars provide more information about battery modeling and simulation:

Webinar: Battery Data Acquisition and Analysis Using MATLAB
http://www.mathworks.com/videos/battery-data-acquisition-and-analysis-using-matlab-89170.html

Webinar: Lithium Battery Model with Thermal Effects for System-Level Analysis
http://www.mathworks.com/videos/lithium-battery-model-with-thermal-effects-for-system-level-analysis-81886.html

IEEE 2012: Lithium Battery Model with Thermal Effect
http://www.mathworks.com/tagteam/71900_IEEE%202012%20High%20Fidelity%20Lithium%20Battery%20Model%20with%20Thermal%20Effect.pdf

SAE 2013: Simplified Extended Kalman Filter Observer for Battery SOC Estimation
http://www.mathworks.com/tagteam/76108_SAE%202013%20-%20Simplified%20EKF%20Battery%20Model.pdf

Webinar: Optimizing Vehicle Electrical Design through System-Level Simulation
http://www.mathworks.com/videos/optimizing-vehicle-electrical-design-through-system-level-simulation-81919.html

----------------------------------------------------------------------------

To find other physical modeling examples, search for posts with the keyword "physical modeling"
http://www.mathworks.com/matlabcentral/fileexchange/?term=%22physical+modeling%22

To learn more about MathWorks Physical Modeling Products, go to:
http://www.mathworks.com/physical-modeling/

----------------------------------------------------------------------------

Acknowledgements

This file inspired Automotive Electrical System Simulation And Control.

Required Products Optimization Toolbox
Parallel Computing Toolbox
Simscape
Simulink
Simulink Design Optimization
MATLAB
MATLAB release MATLAB 7.14 (R2012a)
Other requirements R2012a or later recommended, R2010b or later required
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (22)
10 Jul 2014 Johnny Rico

The downloaded zip archive appears to be damaged. I request the author to kindly re-upload the same.

Regards,
Johnny

23 May 2014 Ali Rostami

I have troule downloading the file from Mathworks.com
the error message is " the site is unavailable or cannot be found.
"
Has anyone experienced the same or any solution?
Thanks
Ali

16 Apr 2014 han  
25 Feb 2014 Robyn Jackey

I will be presenting during a workshop entitled "Developing Battery Management Systems Using Model-Based Design" at the American Control Conference on June 3rd in Portland, OR. If you are interested in attending, please see:

http://www.iet.unipi.it/f.baronti/acc14/registration.html

http://a2c2.org/conferences/acc2014/workshops.php#11

24 Feb 2014 Robyn Jackey

Lu - can you email me directly through the contact author page?

23 Feb 2014 Lu

Hi Robyn, thank you for sharing.

I have a question about the paper"SAE 2013: Simplified Extended Kalman Filter Observer for Battery SOC Estimation
".

In this paper, you model the hysteresis effect, and use k as the hysteresis factor.
how can I understand the following sentence in Page5"The value of k was obtained by inspection by minimizing the difference between the experimental and simulated VOC vs. SOC curves. VOC(VSOC) is the instantaneous value of the OCV on the minor loop."

what's the experimental VOC(VSOC),is caculted by(VOCch(VSOC)+VOCdisch(VSOC) )/2?
and what's simulated VOC(VSOC), is the difference between measured terminal voltage (Vt) and VRC?

would you please share the progress of k fitting.

thanks

27 Jan 2014 Robyn Jackey

Christopher - I have not seen that license error before. Can you please try contacting MathWorks technical support?

24 Jan 2014 Christopher

I was trying to follow the instructions in the README file, but step 2 is giving me a couple similar errors, for example:
"Error using save_system>i_builtin (line 188)
Cannot save this library because block R_table_1Temp requires a license for , which could not be obtained.
Please try again when a license becomes available."

I am using Matlab R2013A, Simulink 8.1, Optimization Toolbox 6.3, Parallel Computing Toolbox 6.2, and Simscape 3.9. It doesn't look like I Have the Simulink Design Optimization, but I don't think that's what is causing the error that I am seeing. Do you have any suggestions? I looked under the Simulink examples, and I don't see the battery demo even though it is supposed to ship with it.

Thank you!

19 Nov 2013 Robyn Jackey

With R2013a and later, the ssc_lithium_cell_1RC and ssc_lithium_cell_2RC, along with the library LiBatteryElements are now shipping Simscape demos. The shipping versions should be used, because of a Simscape change requiring use of Kelvin rather than Celsius in Simscape language code. The additional demos in this MATLAB Central entry should work, just ensure that the older LiBatteryElements libraries are not added to your MATLAB search path, so it uses the shipping versions.

13 Nov 2013 Maryam Bahramipanah

Thanks Robyn. I did exactly what is written in Readme.text, but by running "ssc_build LiBatteryElements" , I am receiving this error :
Error using LiBatteryElements.C_table (line 9) Input 'T' declared with unit expression that contains an affine unit: 'C'. Affine units are not allowed when declaring members of this type.

:(. I am using the R2012a files.

12 Nov 2013 Robyn Jackey

Hi Maryam,
You might need to add all the directories to your MATLAB search path first. To fix the error you encountered, you might need to rebuild the Simscape library for your platform and MATLAB version. There are directions in the included readme.txt file.
-Robyn

11 Nov 2013 Maryam Bahramipanah

Robyn, I found that I have to run the liBatteryelemets before. SO, I have no problem with that any more. But there is another problem :( . when I started the estimation, I received this message "index exceed matrix dimension". Do you know what is it for?

11 Nov 2013 Maryam Bahramipanah

Hello. First of all thanks for uploading the files.

When I am trying to open each elements of the model (for instance R_table_1Temp), I receive this error:

"
Error Id: ne_dli: internal: unableToCreatDialog

unable to creat block dialog. If the block belongs to a custom simscape library, please run ssc_build to rebuild the library...."

Can you please help me with that?

Regards

07 Jun 2013 zwbscg  
15 Apr 2013 Robyn Jackey

For R2012b and later, there are shipping demos of ssc_lithium_cell_1RC and ssc_lithium_cell_2RC models. the LiBatteryElements package is also part of the shipping Simscape demo, so it's not included in the R2012b folder of the zip file.

15 Apr 2013 Vita

Isn't there any LiBatteryElements package in the R2012b folder?

03 Dec 2012 Robyn Jackey

Hi Mengjia - Unfortunately the errors you see are expected and the model will not work in R2010a or earlier. The early versions of Simscape lookup tables required all dimensions to be a minimum of size 4, and my demo model only contains 3 temperatures. It will work fine in newer releases, otherwise it might work if you add a fourth temperature to the data for each lookup table.

03 Dec 2012 Mengjia

Hello, I've got errors as below running ssc_lithium_cell_1RC.mdl

1. ssc_lithium_cell_1RC/Solver Configuration: Unable to compile the physical network.

2. sc_lithium_cell_1RC/Lithium Cell (1RC equivalent circuit model)/Main Branch Voltage Source (Em)/PS Lookup Table (1D): The size of the vector of input values or output values must be greater than 3.

3. ssc_lithium_cell_1RC/Lithium Cell (1RC equivalent circuit model)/C1/PS Lookup Table (2D): Y-vector must have no less than 4 elements.

And for other 3 lookup tables(2D) I've got the same Y-vector elements issue, so totally 6 errors.

I've followed the 2 steps as readme.txt stated, please kindly advise where go wrong?

PS: I am using the Matlab R2010a to run the files in folder R2010b.

12 Jul 2012 Robyn Jackey

To answer your questions:

1. In the paper, we chose the initial conditions based on the driving cycle we used for validation. The temperature T=20 was based on a measured cell temperature (approximately same as electrolyte). Initial SOC was selected based on best fit of the measured vs simulated voltage at the very beginning part of the drive cycle.

2. You can modify the InputData*.xls files and import them into the Signal Builder block if you like to change the input curves. However, you will need to delete the "Copyright ..." string that was placed in cell E1 to avoid an error. Otherwise, Signal Builder tries to import data from column E, causing the error you found.

10 Jul 2012 dang hong

Dear Sir,
In reference paper " high fidelity electrical model with model with thermal dependence for characterization and simulation of high power lithium battery cells", how to choose initial SOC = 45 %,T =20, ? For example, in the case of using ssc_lithium_cell_1RC.mdl.
when importing "InputData_1RC.xls" in signal builder of ssc_lithium_cell_1RC, there is a error " attempted to access td(:,3); index out of bounds because size(td)=[46,2]. How to import that file?

05 Jun 2012 Robyn Jackey

The R2012a folder contains files that use newer features that will only work on R2012a or later. I suspect that is the reason for the build error. The R2010b model should work in that version and up, however it is a little less tidy because the lookup tables were external to the custom Simscape language blocks.

04 Jun 2012 david

run ssc_build LiBatteryElements

the following errors apeared.

Generating 'LiBatteryElements_lib.mdl' in the current directory 'C:\Documents and Settings\Jiucai\My Documents\Downloads\ssc_Li_cell_20120419\ssc_Li_cell_20120419\R2012a' ...
Failed to generate 'LiBatteryElements_lib'

Caused by:
Error using ne_buildpackage (line 32)
File: C:\Documents and Settings\Jiucai\My
Documents\Downloads\ssc_Li_cell_20120419\ssc_Li_cell_20120419\R2012a\+LiBatteryElements\C_table.ssc
Line: 13
Attribute Size is not supported for constructs of type
parameter.

Updates
19 Apr 2012
19 Apr 2012

Updated copyright statement, link to webinar.

15 Jun 2012

Added link to demo video. Removed extraneous Simscape mex files. (Note: you will need to run "ssc_build LiBatteryElements" to build a machine-specific Simscape library for the battery building blocks.

02 Jul 2012

Added 80-cell battery pack model.

19 Dec 2012

R2012b folder with .SLX file format. Excluded R2012b +LiBatteryElements folder because it is a shipping demo.

ssc_lithium_cell_SDO_Project.mat parallel computing unchecked as default, due to a bug if the toolbox is not installed. See Readme.txt

11 Jun 2013

Updated the R2012b+ version of the models:
1. The shortcut block to open the custom library was broken
2. Use Kelvin temperature units within the Simscape model

There is a known bug in R2013a. Please see README.txt for info.

13 Jun 2013

Modified description only to add links to new publications.

18 Jun 2013

Fixed an issue with temperature units on R2012b demos.

26 Jun 2013

Updated a bad link to the parameter estimation video.

10 Sep 2013

Added a new webinar link to the description

28 Jan 2014

Updated description only. No file changes.

25 Mar 2014

Description updated - added a link to the Battery Data Acquisition webinar. No changes to the files.

18 Apr 2014

Added acknowledgement for other entry - electrical system simulation

22 Apr 2014

Corrected webinar links

Contact us