From d7357dacc9a496e9e2cada6c98dc8ad9d3c6cee1 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Sun, 4 Dec 2022 11:37:39 -0500 Subject: [PATCH] Updates to helio_gr_test notebook --- .../helio_gr_test/swiftest_relativity.ipynb | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/examples/helio_gr_test/swiftest_relativity.ipynb b/examples/helio_gr_test/swiftest_relativity.ipynb index 4b6d13106..e7ae73b23 100644 --- a/examples/helio_gr_test/swiftest_relativity.ipynb +++ b/examples/helio_gr_test/swiftest_relativity.ipynb @@ -19,7 +19,7 @@ "metadata": {}, "outputs": [], "source": [ - "sim_gr = swiftest.Simulation(param_file=\"grsim/param.gr.in\", output_file_name=\"bin.gr.nc\")\n", + "sim_gr = swiftest.Simulation(simdir=\"gr\")\n", "sim_gr.add_solar_system_body([\"Sun\",\"Mercury\",\"Venus\",\"Earth\",\"Mars\",\"Jupiter\",\"Saturn\",\"Uranus\",\"Neptune\"])" ] }, @@ -29,7 +29,7 @@ "metadata": {}, "outputs": [], "source": [ - "sim_nogr = swiftest.Simulation(param_file=\"nogrsim/param.nogr.in\", output_file_name=\"bin.nogr.nc\")\n", + "sim_nogr = swiftest.Simulation(simdir=\"nogr\")\n", "sim_nogr.add_solar_system_body([\"Sun\",\"Mercury\",\"Venus\",\"Earth\",\"Mars\",\"Jupiter\",\"Saturn\",\"Uranus\",\"Neptune\"])" ] }, @@ -39,8 +39,7 @@ "metadata": {}, "outputs": [], "source": [ - "tstep_out = 10.0\n", - "sim_gr.run(tstop=1000.0, dt=0.005, tstep_out=tstep_out, integrator=\"helio\",general_relativity=True)" + "run_args = {\"tstop\":1000.0, \"dt\":0.005, \"tstep_out\":10.0, \"dump_cadence\": 0,\"integrator\":\"helio\"}" ] }, { @@ -49,7 +48,16 @@ "metadata": {}, "outputs": [], "source": [ - "sim_nogr.run(tstop=1000.0, dt=0.005, tstep_out=tstep_out, integrator=\"helio\",general_relativity=False)" + "sim_gr.run(**run_args,general_relativity=True)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "sim_nogr.run(**run_args,general_relativity=False)" ] }, { @@ -108,8 +116,8 @@ "metadata": {}, "outputs": [], "source": [ - "dvarpi_gr = np.diff(varpisim_gr) * 3600 * 100 / tstep_out\n", - "dvarpi_nogr = np.diff(varpisim_nogr) * 3600 * 100 / tstep_out\n", + "dvarpi_gr = np.diff(varpisim_gr) * 3600 * 100 / run_args['tstep_out']\n", + "dvarpi_nogr = np.diff(varpisim_nogr) * 3600 * 100 / run_args['tstep_out']\n", "dvarpi_obs = np.diff(varpi_obs) / np.diff(t) * 3600 * 100" ] }, @@ -146,9 +154,9 @@ ], "metadata": { "kernelspec": { - "display_name": "swiftest", + "display_name": "Python (My debug_env Kernel)", "language": "python", - "name": "swiftest" + "name": "debug_env" }, "language_info": { "codemirror_mode": {