Regarding your questions in Steps 1 and 2 below … Yes, you can use makeYbus() to build the Ybus matrix, which of course includes both diagonal and off-diagonal elements.
And imag(Ybus) does not yield the same B matrix returned by makeBdc() <http://www.pserc.cornell.edu/matpower/docs/ref/matpower6.0/makeBdc.html>, but you are the one who has to determine which one is correct for your application. Ray > On Jul 21, 2017, at 5:33 AM, Saeed Ahmed <[email protected]> wrote: > > > Respected All, > > For Calculating the power flow > > 1. The state variables are related to the measurements through the following > model: > z=h(x)+e .......(1) > here x is the matrix of state variables > and e is the normally distributed meter error (noise) with zero mean > in the measurements. > > (This is calculated this part using matpower standard Newton Raphson's > Method) > > > 2. For state estimation using the DC power flow model, Equation (1) can be > represented by a linear regression model following > z=H(x)+e ........(2) > where H is the Jacobin Matrix > and z is the matrix of real power injections in the node ( In DC power > flow we only consider active power injection in to bus) > > WLS Criteria: > > Now using the weighted least-square criteria for the calculation of > estimated following equation is used > > > x_estimated= [ Inverse{ (Transpose(H)) . W. H) } . > Transpose (H).W] z .... (3) > > > (a diagonal matrix with elements are reciprocal of variance) > > > > Now My Question: > > I want to know how to extract the H Matrix ? > > As per my understanding H Matrix (Using DC Power Flow Method) is different > from the H Matrix ( AC Power Flow) and it is built as following: > > Step 1 : Build the Ybus matrix ( Need to know which function to be used ? Can > i use the function > [Ybus, Yf, Yt] = makeYbus(baseMVA, bus, branch) > Is the loop for calculation of diagonal and off-diagonal elements is already > included in this function > > > Step 2 : Build the B Matrix (B=imaginary (Ybus) ) > Does this gives the correct B Matrix ? > > Step 3 : Build the H Matrix > ( I think it should also include the bus incident matrix . How can i > calculate/ extract the bus incidence matrix ?) > > Please correct me if i am wrong in my understanding and also guide me how to > extract H Matrix > > > Step 4 : Compare DC State Estimation using WLS function results with the > runpf results in MATpower > > > Regards > Saeed Ahmed > > > On 21 July 2017 at 14:37, Saeed Ahmed <[email protected] > <mailto:[email protected]>> wrote: > Thank you Sir .... I am really grateful... > > Now after a lot of reading and following your guidance i am understanding how > to start working on matpower. Your cooperation is highly appreciated. I will > keep on seeking guidance , please. > > > > Regards > Saeed Ahmed > > > On 20 July 2017 at 22:59, Ray Zimmerman <[email protected] > <mailto:[email protected]>> wrote: > For a case that has consecutive bus numbers (e.g. one that has been converted > to internal indexing via ext2int() > <http://www.pserc.cornell.edu/matpower/docs/ref/matpower6.0/ext2int.html>), > simply use makeSbus() > <http://www.pserc.cornell.edu/matpower/docs/ref/matpower6.0/makeSbus.html>. > It returns the complex bus injections in per-unit, so you’ll need to take > only the real part and multiply by baseMVA to get the MW values. > > E.g. > > mpc = rundcpf('case30', mpoption('out.all', 0)); > Pbus = real(makeSbus(mpc.baseMVA, mpc.bus, mpc.gen)) * mpc.baseMVA > > — Ray > > > >> On Jul 19, 2017, at 9:43 PM, Saeed Ahmed <[email protected] >> <mailto:[email protected]>> wrote: >> >> Hi All, >> >> I need to calculate the the injected power(Pi) matrix at each bus . It is >> equal to the generated power(Pg) - demand/load power. Now how to extract it >> using matpower >> >> > > >
