home *** CD-ROM | disk | FTP | other *** search
- .MCD 20000 0
- .CMD PLOTFORMAT logs=0,0 subdivs=1,1 size=5,15 type=l
- .CMD FORMAT rd=d ct=10 im=i et=3 zt=15 pr=3 mass length time charge
- .CMD SET ORIGIN 0
- .CMD SET TOL 0.001000
- .CMD MARGIN 0
- .CMD LINELENGTH 78
- .CMD SET PRNCOLWIDTH 8
- .CMD SET PRNPRECISION 4
- .TXT 0 42 1 39
- a1,38,39,37
- Copyright (c) 1988 by MathSoft, Inc.
- .TXT 1 -42 2 15
- a2,14,78,22
- THE LAPLACE
- EQUATION
- .TXT 0 16 3 65
- a3,64,62,150
- This document solves for the steady state temperatures over a
- rectangular plate with fixed temperatures along the edges,
- using a relaxation method.
- .TXT 0 65 1 13
- a1,12,78,11
- /equations
- .TXT 4 -80 2 19
- a2,18,77,31
- number of nodes
- on each edge:
- .TXT 0 24 1 12
- a1,11,44,10
- vertical:
- .EQN 0 11 1 7
- M~8
- .EQN 0 15 1 11
- m~M-1
- .EQN 0 14 1 12
- i:0;m
- .TXT 0 16 1 71
- a1,70,76,69
- Some node selection functions and corresponding averaging functions:
- .TXT 1 -58 1 14
- a1,13,44,12
- horizontal:
- .EQN 0 13 1 7
- N~8
- .EQN 0 15 1 11
- n~N-1
- .EQN 0 14 1 12
- j:0;n
- .EQN 1 16 1 48
- notedge(i,j)~(i>0)*(j>0)*(i<m)*(j<n)
- .TXT 1 -80 1 43
- a1,42,77,41
- guess for temperature at interior nodes:
- .EQN 0 44 2 11
- M[(i,j):0
- .TXT 1 36 1 22
- a1,21,76,20
- for interior nodes:
- .TXT 1 -80 1 20
- a1,19,77,18
- temperature on...
- .TXT 1 4 1 65
- a1,64,80,63
- top left bottom right
- .EQN 0 76 3 61
- I(C,i,j)~(1/4)*(C[(i+1,j)+C[(i-1,j)+C[(i,j+1)+C[(i,j-1)-4*C[(i,j))
- .EQN 2 -76 2 11
- M[(0,j):2
- .EQN 0 19 2 11
- M[(i,0):1
- .EQN 0 19 2 12
- M[(m,j):-2
- .EQN 0 19 2 12
- M[(i,n):-1
- .TXT 2 19 1 50
- a1,49,76,48
- for insulated edges, not including the corners:
- .EQN 1 -80 1 23
- WRITEPRN(matrix):M
- .TXT 0 27 3 50
- a3,49,47,118
- After calculating this screen, disable the
- equation at the left with the equation command.
- Then press [Ctrl][PgDn].
- .EQN 1 53 1 36
- top(i,j)~(i≈0)*(j>0)*(j<n)
- .EQN 2 0 3 52
- T(C,i,j)~(1/4)*(C[(0,j-1)+C[(0,j+1)+2*C[(1,j)-4*C[(i,j))
- .EQN 2 -80 1 22
- A:READPRN(matrix)
- .TXT 0 27 2 46
- a2,45,47,72
- Now press [F10] C P repeatedly to iterate.
- B approaches the solution.
- .TXT 2 81 1 39
- a1,38,52,37
- ...and similarly for the other edges
- .EQN 1 -108 2 44
- B[(i,j):A[(i,j)+if(notedge(i,j),I(A,i,j),0)
- .TXT 0 80 1 15
- a1,14,78,13
- [Ctrl][PgDn]
- .EQN 2 -29 1 23
- WRITEPRN(matrix):B
- .TXT 0 29 3 78
- a3,77,75,160
- For example, if the right, left, and bottom edges of the plate are held at
- fixed temperatures and the top edge is insulated, the relaxation equation
- will be:
- .EQN 2 -29 2 25
- max((|(A-B)){49})=?
- .TXT 1 -21 1 20
- a1,19,52,18
- largest residual:
- .EQN 1 50 2 67
- B[(i,j):A[(i,j)+if(notedge(i,j),I(A,i,j),if(top(i,j),T(A,i,j),0))
- .EQN 1 -67 8 54
- B={18994}?
-