Skip to content

Commit

Permalink
.gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
will-roscoe committed Dec 14, 2023
1 parent 0062314 commit aac0657
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 52 deletions.
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "nbody -m",
"justMyCode": true
}
]
}
53 changes: 1 addition & 52 deletions dev/deprecated/plotly.py
Original file line number Diff line number Diff line change
@@ -1,52 +1 @@
import nbody.core as nb
import plotly.graph_objects as go
'''
bodies = nb.horizons_batch(('10','199','299','399','499','599','699','799','899'))
phys = nb.Engine(dt=1000)
phys.attach_bodies(bodies)
phys.make_relative_to(bodies[0])
phys.do_collisions = False
phys.simulate(100000)
phys.save_as('bodies')
'''
def frame_args(duration):
return {
"frame": {"duration": duration},
"mode": "immediate",
"fromcurrent": True,
"transition": {"duration": duration, "easing": "linear"},
}
phys = nb.Engine(dt=1000)
phys.load_as('bodies')

(xs,ys,zs) = list(list(bod['pos'][x][::100] for bod in phys.bodies) for x in (0,1,2))

mm = [[0,0],[0,0],[0,0]]
for bod in phys.bodies[:5]:
for i in (0,1,2):
mm[i][0] = min(mm[i][0], *bod['pos'][i])
mm[i][1] = max(mm[i][1], *bod['pos'][i])

b = phys.bodies
fig = go.Figure()
fb = b[0]
for i in range(5):
fig.add_trace(go.Scatter3d(x=[], y=[], z=[],mode="lines", line={'color':b[i].color}))
#fig.add_trace(go.Scatter3d(x=[], y=[], z=[],mode="markers", marker=dict(color=b[i].color, size=10)))


fig.update(frames = [go.Frame(data= [go.Scatter3d(x=xs[i][:k+1],y=ys[i][:k+1],z=zs[i][:k+1])
for i in range(5)],name=f'frame{k}') for k in range(1,len(xs[0]))])
#go.Scatter3d(x=[xs[i][k],],y=[ys[i][k],],z=[zs[i][k],]

fig.update_layout(scene=dict(
xaxis=dict(range=mm[0], autorange=False),yaxis=dict(range=mm[1], autorange=False),zaxis=dict(range=mm[2], autorange=False),
aspectratio=dict(x=1, y=1, z=1)),
updatemenus=[dict(type="buttons",
buttons=[dict(label="Play",
method="animate",
args=[None, {'frame':{'duration':1}, 'transition':{'duration':1}}])])]
)


fig.show()
import mpmath as mp
Binary file added main.py.lprof
Binary file not shown.
Binary file added main.py.prof
Binary file not shown.
3 changes: 3 additions & 0 deletions nbody/build/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

# Arithimetic Calculation
USE_FLOAT = False # whether to override number types to float, useful when gmpy2 is not available.
Binary file added nbody/build/gmpy-gmpy2-2.2.0a1.tar.gz
Binary file not shown.
Binary file added nbody/build/gmpy2-2.0.8-cp27-cp27m-win32.whl
Binary file not shown.
Binary file added nbody/build/gmpy2-2.0.8-cp27-cp27m-win_amd64.whl
Binary file not shown.
Binary file added nbody/build/gmpy2-2.1.5-cp311-cp311-win_amd64.whl
Binary file not shown.
Binary file modified solarsystem_bodies.npz
Binary file not shown.
Binary file added temp.dat
Binary file not shown.
22 changes: 22 additions & 0 deletions temp.html

Large diffs are not rendered by default.

Empty file added temp.json
Empty file.

0 comments on commit aac0657

Please sign in to comment.