Commit 51f3ed44 authored by Olaf's avatar Olaf

Add units to axis labels

parent 51eb665a
......@@ -402,8 +402,9 @@ def dynamics(bodies, D, h, t_max, barnes_hut, theta, approximation, j, startsave
force1, U = force_barneshut(positions, mass, theta)
velo = velocity(velo, force0, force1, h)
force0 = force1
if i%round((T+1)/10) == 0:
print(int(100*round(i/(T+1), 1)), "%")
if (T+1)>=10:
if i%round((T+1)/10) == 0:
print(int(100*round(i/(T+1), 1)), "%")
if i%j == 0 and i>=startsave:
index += 1
all_pos[index] = positions
......@@ -416,8 +417,9 @@ def dynamics(bodies, D, h, t_max, barnes_hut, theta, approximation, j, startsave
force1, U = force_approx(mass, positions, D, n)
velo = velocity(velo, force0, force1, h)
force0 = force1
if i%round((T+1)/10) == 0:
print(int(100*round(i/(T+1), 1)), "%")
if (T+1)>=10:
if i%round((T+1)/10) == 0:
print(int(100*round(i/(T+1), 1)), "%")
if i%j == 0 and i>=startsave:
index += 1
all_pos[index] = positions
......@@ -430,8 +432,9 @@ def dynamics(bodies, D, h, t_max, barnes_hut, theta, approximation, j, startsave
force1, U = force_calc(mass, positions, D)
velo = velocity(velo, force0, force1, h)
force0 = force1
if i%round((T+1)/10) == 0:
print(int(100*round(i/(T+1), 1)), "%")
if (T+1)>=10:
if i%round((T+1)/10) == 0:
print(int(100*round(i/(T+1), 1)), "%")
if i%j == 0 and i>=startsave:
index += 1
all_pos[index] = positions
......
......@@ -85,8 +85,8 @@ def trajectory(bodies, settings, inds='all'):
plt.plot(x, y, color=col, lw=1)
plt.scatter(x[0], y[0], color=col, s=size(bodies[i].masses[num]))
plt.xlabel("$x$", fontsize = settings.plot.fontsize_axislabel)
plt.ylabel("$y$", fontsize = settings.plot.fontsize_axislabel)
plt.xlabel("x $[Au]$", fontsize = settings.plot.fontsize_axislabel)
plt.ylabel("y $[Au]$", fontsize = settings.plot.fontsize_axislabel)
plt.axis("equal")
plt.title("Trajectories during $T = {} [y_J]$".format(np.max(bodies[inds[0]].times)),
fontsize = settings.plot.fontsize_title)
......@@ -141,7 +141,7 @@ def plot_energy(bodies, settings):
plt.plot(t, E_pot, color = 'blue', label = 'Potential energy')
plt.plot(t, E_kin + E_pot, color = 'green', label = 'Total energy')
plt.xlabel('time $[y_J]$', fontsize = settings.plot.fontsize_title)
plt.ylabel('Energy', fontsize = settings.plot.fontsize_title)
plt.ylabel('Energy $[\\frac{Au^2}{Y^2}]$', fontsize = settings.plot.fontsize_title)
plt.title('Energy')
plt.legend(loc='upper right', fontsize = settings.plot.fontsize_legend)
plt.show()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment