Support RETURN-FROM in DEF%TR forms
[maxima.git] / share / colnew / ex1 / prob1.f
blobca77a33649538cab83c5338b7067f5ea79770061
1 C MAN 10
2 C---------------------------------------------------------------- MAN 20
3 C MAN 30
4 C PROBLEM 1 - SEE COMPANION PAPER MAN 40
5 C MAN 50
6 implicit real*8 (a-h, o-z)
7 REAL*8 FSPACE(2000), ZETA(4), TOL(2), Z(4), U(4), ERR(4) MAN 60
8 INTEGER ISPACE(200), M(1), IPAR(11), LTOL(2) MAN 70
9 EXTERNAL FSUB, DFSUB, GSUB, DGSUB MAN 80
10 C MAN 90
11 WRITE (6,99999) MAN 100
12 C MAN 110
13 C ONE DIFFERENTIAL EQUATION OF ORDER 4. MAN 120
14 M(1) = 4 MAN 130
15 C GIVE LOCATION OF BOUNDARY CONDITIONS MAN 140
16 ZETA(1) = 1. MAN 150
17 ZETA(2) = 1. MAN 160
18 ZETA(3) = 2. MAN 170
19 ZETA(4) = 2. MAN 180
20 C SET UP PARAMETER ARRAY. MAN 190
21 C USE DEFAULT VALUES FOR ALL PARAMETERS EXCEPT FOR INITIAL MAN 200
22 C MESH SIZE, NO. OF TOLERANCES AND SIZES OF WORK ARRAYS MAN 210
23 DO 10 I=1,11 MAN 220
24 IPAR(I) = 0 MAN 230
25 10 CONTINUE MAN 240
26 IPAR(3) = 1 MAN 250
27 IPAR(4) = 2 MAN 260
28 IPAR(5) = 2000 MAN 270
29 IPAR(6) = 200 MAN 280
30 C TWO ERROR TOLERANCES (ON U AND ITS SECOND DERIVATIVE) MAN 290
31 LTOL(1) = 1 MAN 300
32 LTOL(2) = 3 MAN 310
33 TOL(1) = 1.E-7 MAN 320
34 TOL(2) = 1.E-7 MAN 330
35 C MAN 340
36 CALL COLSYS(1, M, 1d0, 2d0, ZETA, IPAR, LTOL, TOL, DUMMY,
37 $ ISPACE,
38 * FSPACE, IFLAG, FSUB, DFSUB, GSUB, DGSUB, DUMMY)
39 C MAN 370
40 IF (IFLAG.NE.1) STOP MAN 380
41 C CALCULATE THE ERROR AT 101 POINTS USING THE KNOWN MAN 390
42 C EXACT SOLUTION MAN 400
43 X = 1. MAN 410
44 DO 20 I=1,4 MAN 420
45 ERR(I) = 0. MAN 430
46 20 CONTINUE MAN 440
47 DO 40 J=1,101 MAN 450
48 CALL APPSLN(X, Z, FSPACE, ISPACE) MAN 460
49 CALL EXACT(X, U) MAN 470
50 DO 30 I=1,4 MAN 480
51 ERR(I) = AMAX1(ERR(I),ABS(U(I)-Z(I))) MAN 490
52 30 CONTINUE MAN 500
53 X = X + .01 MAN 510
54 40 CONTINUE MAN 520
55 WRITE (6,99998) (ERR(I),I=1,4) MAN 530
56 STOP MAN 540
57 99999 FORMAT (1H1, 35H EXAMPLE OF A SIMPLE PROBLEM SETUP./10H UNIFORML,MAN 550
58 * 36HY LOADED BEAM OF VARIABLE STIFFNESS,/21H SIMPLY SUPPORTED AT,MAN 560
59 * 11H BOTH ENDS./) MAN 570
60 99998 FORMAT (/27H ERROR TOLERANCES SATISFIED//22H THE EXACT ERRORS ARE,MAN 580
61 * /7X, 4E12.4) MAN 590
62 END MAN 600