File: bessel.ft

package info (click to toggle)
fudgit 2.42-6
  • links: PTS
  • area: non-free
  • in suites: potato, woody
  • size: 2,468 kB
  • ctags: 2,375
  • sloc: ansic: 27,729; makefile: 793; yacc: 724; lex: 102; asm: 29; fortran: 15
file content (35 lines) | stat: -rw-r--r-- 742 bytes parent folder | download
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
26
27
28
29
30
31
32
33
34
35
# This file plots first bessel functions using GNUPLOT
free @all
pmode
	set data style line
	set nokey
fmode
set data 500
cmode
	# 500 points from 0 to 20
	x=0; X=x++; X*=(20/data)
	J1 = besjn(1, X)
	J2 = besjn(2, X)
	J3 = besjn(3, X)
	J4 = besjn(4, X)
	J5 = besjn(5, X)
	# Avoid divergence at x=0
	X2=X+3
	Y1 = besyn(1, X2)
	Y2 = besyn(2, X2)
	Y3 = besyn(3, X2)
	Y4 = besyn(4, X2)
	Y5 = besyn(5, X2)
fmode
# all file $Tmp* will be erased on exiting fudgit.
save vec X J1 J2 J3 J4 J5 $Tmp.1
save vec X2 Y1 Y2 Y3 Y4 Y5 $Tmp.2
pmode
	plot '$Tmp.1' us 1:2, '$Tmp.1'  us 1:3, '$Tmp.1' us 1:4,\
	'$Tmp.1' us 1:5, '$Tmp.1' us 1:6
	pause 3
	plot '$Tmp.2' us 1:2, '$Tmp.2'  us 1:3, '$Tmp.2' us 1:4,\
	'$Tmp.2' us 1:5, '$Tmp.2' us 1:6
	pause 3
fmode