Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Linked functions
Browse files Browse the repository at this point in the history
  • Loading branch information
anand43 committed Mar 1, 2024
1 parent 7fa323d commit 5743a50
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/user-guide/detailed-simulation-setup/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The biggest body in the simulation is taken as the central body.
Solar System Bodies
=========================

We can add solar system bodies to the simulation using the ``add_solar_system_body`` method.
We can add solar system bodies to the simulation using the :func:`add_solar_system_body <swiftest.Simulation.add_solar_system_body>` method.
This method uses JPL Horizons to extract the parameters. ::
# Add the modern planets and the Sun using the JPL Horizons Database.
Expand All @@ -51,8 +51,8 @@ We can add other small bodies too. ::
User Defined Bodies
=========================

For completeness, let's also add some bodies with user defined parameters using ``sim.add_body()``.
We will randomize the initial conditions and therefore import the ``numpy.random`` module.::
For completeness, let's also add some bodies with user defined parameters using :func:`sim.add_body <swiftest.Simulation.add_body>`.
We will randomize the initial conditions and therefore import the `numpy.random <https://numpy.org/doc/stable/reference/random/index.html#module-numpy.random>`__ module.::

from numpy.random import default_rng
rng = default_rng(seed=123)
Expand Down Expand Up @@ -141,16 +141,16 @@ This can be done in multiple ways:
sim = swiftest.Simulation(simdir = simdir, integrator = 'symba', init_cond_format = 'EL', tstart=0.0, tstop=1.0e6, dt=0.01,
istep_out=100, dump_cadence=0, compute_conservation_values=True, mtiny=mtiny)
- ``sim.set_parameter()``: Set individual parameters in the simulation. The user can set one or multiple at a time. ::
- :func:`sim.set_parameter <swiftest.Simulation.set_parameter>`: Set individual parameters in the simulation. The user can set one or multiple at a time. ::

sim.set_parameter(tstart=0.0, tstop=1.0e6, dt=0.01, istep_out=100, dump_cadence=0, compute_conservation_values=True, mtiny=mtiny)
sim.set_parameter(rmin = 0.05)

We now set up the simulation parameters. Here we have a simulation starting from `0.0 y` and running for `1 My = 1e6 years`
with time steps of `0.01 years`. The timestep should be less than or equal to 1/10 of the orbital period of the innermost body.

The user can then write the parameters to the `param.in` file by using ``sim.write_param()``.
To see the parameters of the simulation, use ``sim.get_parameter()``.
The user can then write the parameters to the `param.in` file by using :func:`write_param <swiftest.Simulation.write_param>`.
To see the parameters of the simulation, use :func:`sim.get_parameter <swiftest.Simulation.get_parameter>`.

Running the Simulation
========================
Expand Down

0 comments on commit 5743a50

Please sign in to comment.