## 2 Mathematical Formulation of OPF Problem
### Mathematical Modeling of Uncertainties in RES  
There might be a situation in which the RES real power is below the forecasted power, which is referred to as over estimation. The system must be capable of having a reserve source to deliver the continuous power supply to consumers. The cost assigned to generating units of the reserve source, supplied to fulfill the deficit of overestimated units, is named the reserve cost.  
Reserve cost for the overestimated units can be expressed as:  
\[\begin{array}{l}\mathrm{C}_{\mathrm{Rw}j}=K_{Rw,j}(P_{\mathrm{w}sch,j}-P_{ \mathrm{w}ac,j})\\ =K_{Rw,j}\int_{0}^{P_{\mathrm{w}sch,j}}\left(P_{\mathrm{w}sch,j}-P_{\mathrm{w} ac,j}\right)f(p_{w,j})dp_{w,j}\end{array} \tag{7}\]  
where \(P_{\mathrm{w}sch,j}\) represents the scheduled power output from \(j\)th WT power and \(P_{\mathrm{w}ac,j}\) represents the actual power output from \(j\)th WT. \(K_{Rw,j}\) represents the reserve cost coefficient of \(j\)th WT. \(f(p_{w,j})\) represents PDF of WT, where details about probabilities calculation for different wind speeds can be obtained in [PERSON] et al. [8].  
The reserve cost for the \(k\)th SPV source may be expressed as below:  
\[\begin{array}{l}\mathrm{C}_{\mathrm{R}sk}=K_{Rs,k}(P_{\mathrm{w}sch,k}-P_{ \mathrm{w}ac,k})\\ =K_{Rs,k}*f_{s}(P_{\mathrm{w}ac,k}<P_{\mathrm{w}sch,k})*[P_{\mathrm{w}sch,k}-E (P_{\mathrm{w}ac,k}<P_{\mathrm{w}sch,k})]\end{array} \tag{8}\]where \(P_{sscth,k}\) represents the scheduled output power from \(k\)th SPV source, \(P_{ssc,k}\) represents actual power output from \(k\)th SPV source and \(K_{Rs,k}\) represents the reserve cost coefficient of the \(k\)th SPV source. \(f_{s}(P_{ssc,k}<P_{sscth,k})\) represents the SPV source deficient amount of power than the scheduled SPV source power \(P_{sscth,k}\). \(E(P_{ssc,k}<P_{sscth,k})\) represents the probability of SPV power below \(P_{sscth,k}\).  
On other hand, there might be a situation in which the estimated output power from SPV and WT is more than the estimated power. Under such conditions, the output power from RES is underestimated. The excess amount of energy is expected to be useless if not stored or used properly. ISO must pay a penalty cost for the additional amount of energy.  
Penalty cost for the additional amount of energy for \(j\)th WT may be expressed in the form:  
\[\begin{array}{l}\mathrm{C}_{\mathrm{Pw,j}}=K_{\mathrm{Pw,j}}(P_{\mathrm{ instc},j}-P_{\mathrm{usch},j})\\ =K_{\mathrm{Pw,j}}f_{\mathrm{Pw,j}}^{Pw,j}\ (P_{\mathrm{w,j}}-P_{\mathrm{usch},j})f_{ \mathrm{w}}(P_{w,j})dp_{w,j}\end{array} \tag{9}\]  
\(P_{\mathrm{w,j}}\) represents the rated output power of \(j\)th WT, and \(K_{\mathrm{Pw,j}}\) represents penalty cost coefficient of \(j\)th WT.  
Similarly, ISO should pay a penalty cost for the additional amount of solar energy of \(k\)th SPV sources, and may be expressed below as:  
\[\begin{array}{l}\mathrm{C}_{\mathrm{Ps,k}}=K_{P_{\mathrm{s},k}}(P_{ssc,k}-P _{ssch,k})\\ =K_{P_{\mathrm{s},k}}*f_{s}(P_{ssc,k}\ >\ P_{ssch,k})*[E(P_{ssc,k}\ >\ P_{ssch,k})-P_{ssch,k}]\end{array} \tag{10}\]  
where \(K_{P_{\mathrm{s},k}}\) represents the penalty cost coefficient of the \(k\)th SPV source, and \(f_{s}(P_{ssc,k}\ >\ P_{ssch,k})\) represents the possibility of the left-over amount SPV power \(E(P_{ssc,k}\ >\ P_{ssch,k})-P_{ssch,k}\) represents the probability of \(P_{ssc,k}\) above \(P_{ssch,k}\). The cost function evaluation of SPV and wind turbines are based upon the distribution of the lognormal PDF and Weibull PDF, respectively.