# pendulum energy function, contour plot
#
# postscript version, not used.
#
set term post
V(q) = 1-cos(q)
T(qd) = 0.5*qd*qd
E(q,qd) = T(qd) + V(q)

set cntrpa levels incremental 0,0.21,4.0
set hidden3d

set size 1,1
set surface
set nocontour
set ticslevel 0
# first is tilt, second is xy rotn
set view 60,130
#set view
set xlabel "theta"
set ylabel "theta-dot"
set nokey
set key
r = 1.32*pi ;
r = 1.132*pi ;
r = 2.2*pi ;
load 'setrange'
set zrange [0:6]
set isosamples 30,30
set samples 100,100

# set title "T"
# (q,q')"
#splot T(y) t 'T' w l 1 1
#pause -1 'T'
# set title "V"
# (q,q')"
#splot V(x) t 'V' w l 3 3
#pause -1 'V'
#
set output "TV.ps"
# set title "T,V"
splot  T(y)  t 'T'  w l 1 1, V(x)  t 'V'  w l 3 3
pause -1 'V'
# set title "E = T + V"
# (q,q')"
splot E(x,y) t 'E' w l 5 5
pause -1 'E'
set nokey
set contour base
replot
pause -1 'E'
set nosurface
set nokey
set nohidden3d
set contour surf
replot
pause -1 'E'
set contour base
replot
pause -1 'E'

###########
# again
###########
set samples 220,220
set nokey 
set hidden3d

set size 0.8,1.24
set view 180,0
set contour base
set nosurface

#set title "E = T + V"
set title
# (q,q')"
splot E(x,y)  w l 3 3
pause -1 'E'




