{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "4b1cde21", "metadata": { "execution": { "iopub.execute_input": "2025-12-11T03:38:06.427057Z", "iopub.status.busy": "2025-12-11T03:38:06.426877Z", "iopub.status.idle": "2025-12-11T03:38:06.821759Z", "shell.execute_reply": "2025-12-11T03:38:06.821011Z" }, "nbsphinx": "hidden" }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 2, "id": "8c648b64", "metadata": { "execution": { "iopub.execute_input": "2025-12-11T03:38:06.823922Z", "iopub.status.busy": "2025-12-11T03:38:06.823699Z", "iopub.status.idle": "2025-12-11T03:38:06.830653Z", "shell.execute_reply": "2025-12-11T03:38:06.829935Z" }, "nbsphinx": "hidden" }, "outputs": [], "source": [ "%run ../tutorials/nb_setup" ] }, { "cell_type": "markdown", "id": "648eb16a", "metadata": {}, "source": [ "# Defining the MilkyWayPotential model\n", "\n", "## Introduction\n", "\n", "`gala` provides simplified mass models for the Milky Way to use in orbit integration or dynamical calculations. Some of these mass models come from other publications or packages (e.g., the Law and Majewski 2010 model `LM10Potential`). Some of the potential models are defined and provided by Gala. This document describes how we determined the parameters of the Gala Milky Way models.\n", "\n", "We determine parameters of the Gala Milky Way models using compilations of enclosed mass measurements of the Milky Way and measurements of the mass structure of the Galactic disk. We then fit for the parameters of a multi-component model (e.g., disk, bulge, halo, etc.) using these measurements." ] }, { "cell_type": "code", "execution_count": 3, "id": "0045f910", "metadata": { "execution": { "iopub.execute_input": "2025-12-11T03:38:06.832572Z", "iopub.status.busy": "2025-12-11T03:38:06.832403Z", "iopub.status.idle": "2025-12-11T03:38:07.724374Z", "shell.execute_reply": "2025-12-11T03:38:07.723510Z" } }, "outputs": [], "source": [ "import astropy.units as u\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "from astropy.constants import G\n", "from astropy.io import ascii\n", "from scipy.optimize import leastsq\n", "\n", "import gala.potential as gp\n", "from gala.units import galactic" ] }, { "cell_type": "markdown", "id": "101d32c0", "metadata": {}, "source": [ "## `MilkyWayPotential` version 1 (circa 2017)\n", "\n", "This model was previously just known as `MilkyWayPotential` in Gala, now known as \"version 1,\" and represents an older model based on measurements that are now out of date. We still describe the process of fitting for this model, for completeness.\n", "\n", "The source data for this model was compiled from published values and is included with Gala:" ] }, { "cell_type": "code", "execution_count": 4, "id": "c70283af", "metadata": { "execution": { "iopub.execute_input": "2025-12-11T03:38:07.726223Z", "iopub.status.busy": "2025-12-11T03:38:07.725942Z", "iopub.status.idle": "2025-12-11T03:38:07.737437Z", "shell.execute_reply": "2025-12-11T03:38:07.736758Z" } }, "outputs": [ { "data": { "text/html": [ "
| r | Menc | Menc_err_neg | Menc_err_pos | ref |
|---|---|---|---|---|
| float64 | float64 | float64 | float64 | str27 |
| 0.01 | 30000000.0 | 10000000.0 | 10000000.0 | Feldmeier et al. (2014) |
| 0.12 | 800000000.0 | 200000000.0 | 200000000.0 | Launhardt et al. (2002) |
| 8.1 | 89502860861.52429 | 4994562473.797714 | 4858963492.608627 | Bovy et al. (2012) |
| 8.3 | 110417867208.19055 | 4475949382.696884 | 4387023236.020782 | McMillan (2011) |
| 8.4 | 102421035406.90356 | 16733918715.629944 | 15468328224.531876 | Koposov et al. (2010) |
| 19.0 | 208023299175.30438 | 44317988008.38101 | 34833267089.920685 | Kuepper et al. (2015) |
| 50.0 | 539884832748.48975 | 19995734543.31433 | 268490735257.4718 | Wilkinson & Evans (1999) |
| 50.0 | 529886965173.18726 | 9997867269.659302 | 38536752776.21277 | Sakamoto et al. (2003) |
| 50.0 | 399914690706.92847 | 109976539940.53711 | 72696676468.2511 | Smith et al. (2007) |
| 50.0 | 419910425325.7268 | 39991469076.968506 | 38172735113.64386 | Deason et al. (2012) |
| 60.0 | 399914690957.5188 | 69985070910.63354 | 64344945146.92987 | Xue et al. (2008) |
| 80.0 | 689852841359.0248 | 299936018002.3314 | 110361048549.1029 | Gnedin et al. (2010) |
| 100.0 | 1399701417307.7747 | 899808054059.3811 | 831336271726.1903 | Watkins et al. (2010) |
| 120.0 | 539884832260.29584 | 199957345314.72906 | 123854764645.32489 | Battaglia et al. (2005) |
| 150.0 | 750000000000.0 | 250000000000.0 | 250000000000.0 | Deason et al. (2012) |
| 200.0 | 679854974257.2006 | 409912558030.05396 | 313652012195.06256 | Bhattacherjee et al. (2014) |