# fit_toy_potential¶

gala.dynamics.fit_toy_potential(orbit, force_harmonic_oscillator=False)[source]

Fit a best fitting toy potential to the orbit provided. If the orbit is a tube (loop) orbit, use the Isochrone potential. If the orbit is a box potential, use the harmonic oscillator potential. An option is available to force using the harmonic oscillator (force_harmonic_oscillator).

See the docstrings for ~gala.dynamics.fit_isochrone() and ~gala.dynamics.fit_harmonic_oscillator() for more information.

Parameters
orbitOrbit
force_harmonic_oscillatorbool (optional)

Force using the harmonic oscillator potential as the toy potential.

Returns
potentialIsochronePotential or HarmonicOscillatorPotential

The best-fit potential object.