MATLAB: Simscape powersystems specialized tech – PV Array Block – Simulation Errors

powersystemspv array blockSimscapesimulink

Hi there, I've been having some problems with the included simulink PV Array block on the simscape power systems library.
https://au.mathworks.com/help/physmod/sps/powersys/ref/pvarray.html
Basically every time I tried to get the open circuit voltage the simulation gives me an error. I already tried different scenarios using discrete/continuous solvers but it behaves erratically.
Enabling the advance parameter to break the internal algebraic loop doesn't work at all.
At the end I've always decided to built my own model from scratch and proceed with my projects but would be great to hear from someone how to fix it.
Basically if you connect the panel to a resistor this will happen: (at least to me) 1. Discrete mode / breaking internal algebraic loop = simulation completes but no data is shown on the scopes 2. Discrete mode / enabling internal algebraic loop = simulation works and data is shown only when the resistance is less than aprox 500 ohms. 3. Continuous mode / breaking internal algebraic loop = simulation works and data is shown only when the resistance is less than aprox 150 ohms 4. Continuous mode / enabling internal algebraic loop = simulation works and data is shown only when the resistance is less than aprox 5 ohms.
Obviously, if you want to add a power converter switching the terminals of this block, it blows away everytime it sees open circuit state.
Thanks in advance for those curious to try and see if they can replicate this nonsense.
Kind regards, David

Best Answer

After completing many tasks of my current project I found the answers of all my questions. Here the details.
  1. When using Simscape powersystems specialized tech, use discrete mode. Continuous mode will give you an approximate result. On the solver settings try to use variable step/ode23t. Fixed step will work if the sample time is small enough. (depends on the system)
  2. The pv array block with a simple resistor:
  • With a high resistor, the PV is in open voltage and the block model is causing a big voltage spike at the beginning of the simulation. You can see it by setting up a very small sample time (1e-7).
  • The solution is to place a parallel capacitor to limit the voltage surge. 10 uF will do but it depends on your system and if you will use it also for some sort of signal filtering.
Hopefully it will help any one with my same issues/question.