蓝
蓝于
Unregistered / Unconfirmed
GUEST, unregistred user!
定义数组: Z(8,5) --存放输入数据 Y(4,4) --不定导纳矩阵; J(4) JN=J --电源电流列阵; YNVN=JN
定义五个一维数组: FR(8),TO(8),G(8),E(8),F(8)
READ L,N,SC
WRITE L,N,SC :校验输入是否正确
清零 X,Y,Z
do
7, I=1,L+SC
READ(*,*) FR(I),TO(I),G(I),E(I),F(I)
WRITE(*,*) FR(I),TO(I),G(I),E(I),F(I)
Z(I,1)=FR(I)
Z(I,2)=TO(I)
Z(I,3)=G (I)
Z(I,4)=E (I)
Z(I,5)=F (I)
7 CONTINUE
do
10, I=1,L
J=Z(I,1)
K=Z(I,2)
G1=Z(I,3)
S1=Z(I,4)
S2=Z(I,5)
Y(J,J)=Y(J,J)+G1
Y(K,K)=Y(K,K)+G1
Y(J,K)=Y(J,K)-G1
Y(K,J)=Y(K,J)-G1 :形成YN阵
IF (S2.EQ.2) GOTO 8
IF (S2.EQ.1) S1=-S1 GOTO 9
8 S1=S1*G1
9 J(J)= J(J)+S1
J(K)= J(J)-S1
10 CONTINUE
do
15, I=L+1,L+SC
S=Z(I,1)
C=Z(I,2)
G1=Z(I,3)
S1=Z(I,4)
S2=Z(I,5)
IF (S1.NE.1) G1=G1*Z(S,3)
IF (S2.NE.2) G1=G1*Z(C,3)
J=Z(S,1)
K=Z(S,2)
P=Z(C,1)
Q=Z(C,2)
Y(J,P)=Y(J,P)+G1
Y(K,Q)=Y(K,Q)+G1
Y(J,Q)=Y(J,Q)-G1
Y(K,P)=Y(K,P)-G1
15 CONTINUE
说明:以上为这个程序的FORTRAN算法
要求用C编,有输入界面和输出界面 ,
要求程序包含三个部分: LJH.C LJH.EXE;
LJH.DAT
谢谢大家了!
定义五个一维数组: FR(8),TO(8),G(8),E(8),F(8)
READ L,N,SC
WRITE L,N,SC :校验输入是否正确
清零 X,Y,Z
do
7, I=1,L+SC
READ(*,*) FR(I),TO(I),G(I),E(I),F(I)
WRITE(*,*) FR(I),TO(I),G(I),E(I),F(I)
Z(I,1)=FR(I)
Z(I,2)=TO(I)
Z(I,3)=G (I)
Z(I,4)=E (I)
Z(I,5)=F (I)
7 CONTINUE
do
10, I=1,L
J=Z(I,1)
K=Z(I,2)
G1=Z(I,3)
S1=Z(I,4)
S2=Z(I,5)
Y(J,J)=Y(J,J)+G1
Y(K,K)=Y(K,K)+G1
Y(J,K)=Y(J,K)-G1
Y(K,J)=Y(K,J)-G1 :形成YN阵
IF (S2.EQ.2) GOTO 8
IF (S2.EQ.1) S1=-S1 GOTO 9
8 S1=S1*G1
9 J(J)= J(J)+S1
J(K)= J(J)-S1
10 CONTINUE
do
15, I=L+1,L+SC
S=Z(I,1)
C=Z(I,2)
G1=Z(I,3)
S1=Z(I,4)
S2=Z(I,5)
IF (S1.NE.1) G1=G1*Z(S,3)
IF (S2.NE.2) G1=G1*Z(C,3)
J=Z(S,1)
K=Z(S,2)
P=Z(C,1)
Q=Z(C,2)
Y(J,P)=Y(J,P)+G1
Y(K,Q)=Y(K,Q)+G1
Y(J,Q)=Y(J,Q)-G1
Y(K,P)=Y(K,P)-G1
15 CONTINUE
说明:以上为这个程序的FORTRAN算法
要求用C编,有输入界面和输出界面 ,
要求程序包含三个部分: LJH.C LJH.EXE;
LJH.DAT
谢谢大家了!