Determination of No-Recrystallization Temperatures (Tnr) in Controlled Rolling


Language: QBasic.

Objective: This program calculates, using data got from hot torsion tests or from industrial plate rolling, the temperatures of no-recrystallization for the microalloyed austenite. These temperatures define the "holding phase" of the controlled rolling of microalloyed steels. They can be calculated by two models - Boratto and Dutta-Sellars. The software also includes a graphical output, showing the interaction between precipitation and recrystallization that defines these temperatures.

Instructions: Data got from multiple hot torsion tests, carried out according to Boratto's methodology, or from industrial plate controlled rolling allow the calculation of the no-recrystallization temperatures (Tnr). Just execute once the program to know which data you must enter! More details can be found in the papers listed at the beginning of the program listing.

Note: This program requires that the file TABFORM.VGA is in the same directory of the BASIC program. So, you need to create this file using the same procedure as described for the copy of the BASIC programs. The file TABFORM.VGA is listed below, copy-and-paste its contents in a word processor (EDITOR [DOS] or WORD recommended!) and then save it with this name and in "text" format!


***** Begin of the TABFORM.VGA File *****

P1,0BL2D1R4U2L4D1
P1,0L4R8L4U2D4
P1,0BD2L2R4H3G3R1
P1,0BU2L2R4G3H3R1
P1,0
P1,0BR3U1BU2U3
P1,0BR1BU5U1BR3D1
P1,0BR2U6BR3D6U4R2L7BD2R7
P1,0BR4U6D1R2L4G1F1R4F1G1L4
P1,0BR1BU6D1R1U1BD6BR4U1L1D1BL4E6
P1,0BR6H5E1R2F1G4F1R2E2
P1,0BR3BU6D2
P1,0BR4H2U2E2
P1,0BR1E2U2H2
P1,0BU3R6L3U2D4U2H2F4H2E2G4
P1,0BU3R6L3U2D4
P1,0BR2E1U1L1
P1,0BU3R5
P1,0BR2U1R1D1
P1,0E6
P1,0R3E1U4H1L3G1D4E4
P1,0BR1R4L2U6G1
P1,0R5L5E5H1L3G1
P1,0BU1F1R3E1U1H2E2L5
P1,0BR4U6G4R5
P1,0BU1F1R3E1U2H1L4U2R5
P1,0BR1R3E1U1BD1G1L3BL1BU1U1BE1R3BL3BL1BE1E2
P1,0BR2U2E4L6
P1,0BR1R3E1U1H1L3BG1D1U1E1H1U1E1R3F1D1
P1,0BR1E4BU1H1L3G1D1F1R2BR1
P1,0BR2BU1U1R1D1L1BU3U1R1D1
P1,0BR2E1U1L1BU2U1R1D1
P1,0BU3F3H3E3
P1,0BU2R5BU2L5
P1,0BR5BU3H3F3G3
P1,0BR3U1BU2E2H1L3G1
P1,0BU1U1E1R1D3L1R3E1U4H1L3G1
P1,0U5BU1BR1R3BR1BD1D5BL5BU3R5
P1,0U6R4BR1BD1D1BD1D2BD1BL1L4U3R4
P1,0BU1U4BU1BR1R3F1BD4G1L3
P1,0U6R3F1F1D2G1G1L3
P1,0U6R5BD3BL4R3BD3BL4R5
P1,0U6R5BD3BL4R3
P1,0BU1U4BU1BR1R3F1BD2L2BR2D3L4
P1,0U6D3R5U3D6
P1,0BR2R2L1U6L1R2
P1,0BU1U1BF2L1R3BR1BU1U5BL1R2
P1,0U6D3R2E3G3F3
P1,0U6D6R5
P1,0U6F3D1U1E3D6
P1,0U6BD1R1BD1R1BD1R1BD1R1BD1R1BD1R1U6
P1,0BU1U4E1R3F1D4G1L3
P1,0U6R4F1D1G1L3
P1,0BU1U4BE1R3BF1D2G3L1BR2BU3F3
P1,0U6R4BF1D1BG1L3R1F3
P1,0BU1F1R3E1U1H1L3H1U1E1R3F1
P1,0BR2U6L3R6
P1,0BU1U5D5F1R3E1U5
P1,0BU3U3D3F3E3U3
P1,0U6D6E3U1D1F3U6
P1,0E6G3H3F6
P1,0BR3U3H3F3E3
P1,0R5L5E5U1L5
P1,0BR1R2L2U6R2
P1,0BU6F6
P1,0BR2R2U6L2
P1,0BR3U6F3H3G3
P1,0R6
P1,0BU6BR3D1G1
P1,0BR1H1E1R4D2L4R4U3H1L3
P1,0BR1R3E1U2H1L2G2D1U5
P1,0BR1R3E1G1L3H1U2E1R3
P1,0BR1R4U6D4H2L2G1D2
P1,0BR1R3L3H1U2E1R3F1D1L5
P1,0BR2U3L1R2L1U2E1R1F1
P1,0BR1R3E1U3L4G1F1R4
P1,0U6D4E2R2F1D3
P1,0BR1R2L1U4BU2L1BR1BD2L1
P1,0BU1F1R2E1U3BU2L1
P1,0BR1U6D4R2E2G2F2
P1,0BR2R2L1U6L1
P1,0U4R1R1F1D3U3E1R1F1D3
P1,0U4D2E2R2F1D3
P1,0BR1R3E1U2H1L3G1D2
P1,0U4R5F1G1L5
P1,0BR5U4L5G1F1R5
P1,0BR1U4D2E2R2
P1,0R4E1H1L3H1E1R4
P1,0BR2R1E1G1BL1BU1U4D1L1R2
P1,0BU1U3D3F1R2E3U1D4
P1,0BU3U1D1F3E3U1
P1,0BU1U3D3F1R1E1U1D1F1R1E1U3
P1,0E2R1E2G2L1H2F2R1F2
P1,0R2E3U1D1G1L2H2
P1,0R5L5BU1R1BR1BU1R1BU1BR1R1BU1L5
P1,0BR3R1L1H1U1H1L1R1E1U1E1R1
P1,0BR3U2BU2U2
P1,0BR2R1E1U1E1R1L1H1U1H1L1
***** End of the TABFORM.VGA File *****


***** Begin of Program Listing *****

REM
REM *** PROGRAMA PARA CALCULO DAS TEMPERATURAS DE NAO RECRISTALIZACAO
REM ***              DA AUSTENITA MICROLIGADA: Tnr E T5%
REM ***
REM *** Referencias:
REM ***
REM ***   - BAI, D.Q. et al. Effect of Deformation Parameters on the
REM ***     No-Recrystallization Temperature in Nb-bearing Steels.
REM ***     Metallurgical Transactions A, October 1993, 2151-2159.
REM ***
REM ***   - DUTTA, B. & SELLARS, C.M. Effect of Composition and
REM ***     Process Variables on Nb(C,N) Precipitation in Niobium
REM ***     Microalloyed Austenite. Materials Science and Technology,
REM ***     March 1987, 197-206.
REM ***
REM ***   - LIU, X. et al. Modelling the Interaction between
REM ***     Recrystallization and Precipitation during Multipass Rolling
REM ***     of Niobium Microalloyed Steels. Materials Science and
REM ***     Technology, May 1995, 469-473.
REM ***
REM ***   - VALDES, E. & SELLARS, C.M. Influence of Roughing Rolling
REM ***     Passes on Kinetics of Strain Induced Precipitation of Nb(C,N).
REM ***     Materials Science and Technology, July 1991, 622-630.
REM ***
REM ***              Antonio Augusto Gorni  ---  21.12.1998
REM

DECLARE SUB INITGRAPH ()
DECLARE SUB INITAXIS (X(), Y(), N)
DECLARE SUB CARTESIAN (X, Y, PX, PY)
DECLARE SUB NOTEXP (EXPO, VAR, POV)
DECLARE SUB LABEL (a$, PX, PY)
DECLARE SUB AXIS ()
DECLARE SUB PLOTPOINT (X(), Y(), N, SM)
DECLARE SUB PLOTLINE (X(), Y(), N)
DECLARE SUB GRID ()
DECLARE SUB HARDCOPY ()
DECLARE SUB SHOWGRAPH ()
DECLARE FUNCTION LAGRANGE (Z, X(), Y(), N)
DECLARE FUNCTION SOLUVEL (PARSOL, TSOL(), CSOL(), NSOL(), NBSOL(), NPSOL, TEMP0, SOLUB$)
COMMON SHARED X0, X1, Y0, Y1, NX, NY, XA$, YA$, EX, EY, XRESOL, YRESOL
COMMON SHARED GRAPHICS(), LETRA$(), XMARGMIN, YMARGMIN, XMARGMAX, YMARGMAX
OPTION BASE 1
DIM LETRA$(125), GRAPHICS(9940)
DIM TPIN(20), TEMPIN(20), TRIN(20), TR50(20), TRFIN(20), TEMPR(20), TG(20)
DIM TPINC(20), TEMPINC(20), TRINC(20), TR50C(20), TRFINC(20), TEMPRC(20)
DIM TSOL(20), CSOL(20), NSOL(20), NBSOL(20), ESQPAS(4, 20), ESQIND(6, 20)

NELEM = 1000
DIM TGERALR(NELEM)
DIM TGERAL(NELEM), TINPPT(NELEM), TREXIN(NELEM), TREX50(NELEM), TREXFIN(NELEM)

REM
REM *** Rolling Mill Data
REM
RAIOCIL = 500: CEDAGEM = 600

DTIME = .01: DTEMP = .01: R = 8.31: B = 2.5E+10
Q = 270000: AREX = 6.75E-20: BREX = 300000: CREX = 275000
NCICLES = 5000: C50 = 330000: LAMBDA = .5
INITGRAPH
CLS : BUF$ = "MATHEMATICAL MODEL FOR Tnr AND T5% CALCULATION"
PRINT TAB((80 - LEN(BUF$)) / 2 + 1); : COLOR 0, 7: PRINT BUF$: COLOR 7, 0
VIEW PRINT 4 TO 24
LOCATE 6
MODEL$ = "DUTTA-VALDES-BAI-LIU"
INPUT "Steel Identification"; ACO$
PRINT
INPUT "% C"; C: INPUT "% Nb"; NB: INPUT "% N"; NITRO
INPUT "Grain Size after Reheating [microns]"; TGINIC
PRINT
BUF$ = ""
DO UNTIL BUF$ = "Y" OR BUF$ = "y" OR BUF$ = "N" OR BUF$ = "n"
   INPUT "Plate Rolling (Y/N)"; BUF$
LOOP
PRINT
IF BUF$ = "Y" OR BUF$ = "y" THEN
   CONFORM$ = "Plate Rolling"
   PRINT
   DO UNTIL BFI$ = "K" OR BFI$ = "k" OR BFI$ = "D" OR BFI$ = "d"
      INPUT "Data Input by eyboard ou isk"; BFI$
   LOOP
   IF BFI$ = "D" OR BFI$ = "d" THEN
      PRINT : INPUT "File Name"; ARQ$: ARQ$ = ARQ$ + ".PRX"
      OPEN ARQ$ FOR INPUT AS #1
      INPUT #1, NROPAS
      FOR I = 1 TO NROPAS
         FOR J = 1 TO 6
            INPUT #1, ESQIND(J, I)
         NEXT J
      NEXT I
                 ELSE
      PRINT : PRINT "Input the Solicited Data; Write END to Finish!"
      PRINT : I = 1: BUFX$ = "VAI"
      DO WHILE BUFX$ <> "END" AND BUFX$ <> "end"
         PRINT "Pass #"; I
         IF I = 1 THEN
            INPUT "Initial Thickness [mm]"; ESQIND(1, I)
                       ELSE
            ESQIND(1, I) = ESQIND(2, I - 1)
         END IF
         INPUT "Final Thickness [mm]"; BUFX$
         IF BUFX$ = "END" OR BUFX$ = "end" THEN
            NROPAS = I - 1: EXIT DO
                                           ELSE
            ESQIND(2, I) = VAL(BUFX$)
            INPUT "Peripherical Roll Speed [rpm]"; ESQIND(3, I)
            INPUT "Temperature [.C]"; ESQIND(4, I)
            INPUT "Time Inverval between Passes [s]"; ESQIND(5, I)
            INPUT "Rolling Load [t]"; ESQIND(6, I)
            PRINT
            I = I + 1
         END IF
      LOOP
   END IF
   FOR I = 1 TO NROPAS
      IF I = 1 THEN
         H1 = ESQIND(1, I)
               ELSE
         H1 = ESQIND(1, I) + ESQIND(6, I - 1) / CEDAGEM
      END IF
      H2 = ESQIND(2, I) + ESQIND(6, I) / CEDAGEM
      ESQPAS(1, I) = LOG(H1 / H2)
      AUX = 1 - (H1 - H2) / (2 * RAIOCIL)
      ALFA = ATN(SQR(1 - AUX ^ 2) / AUX)
      ESQPAS(2, I) = .1209 * ESQIND(3, I) * ESQPAS(1, I) / ALFA
      ESQPAS(3, I) = ESQIND(4, I) + 273
      ESQPAS(4, I) = ESQIND(5, I)
   NEXT I
   PRINT : PRINT
   IF BFI$ = "K" OR BFI$ = "k" THEN
      DO UNTIL BF$ = "Y" OR BF$ = "y" OR BF$ = "N" OR BF$ = "n"
         INPUT "Do You Want to Save Data (Y/N)"; BF$
      LOOP
      IF BF$ = "Y" OR BF$ = "y" THEN
         PRINT : INPUT "File Name"; ARQ$
         ARQ$ = ARQ$ + ".PRX"
         OPEN ARQ$ FOR OUTPUT AS #1
         WRITE #1, NROPAS
         FOR I = 1 TO NROPAS
            FOR J = 1 TO 6
               IF J < 6 THEN
                  PRINT #1, ESQIND(J, I); ",";
                        ELSE
                  PRINT #1, ESQIND(J, I)
               END IF
            NEXT J
         NEXT I
         CLOSE #1
      END IF
   END IF
                            ELSE
   CONFORM$ = "Laboratorial"
   INPUT "Real Strain"; AUX1
   INPUT "Strain Rate [s^-1]"; AUX2
   INPUT "First Pass Temperature [.C]"; AUX3
   INPUT "Last Pass Temperature [.C]"; AUX3A
   INPUT "Temperature Interval between Passes [.C]"; AUX4
   INPUT "Time Interval between Passes [s]"; AUX5
   I = 0
   FOR TEMP = AUX3 TO AUX3A STEP -AUX4
      I = I + 1
      ESQPAS(1, I) = AUX1
      ESQPAS(2, I) = AUX2
      ESQPAS(3, I) = (AUX3 - AUX4 * (I - 1)) + 273
      ESQPAS(4, I) = AUX5
   NEXT TEMP
NROPAS = I
END IF
ESQPAS(3, NROPAS + 1) = ESQPAS(3, NROPAS): ESQPAS(4, NROPAS + 1) = 300
PRINT : PRINT : BUF$ = ""
PRINT "Solubilization Conditions": PRINT
DO UNTIL BUF$ = "Y" OR BUF$ = "y" OR BUF$ = "N" OR BUF$ = "n"
   INPUT "Do You Want to Use the Default Equation [Irvine] (Y/N)"; BUF$
LOOP
SOLUB$ = "Irvine"
IF BUF$ = "N" OR BUF$ = "n" THEN
   SOLUB$ = "Propria": PRINT
   ARQ$ = ACO$ + ".SOL"
   OPEN ARQ$ FOR INPUT AS #1
   I = 0: TCONTROL = 0
   DO UNTIL TCONTROL = 1300
      I = I + 1
      INPUT #1, TSOL(I), CSOL(I), NSOL(I), NBSOL(I)
      TCONTROL = TSOL(I)
   LOOP
   CLOSE #1
   NPSOL = I
END IF
CLS : LOCATE 6: PRINT "Cogito, Ergo Sum!": PRINT
PRINT "This Will Take Some Time...": PRINT : PRINT
PRINT "Phase #1: Precipitation Kinetics Calculation!": PRINT
PARSOL = NB * (C + 12 / 14 * NITRO)
FOR K1 = 1 TO NROPAS
   TEMP0 = ESQPAS(3, K1)
   SUM = 0!: TIMC = 0!
   DTEMP = (ESQPAS(3, K1) - ESQPAS(3, K1 + 1)) / NCICLES
   DTIME = ESQPAS(4, K1) / NCICLES
   FOR K2 = 1 TO NCICLES
      TIMC = TIMC + DTIME
      TEMP0 = TEMP0 - DTEMP
      X1 = 200 * EXP(-200000 / R / TEMP0) / NB / ESQPAS(1, K1)
      Z = ESQPAS(2, K1) * EXP(400000! / R / TEMP0)
      X2 = 1! / SQR(Z)
      X3 = EXP(Q / R / TEMP0)
      KS = SOLUVEL(PARSOL, TSOL(), CSOL(), NSOL(), NBSOL(), NPSOL, TEMP0, SOLUB$)
      IF KS > 1 THEN
         X4 = TEMP0 ^ 3! * LOG(KS) ^ 2!
         IF (B / X4) <= 88 THEN
            X5 = EXP(B / X4)
            CPS = X1 * X2 * X3 * X5
            SFRCTN = DTIME / CPS
            SUM = SUM + SFRCTN
            IF SUM >= 1 THEN EXIT FOR
                        ELSE
            TIMC = 9999
         END IF
                ELSE
         TIMC = 9999
       END IF
   NEXT K2
   IF TIMC > ESQPAS(4, K1) - 1 THEN TIMC = 9999
   TEME = TEMP0 - 273
   TPIN(K1) = TIMC: TEMPIN(K1) = TEME
   PRINT USING "####"; TEME; : PRINT ".C -> ";
   IF TIMC = 9999 THEN
      PRINT "No Precipitation"
                  ELSE
      PRINT USING "##.##"; TIMC; : PRINT " s"
   END IF
NEXT K1
CK1 = 0
FOR I = 1 TO NROPAS
   IF TPIN(I) = 9999 THEN CK1 = CK1 + 1
NEXT I
FOR I = CK1 + 1 TO NROPAS
   TPINC(I - CK1) = LOG(TPIN(I)): TEMPINC(I - CK1) = TEMPIN(I)
NEXT I
NROPASC = NROPAS - CK1
FOR I = 1 TO NROPASC - 1
   FOR J = I + 1 TO NROPASC
      IF TEMPINC(J) < TEMPINC(I) THEN
         SWAP TEMPINC(J), TEMPINC(I): SWAP TPINC(J), TPINC(I)
      END IF
   NEXT J
NEXT I
PRINT : PRINT : PRINT "Phase #2: Recrystallization Kinetics Calculation!"
PRINT
TGAMA = TGINIC
FOR K1 = 1 TO NROPAS
   TEMP0 = ESQPAS(3, K1)
   SUM = 0!: TIMC = 0!
   DTEMP = (ESQPAS(3, K1) - ESQPAS(3, K1 + 1)) / NCICLES
   DTIME = ESQPAS(4, K1) / NCICLES
   FOR K2 = 1 TO NCICLES
      TIMC = TIMC + DTIME
      TEMP0 = TEMP0 - DTEMP
      X1 = AREX * TGAMA ^ 2! * ESQPAS(1, K1) ^ -4!
      X2 = EXP(BREX / R / TEMP0)
      X3 = EXP((CREX / TEMP0 - 185!) * NB)
      CRF = X1 * X2 * X3
      SFRCTN = DTIME / CRF
      SUM = SUM + SFRCTN
      IF SUM >= 1 THEN EXIT FOR
   NEXT K2
   TEME = TEMP0 - 273: TFMC = 7.66 * TIMC: T50C = .481 * TFMC
   TRIN(K1) = TIMC: TR50(K1) = T50C: TRFIN(K1) = TFMC
   TEMPR(K1) = TEME
   TGORG = TGAMA
   TGAMA = 1.1 * TGAMA ^ .67 * ESQPAS(1, K1) ^ -.67
   IF TEMP0 > TEMPINC(1) THEN
      TPPT = 9999
                         ELSE
      TPPT = LAGRANGE(TEMP0, TEMPINC(), TPINC(), NROPASC)
   END IF
   IF ESQPAS(4, K1) > TFMC AND TFMC < TPPT THEN
      AUX1 = TGAMA ^ 4.5 + 4.1E+23 * (ESQPAS(4, K1) - TFMC)
      AUX2 = EXP(-435000 / R / TEMP0)
      TGAMA = (AUX1 * AUX2) ^ (1 / 4.5)
                           ELSE
      IF TFMC > TPPT THEN THRAK = TPPT ELSE THRAK = ESQPAS(4, K1)
      XREX = 1 - EXP(-.693 * (THRAK / T50C) ^ 2)
      EPS = ESQPAS(1, K1)
      IF K1 > 1 THEN EPS = EPS + LAMBDA * (1 - XREX) * ESQPAS(1, K1 - 1)
      TGAMA = XREX ^ (4 / 3) * TGAMA + (1 - XREX) ^ 2 * TGORG
   END IF
   TG(K1) = TGAMA
   PRINT USING "####"; TEME; : PRINT ".C -> 5%: ";
   PRINT USING "###.#"; TIMC; : PRINT "s; 50%: ";
   PRINT USING "###.#"; T50C; : PRINT "s; 95%: ";
   PRINT USING "###.#"; TFMC; : PRINT "s; TG: ";
   PRINT USING "###.#"; TGORG; : PRINT " um"
NEXT K1
PRINT : PRINT : PRINT "Phase #3: Tnr Calculation": PRINT
FOR I = CK1 + 1 TO NROPAS
   TR50C(I - CK1) = LOG(TR50(I)): TRFINC(I - CK1) = LOG(TRFIN(I))
   TRINC(I - CK1) = LOG(TRIN(I)): TEMPRC(I - CK1) = TEMPR(I)
NEXT I
FOR I = 1 TO NROPASC - 1
   FOR J = I + 1 TO NROPASC
   IF TEMPRC(J) < TEMPRC(I) THEN
        SWAP TEMPRC(J), TEMPRC(I): SWAP TRINC(J), TRINC(I)
        SWAP TR50C(J), TR50C(I): SWAP TRFINC(J), TRFINC(I)
      END IF
   NEXT J
NEXT I
TSIN = TEMPINC(1)
IF TEMPRC(1) > TSIN THEN TSIN = TEMPRC(1)
TSFIN = TEMPINC(NROPASC)
IF TEMPRC(NROPASC) < TSFIN THEN TSFIN = TEMPRC(NROPASC)
FLAG1 = 0: FLAG2 = 0
ICT = 0
FOR TEMP = TSIN TO TSFIN
   ICT = ICT + 1
   TGERAL(ICT) = TEMP
   TINPPT(ICT) = LAGRANGE(TEMP, TEMPINC(), TPINC(), NROPASC)
   TREXIN(ICT) = LAGRANGE(TEMP, TEMPRC(), TRINC(), NROPASC)
   TREX50(ICT) = LAGRANGE(TEMP, TEMPRC(), TR50C(), NROPASC)
   TREXFIN(ICT) = LAGRANGE(TEMP, TEMPRC(), TRFINC(), NROPASC)
   IF EXP(TREXFIN(ICT)) < EXP(TINPPT(ICT)) AND FLAG1 = 0 THEN
      TNR1 = TEMP: FLAG1 = 1
   END IF
   IF EXP(TREXIN(ICT)) < EXP(TINPPT(ICT)) AND FLAG2 = 0 THEN
      TNR2 = TEMP: FLAG2 = 1
   END IF
NEXT TEMP
IF TNR1 <> 0 THEN
        PRINT "Recrystalization Partially Delayed Below ";
        PRINT USING "####"; TNR1; : PRINT ".C (Tnr)."
        ELSE
        PRINT "Tnr Calculation is Unfeasible!"
END IF
IF TNR2 <> 0 THEN
        PRINT : PRINT "Recrystallization Totally Supressed Below ";
        PRINT USING "####"; TNR2; : PRINT ".C (T5%)."
        ELSE
        PRINT : PRINT "T5% Calculation is Unfeasible!"
END IF
PRINT : PRINT
REM
REM *** Impressao de Resultados.
REM
BUF$ = ""
DO UNTIL BUF$ = "Y" OR BUF$ = "y" OR BUF$ = "N" OR BUF$ = "n"
   INPUT "Do You Want to Print Results (Y/N)"; BUF$
LOOP
IF BUF$ = "Y" OR BUF$ = "y" THEN
   BEEP: PRINT
   INPUT "Prepare Printer and Press !", BUF$
   BUF$ = "Mathematical Model for Tnr/T5% Calculation"
   LPRINT TAB((80 - LEN(BUF$)) / 2 + 1); BUF$
   LPRINT TAB((80 - LEN(MODEL$)) / 2 + 1); MODEL$
   BUF$ = DATE$ + ", " + TIME$: LPRINT TAB((80 - LEN(BUF$)) / 2 + 1); BUF$
   LPRINT : LPRINT
   LPRINT "Steel Identification: "; ACO$: LPRINT
   LPRINT "% C: "; : LPRINT USING "#.##"; C;
   LPRINT TAB(15); "% Nb: "; : LPRINT USING "#.###"; NB;
   LPRINT TAB(30); "% N: "; : LPRINT USING "#.####"; NITRO;
   LPRINT TAB(45); "Initial G.S. [microns]: ";
   LPRINT USING "###"; TGINIC
   LPRINT : LPRINT
   LPRINT "Solubilization Conditions: ";
   IF SOLUB$ <> "Propria" THEN
      LPRINT "Equation: "; SOLUB$
                          ELSE
      LPRINT "External Table": LPRINT
      LPRINT "Temperature [.C]"; TAB(20); "% C Equil."; TAB(40);
      LPRINT "% N Equil."; TAB(60); "% Nb Equil."
      FOR I = 1 TO NPSOL
         LPRINT USING "####"; TSOL(I); : LPRINT TAB(20);
         LPRINT USING "#.##"; CSOL(I); : LPRINT TAB(40);
         LPRINT USING "#.####"; NSOL(I); : LPRINT TAB(60);
         LPRINT USING "#.####"; NBSOL(I)
      NEXT
   END IF
   LPRINT : LPRINT : LPRINT
   LPRINT "Results for "; CONFORM$; "Conformation"
   IF CONFORM$ = "Plate Rolling" THEN
      LPRINT " (Work Roll Radius:"; : LPRINT USING "###"; RAIOCIL; :
      LPRINT " mm):"
      LPRINT
      LPRINT STRING$(80, "-");
      LPRINT "#"; TAB(5); "h1"; TAB(11); "h2"; TAB(17);
      LPRINT "Str."; TAB(24); "dS/dt"; TAB(30);
      LPRINT "rpm"; TAB(36);
      LPRINT "dt"; TAB(42); "T"; TAB(48);
      LPRINT "p.05"; TAB(56); "r.05"; TAB(60); "r.50"; TAB(66);
      LPRINT "r.95"; TAB(72); "G.S."
      LPRINT TAB(5); "[mm]"; TAB(11); "[mm]"; TAB(17);
      LPRINT TAB(24); "[s^-1]"; TAB(30);
      LPRINT "[s]"; TAB(42); "[.C]"; TAB(48);
      LPRINT "[s]"; TAB(54); "[s]"; TAB(60); "[s]"; TAB(66);
      LPRINT "[s]"; TAB(72); "[um]"
      LPRINT STRING$(80, "-");
      FOR I = 1 TO NROPAS
         LPRINT USING "##"; I; : LPRINT TAB(5);
         LPRINT USING "###"; ESQIND(1, I); : LPRINT : LPRINT TAB(11);
         LPRINT USING "###"; ESQIND(2, I); : LPRINT TAB(17);
         LPRINT USING "#.##"; ESQPAS(1, I); : LPRINT TAB(24);
         LPRINT USING "###.#"; ESQPAS(2, I); : LPRINT TAB(30);
         LPRINT USING "###"; ESQIND(3, I); : LPRINT TAB(36);
         LPRINT USING "###"; ESQPAS(4, I); : LPRINT TAB(42);
         LPRINT USING "####"; ESQPAS(3, I) - 273; : LPRINT TAB(48);
         IF TPIN(I) = 9999 THEN
            LPRINT "Nihil";
                           ELSE
            LPRINT USING "###.##"; TPIN(I);
         END IF
         LPRINT TAB(56);
         LPRINT USING "###.#"; TRIN(I); : LPRINT TAB(60);
         LPRINT USING "###.#"; TR50(I); : LPRINT TAB(66);
         LPRINT USING "###.#"; TRFIN(I); : LPRINT TAB(72);
         LPRINT USING "###"; TG(I)
      NEXT I
                              ELSE
      LPRINT ":": LPRINT
      LPRINT STRING$(80, "-");
      LPRINT "#"; TAB(5);
      LPRINT "Str."; TAB(12); "dS/dt"; TAB(19);
      LPRINT "dt"; TAB(26); "T"; TAB(33);
      LPRINT "p.05"; TAB(40); "r.05"; TAB(47); "r.50"; TAB(54);
      LPRINT "r.95"; TAB(61); "T.G."
      LPRINT TAB(12); "[s^-1]"; TAB(19);
      LPRINT "[s]"; TAB(26); "[.C]"; TAB(33);
      LPRINT "[s]"; TAB(40); "[s]"; TAB(47); "[s]"; TAB(54);
      LPRINT "[s]"; TAB(61); "[um]"
      LPRINT STRING$(80, "-");
      FOR I = 1 TO NROPAS
         LPRINT USING "##"; I; : LPRINT TAB(5);
         LPRINT USING "#.##"; ESQPAS(1, I); : LPRINT TAB(12);
         LPRINT USING "###.#"; ESQPAS(2, I); : LPRINT TAB(19);
         LPRINT USING "###"; ESQPAS(4, I); : LPRINT TAB(26);
         LPRINT USING "####"; ESQPAS(3, I) - 273; : LPRINT TAB(33);
         IF TPIN(I) = 9999 THEN
            LPRINT "Nihil";
                           ELSE
            LPRINT USING "###.##"; TPIN(I);
         END IF
         LPRINT TAB(40);
         LPRINT USING "###.#"; TRIN(I); : LPRINT TAB(47);
         LPRINT USING "###.#"; TR50(I); : LPRINT TAB(54);
         LPRINT USING "###.#"; TRFIN(I); : LPRINT TAB(61);
         LPRINT USING "###"; TG(I)
      NEXT I
   END IF
   LPRINT : LPRINT
IF TNR1 <> 0 THEN
   LPRINT "Recrystallization Partially Delayed Below ";
   LPRINT USING "####"; TNR1; : LPRINT ".C (Tnr)."
             ELSE
   LPRINT "Tnr Calculation is Unfeasible!"
END IF
IF TNR2 <> 0 THEN
   LPRINT : LPRINT "Recrystallization Totally Supressed Below ";
   LPRINT USING "####"; TNR2; : LPRINT ".C (T5%)."
             ELSE
   LPRINT : LPRINT "T5% Calculation is Unfeasible!"
END IF
   LPRINT CHR$(12)
END IF
REM
REM *** Tracar Grafico
REM
BUF$ = ""
PRINT
DO UNTIL BUF$ = "Y" OR BUF$ = "y" OR BUF$ = "N" OR BUF$ = "n"
   INPUT "Do You Want to Plot Graphics (Y/N)"; BUF$
LOOP
IF BUF$ = "N" OR BUF$ = "n" THEN END
FOR I = 1 TO NROPAS
   TRIN(I) = LOG(TRIN(I)): TR50(I) = LOG(TR50(I)): TRFIN(I) = LOG(TRFIN(I))
NEXT I
FOR I = 1 TO NROPAS - 1
   FOR J = I + 1 TO NROPAS
      IF TEMPR(J) < TEMPR(I) THEN
         SWAP TEMPR(J), TEMPR(I): SWAP TRIN(J), TRIN(I)
         SWAP TR50(J), TR50(I): SWAP TRFIN(J), TRFIN(I)
      END IF
   NEXT J
NEXT I
ICTR = 0
FOR TEMP = TEMPR(1) TO TEMPR(NROPAS)
   ICTR = ICTR + 1
   TGERALR(ICTR) = TEMP
   TREXIN(ICTR) = LAGRANGE(TEMP, TEMPR(), TRIN(), NROPAS)
   TREX50(ICTR) = LAGRANGE(TEMP, TEMPR(), TR50(), NROPAS)
   TREXFIN(ICTR) = LAGRANGE(TEMP, TEMPR(), TRFIN(), NROPAS)
NEXT TEMP
DO UNTIL BUF$ = "N" OR BUF$ = "n"
   SCREEN 0
   VIEW PRINT 1 TO 24: CLS
   BF$ = "MATHEMATICAL MODEL FOR Tnr/T5% CALCULATION"
   PRINT TAB((80 - LEN(BF$)) / 2 + 1);
   COLOR 0, 7: PRINT BF$: COLOR 7, 0
   VIEW PRINT 2 TO 24
   LOCATE 7
   PRINT : PRINT TAB(31); "<1> Axis Definition"
   PRINT : PRINT TAB(31); "<2> Graphics Plotting"
   PRINT : PRINT TAB(31); "<3> Graphics Checkering"
   PRINT : PRINT TAB(31); "<4> Show Graphics"
   PRINT : PRINT TAB(31); "<5> End Program"
   WHILE R < 1 OR R > 5
      LOCATE 23
      PRINT TAB(31); "Your Option? "; : INPUT "", R
      IF R < 1 OR R > 5 THEN BEEP
   WEND
   SELECT CASE R
      CASE 1
         XA$ = "Log(Time) [log(s)] - Steel: " + ACO$
         YA$ = "Temperature [.C]"
         INITAXIS TINPPT(), TGERAL(), ICT
      CASE 2
         AXIS
         PLOTLINE TINPPT(), TGERAL(), ICT
         PLOTLINE TREXIN(), TGERALR(), ICTR
         PLOTLINE TREX50(), TGERALR(), ICTR
         PLOTLINE TREXFIN(), TGERALR(), ICTR
         BF$ = "Tnr: " + STR$(INT(TNR1)) + ".C"
         LABEL BF$, 80, 190
         BF$ = "T5%: " + STR$(INT(TNR2)) + ".C"
         LABEL BF$, 80, 210
         BF$ = "p.05"
         CARTESIAN TINPPT(1), TGERAL(1), AUX1, AUX2
         LABEL BF$, AUX1 + 10, AUX2
         BF$ = "r.05"
         CARTESIAN TREXIN(1), TGERAL(1), AUX1, AUX2
         LABEL BF$, AUX1 + 5, AUX2
         BF$ = "r.5"
         CARTESIAN TREX50(1), TGERAL(1), AUX1, AUX2
         LABEL BF$, AUX1 + 5, AUX2
         BF$ = "r.95"
         CARTESIAN TREXFIN(1), TGERAL(1), AUX1, AUX2
         LABEL BF$, AUX1 + 5, AUX2
         a$ = ""
         WHILE a$ = ""
            a$ = INKEY$
         WEND
         GET (0, 0)-(XRESOL - 1, YRESOL - 1), GRAPHICS
      CASE 3
         GRID
      CASE 4
         SHOWGRAPH
      CASE 5
         BUF$ = "N": EXIT DO
   END SELECT
   R = 0
LOOP
VIEW PRINT 1 TO 24
END

SUB AXIS
   SCREEN 11: X$ = XA$: Y$ = YA$
   XMARGMIN = XRESOL / 12.549: XMARGMAX = XRESOL / 1.002
   YMARGMIN = YRESOL / 16.667: YMARGMAX = YRESOL / 1.13
   LINE (XMARGMIN, YMARGMIN)-(XMARGMAX, YMARGMIN)
   LINE (XMARGMAX, YMARGMIN)-(XMARGMAX, YMARGMAX)
   LINE (XMARGMIN, YMARGMAX)-(XMARGMAX, YMARGMAX)
   LINE (XMARGMIN, YMARGMAX)-(XMARGMIN, YMARGMIN)
   SX = (X1 - X0) / NX: SY = (Y1 - Y0) / NY
   FOR I = X0 TO X1 STEP SX
      CARTESIAN I, 0!, PX, PY
      LINE (PX, YMARGMIN)-(PX, YRESOL / 10.526)
      LINE (PX, YMARGMAX)-(PX, YRESOL / 1.176)
   NEXT
   FOR I = Y0 TO Y1 STEP SY
      CARTESIAN 0!, I, PX, PY
      LINE (XMARGMIN, PY)-(XRESOL / 9.552, PY)
      LINE (XMARGMAX, PY)-(XRESOL / 1.029, PY)
   NEXT
   VAR = X0
   NOTEXP EX, VAR, PIV
   VAR = X1
   NOTEXP EX, VAR, POV: IF ABS(PIV) < ABS(POV) THEN PIV = POV
   FOR K = X0 TO X1 STEP SX
      CARTESIAN K, 0!, PX, PY
      IF PX < XRESOL / 1.061 THEN
         VAR = K
         NOTEXP EX, VAR, POV
         IF POV <> PIV THEN VAR = VAR * 10 ^ (3 * (POV - PIV))
         IF ABS(VAR) < .001 THEN VAR = 0
         IF PIV <> 0 THEN VAR = INT(VAR + .5)
         p$ = LEFT$(STR$(VAR), 5): Y = YRESOL / 1.07
         X = PX - 6 * LEN(p$)
         LABEL p$, X, Y
      END IF
   NEXT
   EX = PIV
   VAR = Y0
   NOTEXP EY, VAR, PIV
   VAR = Y1
   NOTEXP EY, VAR, POV: IF ABS(PIV) > ABS(POV) THEN PIV = POV
   FOR K = Y0 TO Y1 STEP SY
      CARTESIAN 0, K, PX, PY
      IF PY >= YRESOL / 10 THEN
         Y = PY + 2
         VAR = K
         NOTEXP EY, VAR, POV
         IF POV <> PIV THEN VAR = VAR * 10 ^ (3 * (POV - PIV))
         IF ABS(VAR) < .001 THEN VAR = 0
         IF PIV <> 0 THEN VAR = INT(VAR + .5)
         p$ = LEFT$(STR$(VAR), 5): X = XMARGMIN - XRESOL / 64 * LEN(p$)
         LABEL p$, X, Y
      END IF
   NEXT
   EY = PIV
   IF X0 * X1 <= 0 THEN
      CARTESIAN 0!, Y, PX, PY
      LINE (PX, YMARGMIN)-(PX, YMARGMAX)
   END IF
   IF Y0 * Y1 < 0 THEN
      CARTESIAN X, 0!, PX, PY
      LINE (XMARGMIN, PY)-(XMARGMAX, YMARGMAX)
   END IF
   IF EX <> 0 THEN
      IF EX > 0 THEN OFS = 1 ELSE OFS = 0
      EX$ = "(x10^" + RIGHT$(STR$(3 * EX), LEN(STR$(3 * EX)) - OFS) + ")"
      X$ = X$ + " " + EX$
   END IF
   IF EY <> 0 THEN
      IF EY > 0 THEN OFS = 1 ELSE OFS = 0
      EY$ = "(x10^" + RIGHT$(STR$(3 * EY), LEN(STR$(3 * EY)) - OFS) + ")"
      Y$ = Y$ + " " + EY$
   END IF
   X = XMARGMIN + INT(XRESOL / 1.21 - XRESOL / 64 * LEN(X$)) / 2
   Y = YRESOL / 1.01
   LABEL X$, X, Y
   X = XMARGMIN: Y = YRESOL / 25
   LABEL Y$, X, Y
END SUB

SUB CARTESIAN (X, Y, PX, PY)
   PX = XMARGMIN + XRESOL / 1.088 * (X - X0) / (X1 - X0)
   PY = YMARGMIN + YRESOL / 1.212 * (Y1 - Y) / (Y1 - Y0)
END SUB

SUB GRID
   SCREEN 11: PUT (0, 0), GRAPHICS, PSET
   PU = XRESOL / 1.09 / NX: PA = YRESOL / 1.212 / NY
   FOR X = XMARGMIN TO XMARGMAX - 10 STEP PU
      FOR Y = YMARGMIN TO YMARGMAX STEP PA / 5
         PSET (X, Y)
      NEXT
   NEXT
   FOR Y = YMARGMIN TO YMARGMAX STEP PA
      FOR X = XMARGMIN TO XMARGMAX STEP PU / 5
         PSET (X, Y)
      NEXT
   NEXT
   GET (0, 0)-(XRESOL - 1, YRESOL - 1), GRAPHICS
   a$ = ""
   WHILE a$ = ""
      a$ = INKEY$
   WEND
END SUB

SUB HARDCOPY
   STATIC FLAGPRINTER
   LOCATE 11: PRINT "Prepare Printer; "
   PRINT : INPUT "Press  to Continue! ", R$
   SCREEN 11: PUT (0, 0), GRAPHICS, PSET
   IF FLAGPRINTER = 0 THEN FLAGPRINTER = 1
   OPEN "LPT1:" FOR RANDOM AS #3: WIDTH #3, 255
   PRINT #3, CHR$(24); : PRINT #3, CHR$(27); "A"; CHR$(8);
   DEF SEG = &HB800
   FOR a = 0 TO 79:
     PRINT #3, CHR$(27); "K"; CHR$(144); CHR$(1);
     B = a + &H1EF0
     FOR C = 1 TO 100:
        D = PEEK(B): EPRT = PEEK(B + &H2000):
        PRINT #3, CHR$(EPRT); CHR$(EPRT); CHR$(D); CHR$(D);
        B = B - 80:
     NEXT C
     PRINT #3, CHR$(13); CHR$(10);
   NEXT
   PRINT #3, CHR$(13); CHR$(24); CHR$(27); CHR$(50);
   LPRINT CHR$(12)
END SUB

SUB INITAXIS (X(), Y(), N)
   X0 = X(1): X1 = X(1): Y0 = Y(1): Y1 = Y(1)
   FOR I = 2 TO N
      IF X0 > X(I) THEN X0 = X(I)
      IF X1 < X(I) THEN X1 = X(I)
      IF Y0 > Y(I) THEN Y0 = Y(I)
      IF Y1 < Y(I) THEN Y1 = Y(I)
   NEXT I
   VIEW PRINT 1 TO 24: CLS
   BF$ = "DEFINITION OF AXIS AND GRAPHICAL ELEMENTS": PRINT TAB((80 - LEN(BF$)) / 2 + 1);
   COLOR 0, 7: PRINT BF$: COLOR 7, 0: VIEW PRINT 4 TO 24
   LOCATE 7
   PRINT "Min Log(Time): "; X0; : INPUT " - New: ", S$
   IF S$ <> "" THEN X0 = VAL(S$)
   LOCATE 9
   PRINT "Max Log(Time): "; X1; : INPUT " - New: ", S$
   IF S$ <> "" THEN X1 = VAL(S$)
   LOCATE 11
   PRINT "Min Temperature [.C]: "; Y0; : INPUT " - New: ", S$
   IF S$ <> "" THEN Y0 = VAL(S$)
   LOCATE 13
   PRINT "Max Temperature [.C]: "; Y1; : INPUT " - New: ", S$
   IF S$ <> "" THEN Y1 = VAL(S$)
   LOCATE 16
   PRINT "Number of Tick Divisions, X Axis: "; NX
   INPUT "New: ", S$: IF S$ <> "" THEN NX = VAL(S$)
   LOCATE 19
   PRINT "Number of Tick Divisions, Y Axis: "; NY
   INPUT "New: ", S$: IF S$ <> "" THEN NY = VAL(S$)
END SUB

SUB INITGRAPH
   CLS
   BEEP
   R$ = ""
   WHILE R$ <> "Y" AND R$ <> "y" AND R$ <> "N" AND R$ <> "n"
      LOCATE 11
      INPUT "The Program  Has Been Loaded"; R$
   WEND
   IF R$ = "N" OR R$ = "n" THEN
      LOCATE 13: PRINT "Then Goto DOS and Load It!": END
   END IF
   NX = 5: NY = 5: XRESOL = 640: YRESOL = 480
   OPEN "TABFORM.VGA" FOR INPUT AS #1
   FOR I = 28 TO 125: LINE INPUT #1, LETRA$(I): NEXT
   CLOSE #1
END SUB

SUB LABEL (p$, X, Y)
   FOR I = 1 TO LEN(p$)
   PA$ = MID$(p$, I, 1)
   IF PA$ <> " " THEN
      AP = ASC(PA$)
      PSET (X + (I - 1) * 10, Y), 0: DRAW LETRA$(AP)
   END IF
   NEXT
END SUB

FUNCTION LAGRANGE (Z, X(), Y(), N)
   DIM X1(4), Y1(4)
   I = 1
   IF Z <= X(1) THEN LAGRANGE = Y(1): EXIT FUNCTION
   IF Z >= X(N) THEN LAGRANGE = Y(N): EXIT FUNCTION
   WHILE Z > X(I)
      I = I + 1
   WEND
   IF I < 3 THEN
      FOR J = 1 TO 4
         X1(J) = X(J): Y1(J) = Y(J)
      NEXT
            ELSE
      IF I > N - 2 THEN
         C1 = N - 3
         FOR J = 0 TO 3
            X1(J + 1) = X(C1 + J): Y1(J + 1) = Y(C1 + J)
         NEXT
            ELSE
         C1 = I - 2
         FOR J = 0 TO 3
            X1(J + 1) = X(C1 + J): Y1(J + 1) = Y(C1 + J)
         NEXT
      END IF
   END IF
   S = 0
   FOR I = 1 TO 4
      M = 1
      FOR J = 1 TO 4
        IF J <> I THEN M = M * (Z - X1(J)) / (X1(I) - X1(J))
      NEXT J
      S = S + M * Y1(I)
      NEXT I
   LAGRANGE = S
END FUNCTION

SUB NOTEXP (EXPO, VAR, POV)
   POV = 0
   SI = 1: IF VAR < 0 THEN SI = -1
   VAR = ABS(VAR)
      IF VAR < 10 ^ -(EXPO + 3) THEN
         VAR = 0
                                ELSE
         WHILE VAR > 999 OR VAR < 1
            IF VAR > 999 THEN VAR = VAR / 1000: POV = POV + 1
            IF VAR < 1 THEN VAR = VAR * 1000: POV = POV - 1
         WEND
      END IF
   VAR$ = STR$(SI * VAR)
   VAR$ = LEFT$(VAR$, 5)
   VAR = VAL(VAR$)
END SUB

SUB PLOTLINE (X(), Y(), N)
   PTOINIC = 0
   FOR I = 1 TO N
      CARTESIAN X(I), Y(I), PX, PY
      IF PY < YMARGMIN OR PY > YMARGMAX OR PX < XMARGMIN OR PX > XMARGMAX THEN
         PTOINIC = 0
                                                                          ELSE
            IF PTOINIC = 0 THEN
               PTOINIC = 1: PX1 = PX: PY1 = PY
                           ELSE
               IF I > 1 THEN LINE (PX1, PY1)-(PX, PY)
               PX1 = PX: PY1 = PY
            END IF
      END IF
   NEXT
   GET (0, 0)-(XRESOL - 1, YRESOL - 1), GRAPHICS
END SUB

SUB PLOTPOINT (X(), Y(), N, SM)
   FOR I = 1 TO N
      CARTESIAN X(I), Y(I), PX, PY
      IF PY >= YMARGMIN AND PY <= YMARGMAX THEN
         IF PX >= XMARGMIN AND PX <= XMARGMAX THEN
            IF SM = 1 THEN
               CIRCLE (PX, PY), 2.25
                      ELSE
                      PSET (PX, PY), 0: DRAW LETRA$(SM + 26)
            END IF
         END IF
      END IF
   NEXT
   GET (0, 0)-(XRESOL - 1, YRESOL - 1), GRAPHICS
   a$ = ""
END SUB

SUB SHOWGRAPH
   SCREEN 11: PUT (0, 0), GRAPHICS, PSET
   a$ = ""
   WHILE a$ = ""
      a$ = INKEY$
   WEND
END SUB

FUNCTION SOLUVEL (PARSOL, TSOL(), CSOL(), NSOL(), NBSOL(), NPSOL, TEMP0, SOLUB$)
IF SOLUB$ = "Irvine" THEN SOLUVEL = PARSOL / 10 ^ (2.26 - 6770 / TEMP0)
IF SOLUB$ = "Propria" THEN
   CEQ = LAGRANGE(TEMP0 - 273, TSOL(), CSOL(), NPSOL)
   NEQ = LAGRANGE(TEMP0 - 273, TSOL(), NSOL(), NPSOL)
   NBEQ = LAGRANGE(TEMP0 - 273, TSOL(), NBSOL(), NPSOL)
   SOLUVEL = PARSOL / (NBEQ * (CEQ + 12 * NEQ / 14))
END IF
END FUNCTION

***** End of Program Listing ******


Return to the Software Menu.

Last Update: 21 December 1998
© Antonio Augusto Gorni