#include<>#include<>#include<>#define PI struct NodeType{int N;int Type;double e;double f;double Pd;double Qd;double Ps;double Qs;double Bc;};struct BranchType{int Nbr;int Nl;int Nr;double R;double X;double Bn;double Kt;};int n;int nPQ;int nPV;int nPH;int nbr;int ng;int Mark=0;double **G;double **B;double *dS;double *mid1,*mid2;double *Us;double error=1;double iteration=;double **Jacob;double **invJac;double *dfe;struct NodeType *Node;struct BranchType *Branch;void main(){void LoadData();void FormY();void DeltaS();void FormJacob();void InvJac();void UpdateU();void CalculatePQ();int kk;LoadData();FormY();printf("Îó²î¾«¶È iteration=%lf\n",iteration);kk=0;DeltaS();while(error>iteration&&kk<50){FormJacob();UpdateU();DeltaS();kk++;}printf("µü´ú´ÎÊýΪ%4d\n",kk);CalculatePQ();printf("Îó²îÖµ error=%e\n",error);printf("\n");printf("\n");printf(" {×¢:\nNΪ½ÚµãºÅ£¬TpΪ½ÚµãÀàÐÍ£¨ÆäÖÐ1ΪPQ½Úµã£¬2ΪPV½Úµã£¬3Ϊƽºâ½Úµã£©£¬\nAmpΪµçѹ´óС£¬DltaΪÏàλ½Ç£¬PdΪ½ÚµãÊä³öµÄÓй¦¹¦ÂÊ£¬QdΪ½ÚµãÊä³öµÄÎÞ¹¦¹¦ÂÊ£¬\nPsΪ·¢µç»úÊä³öÓй¦¹¦ÂÊ£¬QsΪ·¢µç»úÊä³öÎÞ¹¦¹¦ÂÊ£¬BcΪ²¢ÁªµçÈݵĵ翹ֵ}\n");}void LoadData(){int i,j;int tN,tType;double te,tf,tPd,tQd,tPs,tQs,tBc;FILE *fp;char filename[50]={" "};printf("ÇëÊäÈëÊý¾ÝÎļþÃû(Ìáʾ£ºÊý¾ÝËùÔÚTXTÎļþ)£º");scanf("%s",filename);if((fp=fopen(filename,"r"))==NULL){printf("cannot open the file:\n");return;}fscanf(fp,"%d",&n);printf("½Úµã¸öÊýΪ£º%d\n",n);Node=(struct NodeType *)malloc(sizeof(struct NodeType)*n);printf("µ÷ÕûǰµÄ½Úµã²ÎÊýΪ£º\n");for(i=0;i