File: BesselK.dem

package info (click to toggle)
gnuplot 6.0.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,940 kB
  • sloc: ansic: 95,319; cpp: 7,590; makefile: 2,470; javascript: 2,328; sh: 1,531; lisp: 664; perl: 304; pascal: 191; tcl: 88; python: 46
file content (85 lines) | stat: -rw-r--r-- 1,718 bytes parent folder | download | duplicates (3)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#
#
#
# Check support for BesselK
if (!strstrt(GPVAL_COMPILE_OPTIONS, "+AMOS")) {
    print "This copy of gnuplot does not support BesselK"
    exit  # return to caller
}

save_encoding = GPVAL_ENCODING
set encoding utf8

set xrange [0:5]
set yrange [0:10]
set sample 201

set title "Modified Bessel functions of the second kind"
plot for [K=0:5] BesselK(K,x) lw 3 title sprintf("Bessel K_{%d}(x)",K)

pause -1 "Hit return to continue"

set xrange [-5:5]
set yrange [-5:5]
set zrange [-10:5]
set xyplane 0
set view 42, 33
set xlabel "x"
set ylabel "iy"
set hidden3d
unset colorbox
set sample 201
set isosample 201

splot real(BesselK(0, x+y*I)) with lines lw .2

pause -1 "Hit return to continue"

set pm3d lighting spec2 0.6

splot imag(BesselK(0, (x+y*I))) lw .2 with pm3d fc "gray"

pause -1 "Hit return to continue"

set xrange [-pi/2:pi/2]
set yrange [-pi/2:pi/2]
set zrange [-2:8]
set tics 1
set colorbox
set cbrange [-pi:pi]
set cbtics ("-π" -pi, "0" 0, "π" pi)
set palette cubehelix
set border -1
set xyplane 0
set sample 300
set isosample 300

set title "{/Times=16 complex Bessel function} {/Times:Italic=16 |K_{1/2} (x + iy)|}"
unset key

splot '++' using 1:2:( abs(BesselK( 0.5, x+y*I )) ):( arg(BesselK( 0.5, x+y*I )) ) with pm3d

pause -1 "Hit return to continue"
reset

set border -1
set grid x y z vertical
set view 41, 19
set samples 50, 50
set isosamples 50, 50
set hidden3d

set xyplane 0
set ztics  10
set xrange [ -2.0 : 2.0 ]
set yrange [ -2.0 : 2.0 ]
set zrange [ -25. : 15. ]
set pm3d border lt black
set pm3d lighting primary 0.4 specular 0.3 spec2 0.1
unset colorbox

splot imag( BesselK( nu=4, x+y*I) ) with pm3d fc ls 3

pause -1 "Hit return to continue"
reset
set encoding save_encoding