Private Sub Form_Click ()
As Single Dim (x), y () AsSingle, () As a Single, () As Single b, c () As Single
ReDim x (11, 3), y (11, 3), a (11, 3), b (11, 3), c (11, 3)
(0, 0)=1.0026 x: y=0 (0, 0), (0, 1)=1.145 x: y (0, 1)=0.0059, (0, 2)=1.2299 x: y (0, 2)=0.0094
(1, 0)=0.9712 x: y (1, 0)=0.0052, (1, 2)=0.9872 x: y (1, 2)=0.1242
(2, 0)=0.6792 x: y (2, 0)=0.0386, (2, 2)=0.6907 x: y (2, 2)=0.1581
(3, 0)=0.4473 x: y=0.0559 (3, 0), (3, 2)=0.4538 x: y (3, 2)=0.1759
(4, 0)=0.1654 x: y=0.0549 (4, 0), (4, 2)=0.154 x: y (4, 2)=0.1744
X (5, 0)=0, y (4, 0)=0: (5, 2)=0.12 x: y (5, 2)=0
(6, 0)=0.1654 x: y=0.0549 (6, 0), (6, 2)=0.154 x: y (6, 2)=0.1744
(7, 0)=0.4473 x: y=0.0559 (7, 0), (7, 2)=0.4538 x: y (7, 2)=0.1759
(8, 0)=0.6792 x: y=0.0386 (8, 0), (8, 2)=0.6907 x: y (8, 2)=0.1581
(9, 0)=0.9712 x: y=0.0052 (9, 0), (9, 2)=0.9872 x: y (9, 2)=0.1242
(10, 0)=1.0026 x: y (10, 0)=0: (10, 1)=1.145 x: y (10, 1)=0.0059: (10, 2)=1.2299 x: y (10, 2)=0.0094
X (1, 1)=1: x (2, 1)=1: x (3, 1)=1: x (4, 1)=1: x (5, 1)=1: x (6, 1)=1: x (7, 1)=1: x (8, 1)=1: x (9, 1)=1:
Y (1, 1)=1: y (2, 1)=1: y (3, 1)=1: y (4, 1)=1: y (5, 1)=1: y (6, 1)=1: y (7, 1)=1: y (8, 1)=1: y (9, 1)=1:
Do
For I=1 To 9
J=1
A (I, j)=(x (I, j + 1), x (I, j - 1)) ^ 2/0.32 + (y (I, j + 1) - y (I, j - 1)) ^ 2/0.32
B (I, j)=(x (I + 1, j), x (I - 1, j)) * (x (I, j + 1) - x (I, j - 1))/0.32 + (y (I + 1, j), y (I - 1, j)) * (y (I, j + 1) - y (I, j - 1))/0.32
C (I, j)=(x (I + 1, j), x (I - 1, j)) ^ 2/0.08 + (y (I + 1, j), y (I - 1, j)) ^ 2/0.08
Bw=be=a (I, j)/0.04
Bs=bn=c (I, j)/0.16
Bp=a (I, j)/0.02 + c (I, j)/0.08
CPX=- (I, j) * b (x (I + 1, j + 1) - (I + 1, j - 1) x - x (I - 1, j + 1) + x (I - 1, j - 1))/0.16
Cpy=- b (I, j) * (y (I + 1, j + 1), y (I + 1, j - 1) - (I - 1, j + 1) y + y (j - I - 1, 1))/0.16
X (I, j)=(bw * x (I - 1, j) + be * x (I + 1, j) + bs * x (I, j - 1) + bn * x (I, j + 1) + CPX)/bp
Y (I, j)=(bw * y (I - 1, j) + be * y (I + 1, j) + bs * y (I, j - 1) + bn * y (I, j + 1) + cpy)/bp
Next I
Loop While x (I, j) - (bw * x (I - 1, j) + be * x (I + 1, j) + bs * x (I, j - 1) + bn * x (I, j + 1) + CPX)/bp & gt; 0.0001 the And y (I, j) - (bw * y (I - 1, j) + be * y (I + 1, j) + bs * y (I, j - 1) + bn * y (I, j + 1) + cpy)/bp & gt; 0.0001
For I=1 To 9
J=1
Print x (I, j), x (I, j)
Next I
End Sub
Is 18 equation is solved, 18 solution of the equations of the unknown,
Use of iteration, the initial value is given, the Do loop cycle, when a value minus the next value reaches a minimum amount, jump out of the loop,
Can regardless of these to see if any wrong in grammar, the equivalent of two dimensional array x (I, j), including j is 1. Write 18 equation used FOr statement, then DO statement cycle 18 iterative solution of this equation, the given above is a known condition and the initial iteration value (selection FOr 1), but the final output is a small number of obviously wrong, this is how to return a responsibility?
CodePudding user response:
This algorithm is, grammar questions program run up at allCodePudding user response:
Add Debug. Print auxiliary Debug output intermediate results,CodePudding user response:
X (5, 0)=0, y (4, 0)=0: (5, 2)=0.12 x: y (5, 2)=0Only find y here to write wrong
CodePudding user response: