File: soliton.ode

package info (click to toggle)
plotutils 2.4.1-11
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 11,676 kB
  • ctags: 6,967
  • sloc: ansic: 76,305; sh: 15,172; cpp: 12,403; yacc: 2,604; makefile: 888; lex: 144
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