Thank you!
4battery.plecs (821.7 KB)
4battery.plecs (821.7 KB)
Hi Jack,
Are you trying to model a system here there are 4 series connected H-Bridges with the DC bus of each bridge is connected to a capacitor and a lithium ion battery? In the model you’ve attached the problem becomes that the electrical domain now has 4 “instances” of the RC circuit but the controls domain still only has 1 “instance”. Modifying that might not be as trivial as you’ve run into yourself.
Before you dive into it though I would advise you to think about whether all of the dynamics introduced by this model of the lithium ion battery model is really necessary for you to model. I worry that even after the vectorization issue is resolved you might run into an issue where the model runs extremely slow and can be quite frustrating.
Could you get away with using a simple DC source to mimic the battery voltage at the moment in time? You’re running the simulation for about a second and I would argue that charging or discharging the battery in a second would be insignificant and could be modeled by an ideal DC source or a very very big capacitor!
Hello Munadir_Ahmed,
Thank you very much for your response and for sharing your valuable suggestions. I truly appreciate your insights and will carefully review your recommendations in my subsequent work.
Regarding my current project, I will be focusing on modeling a grid-tied high-voltage battery energy storage system (featuring multi-level H-bridge cascaded converters, higher three-phase voltage levels, and capabilities for both reactive power compensation and energy storage). To achieve this efficiently, adopting H-bridge vectorization for modeling is essential. For now, my simulation with a 4-module setup serves primarily to identify potential challenges. I also aim to clarify how to implement vectorization for the lithium battery internals, similar to how capacitor vectorization is achieved on the DC side (using parameter fields like *ones(1, num_s)).
I would greatly appreciate your guidance on this matter. Thank you once again for your support, and I hope you have a truly wonderful day!
Very cool. I’ll have to think about this a little as it’s not quite trivial. However, would a solution like this be sufficient?
I’ve cheated quite a lot here to get rid of the “controls vectorization issue” you are seeing but maybe it gets you where you need to go?
lithium_ion_batt_vectorized.plecs (57.6 KB)
Hi,Munadir_Ahmed,
Thank you for your response. I have just reviewed the updated model you kindly shared. I noticed that the variable RC branches within the lithium battery module have been removed, simplifying the internal structure to a resistive-only configuration.
While I find this streamlined approach quite practical, I wish to humbly seek your insight on whether this modification might impact the simulation accuracy of the larger integrated system in my subsequent work. To ensure scalability, I still intend to pursue proper vectorization of the lithium battery — similar to our DC-side capacitor implementation — as this will significantly facilitate my future modeling tasks.
Nevertheless, I sincerely appreciate the time and expertise you invested in refining this model. Your guidance remains invaluable to my progress!
Hi Jack,
Like I mentioned I cheated quite a bit but here is my thought process on why it should be ok for you.:
Basically, in summary my suggestion is to use the simplified model to get the rest of your design done because the RC branches in your particular simulation won’t get you too much.
Here is an experiment you can quickly run to see if the RC branches add anything to your simulation. Set the number of series connected converters to 1 (so there is no vectorization error when using RC branchs) and then run some of your test cases with and then without the RC branches. Observe the differences and then try to figure out if those differences add anything to your model before you bang your head on the table trying to figure out the vectorization issues.
If you determine that RC is necessary then I would highly recommend that you analyze if a variable RC is necessary or can you use a simple fixed resistor and capacitor combination. That too will make your life much simpler. Hope these help!
Best of luck with your work.
Munadir