Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0025/calplo.bas
There are 2 other files named calplo.bas in the archive. Click here to see a list.
10	DIMU(250),Y(250)
15	PRINT
16	PRINT
199	READT2,T3,T6
200	GOTO1700
205	LETN=1+INT((T3-T2)/T6)
250	LETY1=1E37
300	LETY2=-1E37
310	FORI=1TON
320	LETU(I)=T2+(I-1)*T6
330	LETT=U(I)
400	LET Y(I)=SIN(T)
410	IFY(I)<Y1THEN440
420	LETY1=Y1
430	GOTO450
440	LETY1=Y(I)
450	IFY(I)>Y2THEN480
460	LETY2=Y2
470	GOTO485
480	LETY2=Y(I)
485	NEXTI
490	LETT4=(Y2-Y1)/25
500	LETQ1=0.4343*LOG(T4)
510	LETJ=INT(20+Q1)
520	LETT=20+Q1-J
530	LETS1=EXP(2.3025851*T)
540	LETT=Q1-T
550	LETP1=EXP(2.3025851*T)
560	IFS1>=1THEN590
570	LETD1=P1
580	GOTO750
590	IFS1>=2THEN620
600	LETD1=2*P1
610	GOTO750
620	IFS1>=2.5THEN650
630	LETD1=2.*P1
640	GOTO750
650	IFS1>=4THEN680
660	LETD1=4*P1
670	GOTO750
680	IFS1>=5THEN710
690	LETD1=5*P1
700	GOTO750
710	IFS1>=8THEN740
720	LETD1=8*P1
730	GOTO750
740	LETD1=10*P1
750	LETB1=10*D1*INT(Y1/(10*D1))
760	LETT5=B1+40*D1
770	LETI1=(T5-B1)/40
780	PRINT
790	PRINT"TYPE '5' FOR A PLOT OF THE FUNCTION, OR '6' FOR JUST THE"
800	PRINT"CALCULATED VALUES, OR '7' FOR BOTH.  WHICH"
810	INPUTK
815	IFK=5THEN843
820	IFK=6THEN830
825	IFK=7THEN843
830	PRINT
840	GOTO980
843	PRINT
844	PRINT
845	PRINT"P L O T   O F   T H E   F U N C T I O N"
850	PRINT
860	PRINT"   MAX VALUE OF F(T) = ";Y2
870	PRINT"   MIN VALUE OF F(T) = ";Y1
880	PRINT
890	PRINT"                     SCALE UNIT = ";I1
895	PRINT
900	PRINT"              ","",B1"                                 ";T5
905	PRINT"VALUE OF T        :.........:.........:.........:.........:"
910	PRINT
915	FORI=1TON
925	LETX=Y(I)
930	GOSUB1500
935	NEXTI
940	PRINT
945	PRINT
950	IFK=7THEN980
955	PRINT
960	PRINT"TYPE '2' FOR ANOTHER RUN WITH THE SAME FUNCTION, OR '3' TO"
965	PRINT"STOP NOW.  WHICH"
970	INPUTJ
975	IFJ<>2THEN1999
976	GOTO1030
980	PRINT
985	PRINT"C A L U C A L A T E D   V A L U E S"
990	PRINT
995	PRINT" T","  F(T)"
1000	PRINT
1005	FORI=1TON
1010	PRINTU(I),Y(I)
1015	NEXTI
1020	PRINT
1025	GOTO955
1030	PRINT
1035	PRINT
1040	PRINT"WHAT ARE THE NEW VALUES OF  TMIN, TMAX, TSTEP"
1045	INPUTT2,T3,T6
1050	GOTO205
1500	PRINTU(I),"  -";
1510	LETI2=INT(4.5+(X-B1)/D1)
1512	LETI2=I2-3
1514	IFI2<=3THEN1520
1516	PRINT"   ";
1518	GOTO1512
1520	IFI2<>1THEN1550
1530	PRINT"+"
1540	GOTO1630
1550	IFI2<>2THEN1580
1560	PRINT" +"
1570	GOTO1630
1580	IFI2=3THEN1590
1590	PRINT"  +"
1630	RETURN
1700	PRINT
1710	PRINT
1720	PRINT"THIS PROGRAM CALCULATES AND/OR PLOTS VALUES OF A FUNCTION"
1730	PRINT"OF THE VARIABLE T, FOR VALUES OF T FROM TMIN TO TMAX IN"
1740	PRINT"STEPS OF TSTEP."
1750	PRINT
1760	PRINT"TO USE, TYPE THE FOLLOWING:"
1770	PRINT
1780	PRINT"  200 DATA  TMIN, TMAX, TSTEP"
1790	PRINT"  400 LET Y(I) = A FUNCTION OF T"
1800	PRINT"  RUN"
1900	DATA 0,0,0
1999	END