Trailing-Edge
-
PDP-10 Archives
-
decuslib10-01
-
43,50110/false.eng
There are 2 other files named false.eng in the archive. Click here to see a list.
100' NAME--FALSE
110'
120' DESCRIPTION--A FALSE POSITION SUBROUTINE
130'
140' SOURCE--A. O. CONVERSE
150'
160' INSTRUCTIONS--THIS PROGRAM IS USEFUL IN OBTAINING AN IMPLICIT
170' SOLUTION. THE PROBLEM IS SOLVED BY FINDING A VALUE OF
180' A5 THAT CAUSES A1(A5) TO BECOME SUFFICIENTLY CLOSE TO THE
190' VALUE OF A2. THE PROGRAM COMPARES A1 WITH A2, AND ESTIMATES
200' A NEW VALUE FOR A5 BUT IT DOES NOT CALCULATE THE NEW VALUE
210' FOR A1. THIS MUST BE DONE OUTSIDE THE SUBROUTINE.
220'
230' THE LIST OF VARIABLES ARE:
240' A1=CURRENT VALUE OF DEPENDENT VARIABLE
250' A2=DESIRED VALUE OF DEPENDENT VARIABLE
260' A3=ACCEPTABLE ERROR;SEE "COMPARISON" LINE
270' A4=COUNTER
280' A5=CURRENT VALUE OF INDEPENDENT VARIABLE
290' A6=RECENTLY STORED VALUE OF A1
300' A7=RECENTLY STORED VALUE OF A5
310' A8=OLD STORED VALUE OF A1
320' A9=OLD STORED VALUE OF A5
330' B1=LOWER LIMIT ON A5
340' B2=UPPER LIMIT ON A5
350' J2=A SWITCH, =1 IF CONVERGENCE HAS BEEN OBTAINED, 0 OTHERWISE
360'
370'
380' * * * * * * * MAIN PROGRAM * * * * * * * * * *
390'
400 IF ABS(A1-A2) < A3 THEN 590' COMPARISON
410 IF A4 > 50 THEN 610' GUARDS AGAINST LOOPING
420 IF A4 > 1.5 THEN 500' THERE HAVE ALREADY BEEN TWO ITERATIONS
430 LET A4 = A4 + 1
440 LET A6 = A1
450 LET A5 = .9*A7
460 GO TO 480
470 LET A5 = A7 + .1*(B2-A7)
480 LET A4 = A4 + 1' COUNTER
490 RETURN
500 LET A8 = A6
510 LET A9 = A7
520 LET A6 = A1
530 LET A7 = A5
540 LET A5 = A7 + (A2-A6)*(A7-A9)/(A6-A8)
550 IF A5 < B1 THEN 450
560 IF A5 > B2 THEN 470
570 LET A4 = A4 + 1
580 RETURN
590 LET J2 = 1
600 RETURN
610 PRINT " LOOP"
620 REM REPLACE THIS WITH "GO TO END"