2022-11-19 22:41:30 +00:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 1,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"%matplotlib widget\n",
|
|
|
|
"import matplotlib.pyplot as plt\n",
|
|
|
|
"import numpy as np\n",
|
|
|
|
"\n",
|
|
|
|
"a = 3 # Semi major axis (AU)\n",
|
|
|
|
"r_1 = 1 # Planet 1 initial orbit radius (AU)\n",
|
|
|
|
"M_1 = 3 # Star 1 mass (Solar masses)\n",
|
|
|
|
"M_2 = 2 # Star 2 mass (Solar masses)\n",
|
|
|
|
"\n",
|
|
|
|
"r_2 = a - r_1\n",
|
|
|
|
"T = np.sqrt(a ** 3 / (M_1 + M_2))\n",
|
|
|
|
"v_1 = 2 * np.pi * r_1 / T\n",
|
|
|
|
"v_2 = 2 * np.pi * (a - r_1) / T"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 2,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"t = np.linspace(0, T, 10000)\n",
|
|
|
|
"theta = 2 * np.pi * t / T\n",
|
|
|
|
"x_1, y_1 = -r_1 * np.sin(theta), -r_1 * np.cos(theta)\n",
|
|
|
|
"x_2, y_2 = -r_2 * np.sin(theta), -r_2 * np.cos(theta)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 3,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"application/vnd.jupyter.widget-view+json": {
|
2023-02-08 20:35:41 +00:00
|
|
|
"model_id": "407c30b67cad4a12a48103840009b82d",
|
2022-11-19 22:41:30 +00:00
|
|
|
"version_major": 2,
|
|
|
|
"version_minor": 0
|
|
|
|
},
|
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5YHEeg0G1lwyKhkZ/Gge14LRK4DO2Y09LpvDgWoJKMiE3VS1/rC2MbA71uqklobtK5F1oGBshRM14RAIohKimslJI3QxHfoNja+HEZijJOX+7yOYQ3xniO6paopi2lJn82bxgAUN7OqCThKgdgZHQtD807Y/NamXJggUM7X8N5jMpKjFM26oS/6yDcHqfWpI/U8/1DYZ6XaDh1dCwN8R3UpeqhRBuSRJAIbyJrUyd5I+shMO/qRo+a+G525gD1Ym+XndI6KEuB16onZ4MpOoZLMHQIFEtFSou+x/fACc2QOoWNazNoeVqATWsTkIPaHQNNLxGJYTu3llHCC8iCaAQnkzT1CXcA4vh4FI4ukaNTfdHAZHltTpXqxN6dGswyaHBqwVGQPPBagGw21SP7mNrVW3xkVVqCJtDy9QC6odDw6ug6QC1hDc+ZygeIYRrkaO8EJ6mtAAOr1RJ3/4k+PM4cn5hKtlr1FvV3ES3khO1uDSjCWLbqqX7xN/bih5ZpWqTj6yGoizY/6taQA1DU5EMNrxGhp8RwsVIAiiEJzh7BPb+rE6+R9eoWSkqmHyhfqI6ETfuCzFtwShTjIkaMBohprVaetynEsKTu1Qt84HFcHSt+kxunKUWoxnq94SW10OLoVCngd4lEMLrSQIohDvSNMjcCXt+Uolf5o5z/x5WH5oOhGYDpfZFOJ/RCLHt1HLVQ2rWkyO/nVsLfeQ3tSx8Qm3X8gaVEMa0lRpoIXQgCaAQ7sJuU5029vwEe38699KuwQQNekGL66DZIIhoKidVoR9
|
|
|
|
"text/html": [
|
|
|
|
"\n",
|
|
|
|
" <div style=\"display: inline-block;\">\n",
|
|
|
|
" <div class=\"jupyter-widgets widget-label\" style=\"text-align: center;\">\n",
|
|
|
|
" Figure\n",
|
|
|
|
" </div>\n",
|
|
|
|
" <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9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HQtD807Y/NamXJggUM7X8N5jMpKjFM26oS/6yDcHqfWpI/U8/1DYZ6XaDh1dCwN8R3UpeqhRBuSRJAIbyJrUyd5I+shMO/qRo+a+G525gD1Ym+XndI6KEuB16onZ4MpOoZLMHQIFEtFSou+x/fACc2QOoWNazNoeVqATWsTkIPaHQNNLxGJYTu3llHCC8iCaAQnkzT1CXcA4vh4FI4ukaNTfdHAZHltTpXqxN6dGswyaHBqwVGQPPBagGw21SP7mNrVW3xkVVqCJtDy9QC6odDw6ug6QC1hDc+ZygeIYRrkaO8EJ6mtAAOr1RJ3/4k+PM4cn5hKtlr1FvV3ES3khO1uDSjCWLbqqX7xN/bih5ZpWqTj6yGoizY/6taQA1DU5EMNrxGhp8RwsVIAiiEJzh7BPb+rE6+R9eoWSkqmHyhfqI6ETfuCzFtwShTjIkaMBohprVaetynEsKTu1Qt84HFcHSt+kxunKUWoxnq94SW10OLoVCngd4lEMLrSQIohDvSNMjcCXt+Uolf5o5z/x5WH5oOhGYDpfZFOJ/RCLHt1HLVQ2rWkyO/nVsLfeQ3tSx8Qm3X8gaVEMa0lRpoIXQgCaAQ7sJuU50
|
|
|
|
" </div>\n",
|
|
|
|
" "
|
|
|
|
],
|
|
|
|
"text/plain": [
|
|
|
|
"Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"plt.ion()\n",
|
|
|
|
"fig = plt.figure()\n",
|
|
|
|
"\n",
|
|
|
|
"ax = fig.add_subplot()\n",
|
|
|
|
"ax.plot(x_1, y_1)\n",
|
|
|
|
"ax.plot(x_2, y_2)\n",
|
|
|
|
"ax.set_xlabel(\"x / AU\")\n",
|
|
|
|
"ax.set_ylabel(\"y / AU\")\n",
|
|
|
|
"\n",
|
|
|
|
"plt.grid()\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"metadata": {
|
|
|
|
"kernelspec": {
|
|
|
|
"display_name": "Python 3.9.2 64-bit",
|
|
|
|
"language": "python",
|
|
|
|
"name": "python3"
|
|
|
|
},
|
|
|
|
"language_info": {
|
|
|
|
"codemirror_mode": {
|
|
|
|
"name": "ipython",
|
|
|
|
"version": 3
|
|
|
|
},
|
|
|
|
"file_extension": ".py",
|
|
|
|
"mimetype": "text/x-python",
|
|
|
|
"name": "python",
|
|
|
|
"nbconvert_exporter": "python",
|
|
|
|
"pygments_lexer": "ipython3",
|
2023-02-08 20:35:41 +00:00
|
|
|
"version": "3.9.2"
|
2022-11-19 22:41:30 +00:00
|
|
|
},
|
|
|
|
"orig_nbformat": 4,
|
|
|
|
"vscode": {
|
|
|
|
"interpreter": {
|
|
|
|
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 2
|
|
|
|
}
|