home *** CD-ROM | disk | FTP | other *** search
- # HEAT.ODE
- # This file demostrates how to solve a partial differential equation, in this
- # case the heat equation, with ODE.
- # We use finite differences for the second-order space derivatives.
- # We solve on a circle, with a source of heat at one point.
- # Plot any u variable against time.
-
- $f 0
- $t 50
-
- # intital values
- u1 = 0
- u2 = 0
- u3 = 0
- u4 = 0
- u5 = 1
- u6 = 0
- u7 = 0
- u8 = 0
- u9 = 0
-
- # differential equations
- u1' = u2-2*u1+u9
- u2' = u3-2*u2+u1
- u3' = u4-2*u3+u2
- u4' = u5-2*u4+u3
- u5' = u6-2*u5+u4
- u6' = u7-2*u6+u5
- u7' = u8-2*u7+u6
- u8' = u9-2*u8+u7
- u9' = u1-2*u9+u8