How to change matrix dimension (jacobian matrix)

2 views (last 30 days)
I have this matlab code that compute power flow analysis using newton raphson method. The code output of the jacobian matrix is shown as below:
Unfortunately, i cant use this kind of matrix. instead of using that matrix, ive been assigned to build this kind of matrix:
And my question is, how to change my matrix to the one that i wanted. here some fragment of my code i used:
for i=1:4
ii=i+1;
for k=1:4
kk=k+1;
j11(i,k)=mv(ii)*mv(kk)*(g(ii,kk)*sin(th(ii)-th(kk))-b(ii,kk)*cos(th(ii)-th(kk)));
end
j11(i,i)=-qcal(ii)-b(ii,ii)*mv(ii)^2;
end
for i=1:4
ii=i+1;
for k=1:4
kk=k+1;
j211(i,k)=-mv(ii)*mv(kk)*(g(ii,kk)*cos(th(ii)-th(kk))-b(ii,kk)*sin(th(ii)-th(kk)));
end
j211(i,i)=pcal(ii)-g(ii,ii)*mv(ii)^2;
end
j21=j211(1:3,1:4);
j12=-j211(1:4,1:3);
for i=1:3
j12(i,i)=pcal(i+1)+g(i+1,i+1)*mv(i+1)^2;
end
j22=j11(1:3,1:3);
for i=1:3
j22(i,i)=qcal(i+1)-b(i+1,i+1)*mv(i+1)^2;
end
jacob=[j11 j12;j21 j22];
I Appreciate any help that i can get. Thank you before and sorry for my bad english.

Answers (1)

Jan
Jan on 22 Nov 2012
Edited: Jan on 22 Nov 2012
H and J have different numbers of rows in your example. But you try to create a matrix with "Hnn" and "Jnn". The same problem appears for the number of columns of "H" and "N".
This cannot work.
  1 Comment
reza
reza on 22 Nov 2012
yes, im aware of that.
hmm.. now let me assuming that there is 3 bus system. so n=3 ----> dimension of matrix= 2n*2n=6x6 the point is:
Thx for your answer. i really stuck at building the flow

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!