Commit cf236ee3 authored by Max Capelle's avatar Max Capelle

add kinetic energy

parent dd7fde20
......@@ -76,7 +76,7 @@ def calc(bodies, settings):
pass
else:
pass
positions, velocities, times = dynamics(bodies, settings.dimensions, settings.timestep, settings.time, settings.barneshut, settings.theta)
positions, velocities, times, E_kin = dynamics(bodies, settings.dimensions, settings.timestep, settings.time, settings.barneshut, settings.theta)
for i, body in enumerate(bodies):
if isinstance(body, Body):
body.add_trajectory((positions.transpose(1,0,2)[i]).tolist())
......
......@@ -229,5 +229,5 @@ def dynamics(bodies, D, h, t_max, barnes_hut, theta):
# return
return all_pos, velo, times
return all_pos, velo, times, E_kin
\ No newline at end of file
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