
Why SoC output is constant in virtual vehicle composer
1 view (last 30 days)
Show older comments
I am using virtual vehicle composer, i am gettting the output of SoC as constant value i set, which must be gradually decreasing instead of remaining constant. I guess this is because of ideal voltage source. How can we overcome this.

0 Comments
Answers (1)
Mike Sasena
on 14 Feb 2025
Hi Ayush,
It depends on what powertrain option you've selected, but for many of them you can choose a different battery model from the "Powertrain / Energy Storage" node in the "Data and Calibration" tab. For example, if you select the HEV P4 powetrain option in the setup page, you get these choices for battery models:

The mapped battery option will show the current draw impacting the SoC.
On a related note, you might want to calibrate the controls and / or driver model for your application. The motor is oscillating wildly between max and min torque, so perhaps the driver gains are tuned too high.
2 Comments
Mike Sasena
on 14 Feb 2025
Yes, the options available for your vehicle depend on the vehicle class and powertrain selection. If you want to capture the battery SoC behavior on a two-wheeler application, I recommend the following:
- Use VVC to configure and parameterize your baseline vehicle model
- Generate the model
- Modify the battery system to capture the effect you want
You'll see in the battery system that it's using a subsystem variant with just a single choice, the Ideal Voltage Source:

If you look inside that subsystem, you'll see that it just has a constant block for the source of the SoC signal:

What you need to do is either add a new variant that includes a proper battery model or modify the existing variant to capture the effects you want. Powertrain Blockset includes a few options if you want a simple lookup table or equivalent circuit battery model. If you're looking for more detail, I recommend Simscape Battery, which is a product dedicated to that purpose.
See Also
Categories
Find more on Powertrain Reference Applications 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!