Skip to content

Commit

Permalink
docs(kepler-problem): adjust kepler demo time interval and animation …
Browse files Browse the repository at this point in the history
…speed

#82
  • Loading branch information
emptymalei committed Sep 24, 2024
1 parent c5a8a57 commit 31d9c3d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/tutorials/kepler_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
# We define the time steps for a Kepler system. In this example, we create 401 time steps, also with some some negative timestamps for a more symmetric trajectory.

# %%
t = np.linspace(-20, 20, 401)
# t = np.linspace(-20, 20, 401)
t = np.arange(-20, 20, 0.125)

# %% [markdown]
# Orbit time series data is generated by calling the object `k2d`, as the data generation is done in the `__call__` method.
Expand All @@ -80,7 +81,6 @@ def visualize_orbit(dataframe: pd.DataFrame) -> go.Figure:
r="r",
theta="phi_degree",
hover_data=["t", "r", "phi"],
text="t",
start_angle=0,
animation_frame="t",
color_discrete_sequence=["red"],
Expand All @@ -106,6 +106,9 @@ def visualize_orbit(dataframe: pd.DataFrame) -> go.Figure:

fig.add_traces(trajectory_traces)

fig.layout.updatemenus[0].buttons[0].args[1]["frame"]["duration"] = 50
fig.layout.updatemenus[0].buttons[0].args[1]["transition"]["duration"] = 50

return fig


Expand Down Expand Up @@ -149,7 +152,7 @@ def visualize_orbit(dataframe: pd.DataFrame) -> go.Figure:
"ecc": 2,
"parameter": 1.0,
},
)(t=np.linspace(-5, 5, 101)),
)(t=np.arange(-5, 5, 0.125)),
).show()

# %% [markdown]
Expand Down

0 comments on commit 31d9c3d

Please sign in to comment.