For my rechargeble battery model in Simulink,i need a switch that needs to control the voltages across 2 points and according to a certain level it changes its state. To implement this in Simulink i use Voltage-Controlled Switch which belongs to a different library than by cells whose voltages are 12 Volts each. After connecting "Voltage-Current Interface(Ground)" to my circuit to connect these two objects of two different libraries i get an error stating the following. How can i fix this problem. Do you have any suggestions that i can do to accomplish my task. You can find the design and the error message below.
Is there any reason you are mixing SimPowerSystems & SimScape?
With the introduction of SimScape "SimPowerSystems", the legacy method of dealing with electrical simulations has become redundant EXCEPT for some legacy blocks and specialised technologies.
The legacy SimPowerSystems does have a more specialised battery model so I can understand why you would want to use that IF it provides features the simscape battery does not (or that you cannot reproduce...)
you can run with both as long as you provide the needed pre-requisites.
I don't see a SimScape reference block nor a solver block. Do they exist.
The actual problem here is an algebraic loop.
the subsystem highlighted within the 1st post. What EXACTLY is in there? I suspect there is some form of SimPowerSystem voltage sensor to bring a signal into the simulink domain, a Simulink-PS converter block to take it into the SimScape domain. This is where it needs to be solved.
Add a memory block in the simulink domain should break the loop and provided the needed initial condition (if you are running continuous consider adding a TF with a small timeconstant todo the same thing)
Try to avoid using simpowersystem and simscap components in the same simulation file.
To solve the simulation error, you can simply use "ideal switch" block from Simpowersystem>Power electronics library.
On the other hand you can use a DC-DC converter (boost or buck ... etc) with a dc voltage source to charge the battery. I do not see any logic in connecting a current source directly to the battery terminals.