File: soliton.ode

package info (click to toggle)
plotutils 2.6-15
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,040 kB
  • sloc: ansic: 68,670; sh: 20,086; cpp: 12,382; yacc: 2,588; makefile: 838; lex: 137
file content (25 lines) | stat: -rw-r--r-- 432 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# You may run this example by doing:
#
#    ode < soliton.ode | graph -T X -C
#
# or alternatively, to create a real-time plot,
#
#    ode < soliton.ode | graph -T X -C -x 5 15 5 -y -3 3

# This example numerically solves an initial value problem arising in
# John Selker's soliton thesis:
# 
# x'' = (2 / t) * x' + B * x
# B = -1
# x(5) = 0
# x'(5) = 1

x' = vx
vx' = 2 / t * vx + B * x
B = -1

x = 0
vx = 1

print t, x
step 5, 15