1 MAIN PART Jackoby.
2 BEGIN
3 Matrix: (Oi: (i=1..m); Oj: (j=1..m)).
4 Oj1, Oj2: Oj/j<>i.
5 VARIABLE X0, X, F DEFINED ON Oi.
6 VARIABLE A DEFINED ON Matrix.
7 VARIABLE Epsilon.
8 DOMAIN PARAMETERS m=4.
9 INPUT X0(FILE='jackoby') ON Oi.
10 INPUT F(FILE='jackoby') ON Oi.
11 INPUT A(FILE='jackoby') ON Matrix.
12 INPUT Epsilon(FILE='jackoby').
13 OUTPUT X(FILE='jackoby.out') ON Oi.
14 ITERATION X ON n.
15 INITIAL n=0:
16 FOR Oi ASSUME X=X0.
17 END INITIAL
18 FOR Oi ASSUME X=1/A[j=i]*(F-SUM((Oj1)A*X[i=j,n-1])).
19 EXIT WHEN MAX((Oi)ABS(X[n]-X[n-1]))<Epsilon.
20 END ITERATION n.
21 END PART.

 

( ).

(1) Jackoby.

(2) .

(3) Matrix

(4) Oj1, Oj2. , j<>i Oj, j. , , , - . i.

(5-7) X0 - , A - , F - , Epsilon - , X - .

(8) ( ).

(9-12) X0, F, A Epsilon jackoby.dat, :

X0(i=1..4)= 0.0, 0.0, 0.0, 0.0;
F(i=1..4)= 1.5471, 1.6471, 1.7471, 1.8471;
A(i=1..4,j=1..4)= 1.1161, 0.1254, 0.1397, 0.1490,
0.1582, 1.1675, 0.1768, 0.1871,
0.1968, 0.2071, 1.2168, 0.2271,
0.2368, 0.2471, 0.2568, 1.2671;
Epsilon = 0.0001;

(13) jackoby.out

(14-20) .

(18) X

Oi, i. A[j=i] , A(i,i) A; F - F(i) F. SUM((Oj1)A*X[i=j,n-1])) SUM Oj1 j , i .

(21) .