*PHIO RESIDUALS**2) 



IF(ILIST.EQ.l)WRITE(5,12O)ITERAT,NBIS,A0,B0,PHI0,POLD 

 120 FORMATC ' ,I6,10X,I4,6X,4(4X,F10.4)) 

 C 



C ZERO OUT MATRIX TERMS 

 C 



150 A9=0.0 



B9=0.0 



C9=0.0 



E9=0.0 



F9=0.0 



19=0.0 



J9=0.0 



K9=0.0 



L9=0.0 

 C 



C COMPUTE TERMS FOR LEAST SQUARES MATRIX CONSTRUCTION 

 C 



DO 200 1=1, N 



PARTA=F1(X(I),A0,B0) 



PARTB=F2(X(I),A0,PHI0) 



PARTP=F4(X(I),A0,B0,PHI0) 



P0WF=F3(X(I),A0,B0,PHI0) 



A9=A9+(PARTA**2) 



B9=B9+(PARTA*PARTB) 



C9=C9+(PARTA*PARTP) 



E9=E9+(PARTB**2) 



F9=F9+(PARTB*PARTP) 



I9=I9+(PARTP**2) 



J9=J9+(PARTA*(Y(I)-P0WF)) 



K9=K9+(PARTB*(Y(I)-P0WF)) 

 200 L9=L9+(PARTP*(Y(I)-P0WF)) 



D9=B9 



G9=C9 



H9=F9 

 C 



C COMPUTE CORRECTION TERMS FOR A AND B 

 C 



D=A9*E9*I9+B9*F9*G9+C9*09*H9-C9*E9*69-B9*D9*I9-A9*F9*H9 



AC0RR=(((E9*I9-F9*H9)*J9)+((C9*H9-B9*I9)*K9)+((B9*F9-E9*C9)*L9))/D 



BC0RR=(((69*F9-D9*I9)*J9)+((A9*I9-G9*C9)*K9)+((D9*C9-A9*F9)*L9))/D 



PCORR= ( ( ( D9*H9-G9*E9 )*J9 )+ ( (G9*B9-A9*H9 )*K9 )+ ( ( A9*E9-B9*09 )*L9 ) ) /D 

 C 



C CREATE NEW A AND B 

 C 



230 A=AO+ACORR 



B=BO+BCORR 



PHI=PHIO+PCORR 

 C 



C COMPUTE NEW SUM OF SQUARES OF RESIDUALS WITH NEW ESTIMATES 

 C 



PNEW=0.0 



DO 250 1=1, N 



182 



