#!/bin/tcsh -f 


ifort rk3.f rk3_B.f rksuite/rksuite.f -o rk3
./rk3 <<EOF
1 0. 0. -3               !k1,k2,k3,k4
10000 0 40 1 0 0 0 1 0.2 !STEPS,T0,TF,X10,X20,X30,V10,V20,V30
EOF

gnuplot -persist  -geometry 440x270 <<EOF
set term x11 1
plot "rk3.dat" using 1:2 with lines title "x1(t)"
set term x11 2
plot "rk3.dat" using 1:3 with lines title "x2(t)"
set term x11 3
plot "rk3.dat" using 1:4 with lines title "x3(t)"
set term x11 4
plot "rk3.dat" using 1:5 with lines title "v1(t)"
set term x11 5
plot "rk3.dat" using 1:6 with lines title "v2(t)"
set term x11 6
plot "rk3.dat" using 1:7 with lines title "v3(t)"
set term x11 7
plot "rk3.dat" using 1:8 with lines title "E(t)"
set term x11 8
set title "trajectory"
splot "rk3.dat" u 2:3:4 w l notit
EOF
