# How do I use the PV Array in a discrete model?

2 views (last 30 days)
I am using a PV Array block with a discrete model and I keep getting algebraic loop errors, similar to:
Algebraic state in algebraic loop containing 'zenerdiodetest/PV Array1/Diode Rsh/Product5' computed at time 0.05 is Inf or NaN. There may be a singularity in the solution. If the model is correct, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
I've tried changing the solver, but it doesn't help. Is there anything else I try?

MathWorks Support Team on 23 Jul 2021
The PV Array block contains an internal algebraic loop and in general algebraic loops are difficult for Simulink to resolve. Receiving algebraic loop errors due to a PV Array block can be avoided in either of the following 2 ways:
1. Use the "Robust discrete model" within the PV Array block, which can be found under the "Advanced Parameters" tab. This will break the algebraic loop within the PV Array block and will work more effectively with the discrete model in the "powergui". Unfortunately, it only allows for a constant temperature in the PV Array.
2. If you would like to use a time dependent temperature in your PV Array, then you can make the following changes avoid errors:
• Reduce the sample time in the "powergui", algebraic loops require smaller time steps in order to be resolved, in an example I tried I found that 0.005s was effective.
• In the Advanced Parameters tab of the PV Array set the 'Measurement filter time constant' to a value larger than the sample time in the 'powergui'. In the example mentioned in the previous point, I used double the value of the sample time, 0.01s.
• The above 2 changes will allow the model to run without error; however, it may lead to significant oscillations in the voltage. You can remove these oscillations by adding an RLC branch in parallel with the circuit connected to the PV Array to damp the oscillations.

R2020b

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by