Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0025/tmfcev.bas
There are 2 other files named tmfcev.bas in the archive. Click here to see a list.
00010	REM EVALUATES EXPONENTIAL FUNCTIONS
00020	GOTO 600
00030	READ N,N1,N2,T1,T2,C1
00040	LET M=2*N1+4*N2
00079	DATA 0
00080	FOR J=1 TO M
00085	  DIM D(500),X(20)
00090	READ X(J)
00100	NEXT J
00120	FOR I=1 TO N
00130	LET D(I)=0
00140	LET T=T1+(I-1)*T2
00150	FOR J=1 TO (N1+N2)
00160	IF J>N1 THEN 190
00170	LET D(I)=D(I)+X(J)*EXP(-X(N1+J)*T)
00180	GO TO 230
00190	LET L=N1+J
00200	LET Y=(COS(X(2*N2+L)*T))*EXP(-X(3*N2+L)*T)
00210	LET Z=(SIN(X(2*N2+L)*T))*EXP(-X(3*N2+L)*T)
00220	LET D(I)=D(I)+X(L)*Y+X(N2+L)*Z
00230	NEXT J
00240	LET D(I)=D(I)+C1*(RND(X)-0.5)*SQR(12)
00250	NEXT I
00260	PRINT
00270	PRINT
00280	PRINT
00290	PRINT"NOISE SIGMA ="C1
00300	IF N1=0 THEN 390
00310	PRINT
00320	PRINT"TERMS OF FORM   C*EXP(-S*T)   ARE:"
00330	PRINT
00340	PRINT" ","    C","    S"
00350	PRINT
00360	FOR J=1 TO N1
00370	PRINT" ",X(J),X(N1+J)
00380	NEXT J
00390	IF N2=0 THEN 510
00395	PRINT
00400	PRINT"TERMS OF FORM   (A*COS(W*T)+B*SIN(W*T))*EXP(-G*T)   ARE:"
00450	PRINT
00460	PRINT" ","    A","    B","    W","    G"
00470	PRINT
00480	FOR J=(2*N1+1) TO (2*N1+N2)
00490	PRINT " ",X(J),X(N2+J),X(2*N2+J),X(3*N2+J)
00500	NEXT J
00510	PRINT
00520	PRINT"FIRST POINT AT T1,SPACING=T2"
00530	PRINT "T1="T1,   "T2 ="T2
00540	PRINT
00550	PRINT "DATA POINTS ARE:"
00560	PRINT
00570	FOR I=1 TO N
00580	PRINT D(I),
00590	NEXT I
00595	GOTO 9000
00600	PRINT"THIS PROGRAM EVALUATES TIME FUNCTIONS"
00610	PRINT"WHICH ARE SUMS OF EXPONENTIALS AND"
00620	PRINT"EXPONENTIAL SINE-COSINE TERMS."
00630	PRINT
00640	PRINT"INPUT DATA MUST BE ENTERED AS FOLLOWS:"
00650	PRINT"20 DATA NP,N1,N2,T0,DELTA-T,SIGMA"
00660	PRINT"   WHERE"
00670	PRINT"   NP=TOTAL NUMBER OF POINTS TO BE COMPUTED"
00680	PRINT"   N1=NUMBER OF EXPONENTIAL TERMS"
00690	PRINT"   N2=NUMBER OF SINE-COSINE EXPONENTIAL TERMS"
00700	PRINT"   T0=TIME OF FIRST POINT"
00710	PRINT"   DELTA-T=TIME BETWEEN POINTS"
00720	PRINT"   SIGMA=STANDARD DEVIATION OF THE NOISE"
00730	PRINT" (IF ADDITIVE NOISE IS NOT DESIRED, SIGMA=0 )"
00740	PRINT
00750	PRINT"PARAMETERS OF THE FUNCTION ARE ENTERED AS FOLLOWS:"
00760	PRINT"  41 DATA C(1),C(2),C(3),...,S(1),S(2),S(3),..."
00770	PRINT"  60 DATA A(1),A(2),A(3),...,B(1),B(2),B(3),..."
00780	PRINT"  79 DATA W(1),W(2),W(3),...,G(1),G(2),G(3),..."
00790	PRINT "STATMENT NUMBERS BETWEEN 41 AND 79 INCLUSIVE"
00800	PRINT"MAY BE USED"
00810	PRINT
00820	PRINT"MAXIMUM NUMBER OF POINTS PERMISSABLE IS"
00830	PRINT"500 AND (2N1+4N2=20)."
00840	PRINT
00850	PRINT"THE COMPUTATION OF E^-X,WHERE X IS LARGE MAY RESULT"
09000	END