Simulate 1 hour SOC of the Generic Model Simscape Electrical Battery in 1 second
Show older comments
I modeled a renewables microgrid with the generic simulink battery as a source, the system is modeled with a 1e-4 sample time and hourly load profile on a 1 second time interval.
What do I have to do to make the battery block SOC behave as if 1 second of the simulation time is 1 hour? So that it follows and matches the load profile where 1 second of simulation time is the hourly load.

Accepted Answer
More Answers (3)
Javier Gazzarri
on 23 Jul 2023
1 vote
Hello Haad,
I am not sure I understand the 1sec = 1hour statement.
The battery capacity in the block is entered in Ah, so you need to discharge it for 1h at 1C rate to fully discharge it, irrespective of the model sampling rate. Simulink works in seconds by defult, so you can also replace the load input signal by scaling the time vector x 3600, but I am not 100% certain that this is what you are asking.
As a side note, please consider increasing the solver step size to make the simulation run faster if your system does not require the 1e-4sec for anything else. Typically for a battery simulation 0.1sec is OK.
Best regards,
Javier
1 Comment
Haad Yousaf
on 24 Jul 2023
Javier Gazzarri
on 24 Jul 2023
1 vote
Hello Haad,
I see two options:
1- You can scale everything that is linear so that 1sec simulation = 1h real time. For the battery SOC, for example, you divide the capacity by 3600. The problem with this approach is that I am not certain that you'll be able to obtain good results for things like temperature increase.
2- Use your load profile as input by configuring Simulink as in the attached example. Please see what I did in Configuration Parameters -> Data Import/Export -> Input.
Javier
2 Comments
Haad Yousaf
on 25 Jul 2023
Irvan Risdi
on 5 Nov 2024
Hi did you manage to make it? because I have the same problem thank you
Dennis Kachila
on 21 Sep 2025
0 votes
Hello, I had a similar problem.
Initially, my battery subsystem was designed to meet the real physical requirements: a 2P4S pack at 14.8 V, 10 Ah, capable of charge/discharge cycles over about 8 hours of operation. These requirements were satisfied correctly in the model.
The challenge arose when I attempted to integrate the battery model with the DC–DC converter subsystems (DAB/TAB). Converters typically operate on a time scale of seconds or even milliseconds, while the battery dynamics unfold over hours. Running the full model at a stop time of ~25,000 seconds was impractical and incompatible with the fast-switching dynamics of the converter.
To resolve this mismatch, I researched similar simulation issues faced by others. The common solution—also adopted in my design—was to scale the battery capacity parameter (Ah) downward, rather than scaling currents. By reducing the effective capacity in the Simscape battery block, the state of charge (SOC) dynamics were compressed into a few seconds of simulation time while leaving terminal voltage and currents at realistic levels.
Additionally, instead of using Simscape’s dedicated SOC Estimator (Coulomb Counting) and Battery CC–CV charging block, I opted for a simpler switching/relay-based control to drive charge and discharge scenarios. This kept the model lightweight while still reflecting realistic current and voltage behavior.
Two versions of the Simulink subsystem were developed for validation please see the attached model pcitures:
- Original model with a stop time of 25,000 s, showing realistic long-term behavior.

- Scaled model with a stop time of only 5 s, suitable for integration with the DC–DC converter simulation.

The 5-second scaled model proved effective, allowing the battery to interact naturally with the fast converter dynamics, while maintaining correct voltage and current waveforms. I had instead of using the inital 10A*hr capacity I used 10/3600 A*hr, thats the only thing I changed for parameters, apart from simplifying the model. as shown in the picture.
I hope it helps.
Categories
Find more on Simscape Battery in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!