#########################################################################
#       This script plots the linear approximation of the               #
#       particle trajectory generated by linear_approx.exe              #
#                                                                       #
#       Written by OddE92                                               #
#########################################################################

import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
from scipy.stats import gaussian_kde
from numpy.fft import fft
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.colors import Normalize

trajectory = np.loadtxt('cpp_runge-kutta/RK4_approx_stepsizectrl.dat')                               # Reads the data from the RK4 approx
trajectory2 = np.loadtxt('data/B_average.dat')
#mfield = np.loadtxt('data/test_mf.dat')
test_rng = np.loadtxt('data/test_rng.dat')

fig1 = plt.figure(1)
ax = fig1.gca(projection='3d')
ax.plot3D(trajectory[:,0], trajectory[:,1], trajectory[:,2])

ax.set_title('Trajectory RK4 step size control')
ax.set_xlabel('x [pc]')
ax.set_ylabel('y [pc]')
ax.set_zlabel('z [pc]')

#fig2 = plt.figure(2)

#plt.plot(trajectory2)




#fig3 = plt.figure(3)
#plt.plot(mfield)
#print(np.mean(mfield))


fig4 = plt.figure(4)
plt.scatter(test_rng[:,1], test_rng[:,0])

#fig2 = plt.figure(2)
#ax = fig2.gca(projection='3d')

#ax.plot3D(trajectory2[:,0], trajectory2[:,1], trajectory2[:,2])



plt.show()

3154c2894b580f9e178336b6f39d52a321ecea33
<mask token>

<mask token>
ax.plot3D(trajectory[:, 0], trajectory[:, 1], trajectory[:, 2])
ax.set_title('Trajectory RK4 step size control')
ax.set_xlabel('x [pc]')
ax.set_ylabel('y [pc]')
ax.set_zlabel('z [pc]')
<mask token>
plt.scatter(test_rng[:, 1], test_rng[:, 0])
plt.show()

<mask token>
trajectory = np.loadtxt('cpp_runge-kutta/RK4_approx_stepsizectrl.dat')
trajectory2 = np.loadtxt('data/B_average.dat')
test_rng = np.loadtxt('data/test_rng.dat')
fig1 = plt.figure(1)
ax = fig1.gca(projection='3d')
ax.plot3D(trajectory[:, 0], trajectory[:, 1], trajectory[:, 2])
ax.set_title('Trajectory RK4 step size control')
ax.set_xlabel('x [pc]')
ax.set_ylabel('y [pc]')
ax.set_zlabel('z [pc]')
fig4 = plt.figure(4)
plt.scatter(test_rng[:, 1], test_rng[:, 0])
plt.show()

import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
from scipy.stats import gaussian_kde
from numpy.fft import fft
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.colors import Normalize
trajectory = np.loadtxt('cpp_runge-kutta/RK4_approx_stepsizectrl.dat')
trajectory2 = np.loadtxt('data/B_average.dat')
test_rng = np.loadtxt('data/test_rng.dat')
fig1 = plt.figure(1)
ax = fig1.gca(projection='3d')
ax.plot3D(trajectory[:, 0], trajectory[:, 1], trajectory[:, 2])
ax.set_title('Trajectory RK4 step size control')
ax.set_xlabel('x [pc]')
ax.set_ylabel('y [pc]')
ax.set_zlabel('z [pc]')
fig4 = plt.figure(4)
plt.scatter(test_rng[:, 1], test_rng[:, 0])
plt.show()

#########################################################################
#       This script plots the linear approximation of the               #
#       particle trajectory generated by linear_approx.exe              #
#                                                                       #
#       Written by OddE92                                               #
#########################################################################

import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
from scipy.stats import gaussian_kde
from numpy.fft import fft
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.colors import Normalize

trajectory = np.loadtxt('cpp_runge-kutta/RK4_approx_stepsizectrl.dat')                               # Reads the data from the RK4 approx
trajectory2 = np.loadtxt('data/B_average.dat')
#mfield = np.loadtxt('data/test_mf.dat')
test_rng = np.loadtxt('data/test_rng.dat')

fig1 = plt.figure(1)
ax = fig1.gca(projection='3d')
ax.plot3D(trajectory[:,0], trajectory[:,1], trajectory[:,2])

ax.set_title('Trajectory RK4 step size control')
ax.set_xlabel('x [pc]')
ax.set_ylabel('y [pc]')
ax.set_zlabel('z [pc]')

#fig2 = plt.figure(2)

#plt.plot(trajectory2)




#fig3 = plt.figure(3)
#plt.plot(mfield)
#print(np.mean(mfield))


fig4 = plt.figure(4)
plt.scatter(test_rng[:,1], test_rng[:,0])

#fig2 = plt.figure(2)
#ax = fig2.gca(projection='3d')

#ax.plot3D(trajectory2[:,0], trajectory2[:,1], trajectory2[:,2])



plt.show()
