Hi Rana, I’m not following where you are seeing a discrepancy in Ybus when there is a shunt admittance. The value of Ybus returned by makeYbus() definitely includes the shunt admittances (see line 100 <https://github.com/MATPOWER/matpower/blob/f3267c88bb974b17566d25a599fcad8e8efda41d/lib/makeYbus.m#L100>) Maybe you could provide a short script using case14 (which includes some shunt admittances) to show precisely how you are calculating the values that are not matching as you expect.
Ray > On Nov 11, 2019, at 11:10 PM, Md Masud Rana <mdmasud.r...@alumni.uts.edu.au> > wrote: > > Dear Dr. Ray, > > Good morning. I found that Y matrix from mathpower and it manual: Y = Cf'*Yf > + Ct'*Yt+Ysh values are not same! > They are same when their is no no shunt admittance, i.e, Y = Cf'*Yf + Ct'*Yt. > Why this happens? > > As a result, the active/reactive power injection: conj(diag((Y) * v*v')) is > different from Cf'*Pf+Ct'*Pt+Ysh (active power for example, Pf and Pt are > power flow from and to). When their is no shunt admittance both are equal > but the problem comes when there is shunt admittance. Please help: how can I > get theoretical active power injection real(conj(diag((Y) * v*v'))) is equal > to calculated Cf'*Pf+Ct'*Pt+Ysh values when there is shunt admittance? > Thanks. > > Regards, > Rana > > From: Md Masud Rana > Sent: Tuesday, 12 November 2019 4:06 PM > To: matpower-l@cornell.edu <mailto:matpower-l@cornell.edu> > <matpower-l@cornell.edu <mailto:matpower-l@cornell.edu>>; Ray Zimmerman > <r...@cornell.edu <mailto:r...@cornell.edu>> > Subject: About Y-bus values from Matpower and theoretical values. Thanks. > > Dear Dr. Ray, > > Good morning. I found that Y matrix from mathpower and it manual: Y = Cf'*Yf > + Ct'*Yt+Ysh values are not same! > They are same when their is no no shunt admittance, i.e, Y = Cf'*Yf + Ct'*Yt. > Why this happens? > > As a result, the active/reactive power injection: conj(diag((Y) * v*v')) is > different from Cf'*Pf+Ct'*Pt+Ysh (active power for example, Pf and Pt are > power flow from and to). When their is no shunt admittance both are equal > but the problem comes when there is shunt admittance. Please help: how can I > get theoretical active power injection real(conj(diag((Y) * v*v'))) is equal > to calculated Cf'*Pf+Ct'*Pt+Ysh values when there is shunt admittance? > Thanks. > > Regards, > Rana