I'm having trouble understanding a small portion of a code for partial shading of PV array, I don't know from where these equations were taken and what their purpose is. Any form of help will be really appreciated. Here is the code:
%%%%Cheaking The Condition That log((Iph-I+Ir)/Ir) Is Real Or Not%%%%%%%
It is a verification of variable “po”. If “po” complex (“(Iph-I+Ir)/Ir” negative) the voltage “Vc” is declared zero (because Vc=0.01 in line 21) otherwise Vc is calculated with the Eq. in line 109. Additionally, if “Vc” negative, “Vc” is declared 0.01 (lines 119-127). The voltage cannot be complex or negative (I guess that is a CD circuit). I guess that if there is not enough solar energy, the voltage is zero or 0.01.