

-----------------------------------

Doru Dragan

11 Mai 2009 16:44



-----------------------------------

OPEN "oglinda" FOR INPUT AS #1
MX=1E+16:INPUT #1,UM$,D,R,N 'Diametrul oglinzii, raza curbura, numar zone
DIM T(14,N+1),M(1,N+3):VL=.00055:IF UM$="IN" THEN VL=VL*.03937! 'Lumina vizibil
F=R/2:FD=F/D:DD=1.22*VL*FD 'F, F/D si Discul de difractie
T(2,1)=0
'Centrul zonei T(3 - Latimea zonei T(2
FOR I=2 TO N+1:T(1,I)=I-1:INPUT #1,T(3,I):T(2,I)=2*T(3,I)-T(2,I-1)
'T(4 Parabola - T(5 Aberatia transversala in planul focar - T(6 Mille Lacroix
T(4,I)=T(3,I)*T(3,I)/R:T(5,I)=T(3,I)/(4*F):T(6,I)=2*DD*R/T(3,I)
NEXT I
FOR I=2 TO N+1:INPUT #1,T(8,I):NEXT I 'Masuratori
C1=0 'C1=(T(8,N+1)-T(4,N+1)+T(8,N)-T(4,N))/2 'initializare eventual C1=0
DO 'Cauta Constanta Potrivita "COC"
FOR I=2 TO N+1:T(11,I)=T(5,I)*(T(8,I)-T(4,I)-C1)*100000!:NEXT I
M1=MX:M2=-MX
FOR I=2 TO N+1
IF T(11,I)>M2 THEN M2=T(11,I)
IF T(11,I)<M1>=.00001 THEN C1=C1+D1/2500!
LOOP UNTIL D1<.00001
'Valori ajustate - aberatia reziduala
FOR J=2 TO N+1:T(9,J)=T(8,J)-C1:T(10,J)=T(9,J)-T(4,J)
T(12,J)=(T(11,J)/100000!)/DD:T(13,J)=-T(11,J)/F*10
NEXT J:T(12,1)=2*T(12,2)-T(12,3)
M(1,1)=-MX:M(1,N+3)=-MX
FOR J=1 TO N:M(1,J+2)=(T(2,J+1)-T(2,J))*(T(13,J+1)/1000000!)+M(1,J+1):NEXT J
L1=N+3:L2=L1
FOR J=2 TO N+2
IF M(1,J)>M(1,J-1) OR M(1,J)>M(1,J+1) THEN L2=J
IF M(1,J)>=M(1,L1) THEN L2=L1:L1=J ELSE IF M(1,J)>=M(1,L2) THEN L2=J
NEXT J
X1=M(1,L1):X2=M(1,L2):Y1=T(2,L1-1):Y2=T(2,L2-1)
K=(Y1*Y1*X2-Y2*Y2*X1)/(Y1*Y1-Y2*Y2):P1=(Y2*Y2)/(4*(X2-K)):W=MX
'X calculat D masurat, Eroarea convertita in milimicroni si lungimi de unda
FOR J=2 TO N+1
Y=T(2,J):X=ABS((Y*Y+4*P1*K)/(4*P1)):D2=ABS(M(1,J+1))
IF J+1<>L1 AND J+1<>L2 AND X<>D2 THEN E=VL/ABS(X-D2):T(14,J)=E:IF E<W THEN W=E
NEXT J
PRINT
PRINT "DIAM. OPTIC "; " RAZA CURB. "; " FOCAR   "; "   F/D"
PRINT USING "#######.##";D;R;F;FD
PRINT "CONST.:";:PRINT USING "##.###";C1;:PRINT " DISC DIFRACTIE:";:PRINT USING "###.######";DD
PRINT
FOR I=1 TO 14:READ D$:PRINT D$;TAB(17);
FOR J=2 TO N + 1:PRINT USING "####.####";T(I, J);: NEXT J
PRINT
NEXT I
PRINT
PRINT "EROAREA MAXIMA A FRONTULUI DE UNDA ESTE 1/";:PRINT USING "##.#";W
INPUT "Doriti sa tipariti la imprimanta?:";I$
DO WHILE I$="d" OR I$="D"
LPRINT
LPRINT "DIAM.OPTIC:";D;" RAZA:";R;" FOCAR:";F;" F/D:";:LPRINT USING "##.##";FD
LPRINT "CONST.:";:LPRINT USING "##.###";C1;:LPRINT " DISC DIFRACTIE:";:LPRINT USING "###.######";DD
LPRINT:RESTORE
FOR I=1 TO 14:READ D$:LPRINT D$;TAB(17);
FOR J=2 TO N+1:LPRINT USING "####.####";T(I, J);:NEXT J
LPRINT
NEXT I
LPRINT
LPRINT "EROAREA MAXIMA A FRONTULUI DE UNDA ESTE 1/";:LPRINT USING "##.#";W
LPRINT:I$="n":LOOP
DATA "ZONA","h(x)","h(m)","h(m)^2/R","h(m)/4f","Mille-Lacroix","D","D(1,2)","D(1,2)-eq"
DATA "Lambda c","Lambda f*1E5","Lambda F/rho","u*1E6","Eroare de unda"
DO:INPUT "AMPLIFICAREA :";AM:CLS:IF AM=0 THEN END
AM=5600*W*AM*DD!:IF UM$="IN" THEN AM=AM*100
SCREEN 12:ZZ=640/T(2,N+1)
LINE(0,20)-(0,620),7:FOR Y=20 TO 620 STEP 10:LINE(0,Y)-(5,Y),8:NEXT Y
AX=160:LINE(0,AX)-(639,AX),7
FOR I=2 TO N+1:LINE(T(3,I)*ZZ,157)-(T(3,I)*ZZ,163),8:LINE(T(2,I)*ZZ,155)-(T(2,I)*ZZ,165),15:NEXT I
FOR I=2 TO N
LINE(T(3,I)*ZZ,AX+AM*T(6,I))-(T(3,I+1)*ZZ,AX+AM*T(6,I+1)),14
LINE(T(3,I)*ZZ,AX-AM*T(6,I))-(T(3,I+1)*ZZ,AX-AM*T(6,I+1)),14
LINE(T(3,I)*ZZ,AX-AM*(T(9,I)-T(4,I)))-(T(3,I+1)*ZZ,AX-AM*(T(9,I+1)-T(4,I+1))),10
NEXT I:AM=AM/9
AX=320:LINE(0,AX)-(639,AX),7
FOR I=2 TO N+1:LINE(T(3,I)*ZZ,317)-(T(3,I)*ZZ,323),8:LINE(T(2,I)*ZZ,315)-(T(2,I)*ZZ,325),15:NEXT I
FOR I=1 TO N
LINE(T(3,I)*ZZ,AX-AM*T(12,I))-(T(3,I+1)*ZZ,AX-AM*T(12,I+1)),11
LINE(T(2,I)*ZZ,AX-AM*T(2,I)*TAN(T(13,I))/9)-(T(2,I+1)*ZZ,AX-AM*T(2,I+1)*TAN(T(13,I+1))/9),12
NEXT I
LOOP UNTIL AM<0
END

