Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions docs/dymos_book/contributing/contributing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,7 @@
"Adding a new example is a great way to contribute to Dymos.\n",
"It's a great introduction to the Dymos development process, and examples provide a great way for users to learn to apply Dymos in new applications.\n",
"Submit new examples via [the Dymos issues on Github](https://github.com/OpenMDAO/dymos/issues).\n",
"A new example should do the following:\n",
"\n",
"- Include a new directory under the `dymos/examples` directory.\n",
"- A unittest should be included in a `doc` subfolder within the example directory.\n",
"- The unittest method should be self-contained (it should include all imports necessary to run the example).\n",
"- If you want to include output and/or plots from the example in the documentation (highly recommended), decorate the test with the `@dymos.utils.doc_utils.save_for_docs` decorator. This will save the text and plot outputs from the test for inclusion in the Dymos documentation.\n",
"- A new markdown file should be added under `mkdocs/docs/examples/<example name>` within the Dymos repository.\n",
"A new example should include a new documentation file with the code necessary to implement the example.\n",
"\n",
"The Dymos docs are built on [JupyterBook](https://jupyterbook.org/intro.html) which allows users to run any page of the documentation by opening it in colab as a [Jupyter Notebook](https://jupyter.org). For those wanting to contribute, they are able to contribute by writing their own Jupyter Notebooks. Below are some important ways on how to build notebooks for Dymos.\n",
"\n",
Expand Down Expand Up @@ -137,7 +131,7 @@
},
"outputs": [],
"source": [
"om.display_source(\"dymos.examples.brachistochrone.doc.brachistochrone_ode\")"
"om.display_source(\"dymos.examples.brachistochrone.brachistochrone_ode\")"
]
},
{
Expand All @@ -148,7 +142,7 @@
"source": [
"import numpy as np\n",
"import openmdao.api as om\n",
"from dymos.examples.brachistochrone.doc.brachistochrone_ode import BrachistochroneODE\n",
"from dymos.examples.brachistochrone.brachistochrone_ode import BrachistochroneODE\n",
"\n",
"num_nodes = 5\n",
"\n",
Expand All @@ -165,8 +159,8 @@
"\n",
"p.setup(force_alloc_complex=True)\n",
"\n",
"p.set_val('vars.v', 10*np.random.random(num_nodes))\n",
"p.set_val('vars.theta', 10*np.random.uniform(1, 179, num_nodes))\n",
"p.set_val('vars.v', 10 * np.random.random(num_nodes))\n",
"p.set_val('vars.theta', 10 * np.random.uniform(1, 179, num_nodes))\n",
"\n",
"p.run_model()\n",
"cpd = p.check_partials(method='cs', compact_print=True)"
Expand Down Expand Up @@ -318,7 +312,7 @@
}
},
"kernelspec": {
"display_name": "Python 3",
"display_name": "dev-local",
"language": "python",
"name": "python3"
},
Expand All @@ -332,7 +326,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
"version": "3.13.13"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
},
"outputs": [],
"source": [
"om.display_source(\"dymos.examples.brachistochrone.doc.brachistochrone_ode\")"
"om.display_source(\"dymos.examples.brachistochrone.brachistochrone_ode\")"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,23 @@
},
"outputs": [],
"source": [
"om.display_source(\"dymos.examples.brachistochrone.doc.brachistochrone_ode\")"
"om.display_source(\"dymos.examples.brachistochrone.brachistochrone_ode\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"active-ipynb",
"remove-input",
"remove-output"
]
},
"outputs": [],
"source": [
"%matplotlib inline"
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"active-ipynb",
"remove-input",
"remove-output"
]
},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -272,7 +272,7 @@
}
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "dev-local",
"language": "python",
"name": "python3"
},
Expand All @@ -286,7 +286,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.13.13"
},
"orphan": true
},
Expand Down
8 changes: 4 additions & 4 deletions docs/dymos_book/examples/min_time_climb/min_time_climb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
},
"outputs": [],
"source": [
"om.display_source(\"dymos.examples.min_time_climb.doc.aero_partial_coloring\")"
"om.display_source(\"dymos.examples.min_time_climb.test.aero_partial_coloring\")"
]
},
{
Expand All @@ -114,7 +114,7 @@
"from dymos.models.eom import FlightPathEOM2D\n",
"from dymos.examples.min_time_climb.prop import PropGroup\n",
"from dymos.models.atmosphere import USatm1976Comp\n",
"from dymos.examples.min_time_climb.doc.aero_partial_coloring import AeroGroup\n",
"from dymos.examples.min_time_climb.test.aero_partial_coloring import AeroGroup\n",
"\n",
"\n",
"class MinTimeClimbODE(om.Group):\n",
Expand Down Expand Up @@ -348,7 +348,7 @@
}
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "dev-local",
"language": "python",
"name": "python3"
},
Expand All @@ -362,7 +362,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.13.13"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions docs/dymos_book/faq/tandem_phases.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
},
"outputs": [],
"source": [
"om.display_source('dymos.examples.brachistochrone.doc.test_doc_brachistochrone_tandem_phases.BrachistochroneArclengthODE')"
"om.display_source('dymos.examples.brachistochrone.test.test_tandem_phases.BrachistochroneArclengthODE')"
]
},
{
Expand Down Expand Up @@ -138,7 +138,7 @@
" def compute(self, inputs, outputs):\n",
" theta = inputs['theta']\n",
" v = inputs['v']\n",
" outputs['Sdot'] = np.sqrt(1.0 + (1.0/np.tan(theta))**2) * v * np.sin(theta)\n",
" outputs['Sdot'] = np.sqrt(1.0 + (1.0 / np.tan(theta))**2) * v * np.sin(theta)\n",
"\n",
" def compute_partials(self, inputs, jacobian):\n",
" theta = inputs['theta']\n",
Expand Down Expand Up @@ -303,7 +303,7 @@
"source": [
"from openmdao.utils.assert_utils import assert_near_equal\n",
"\n",
"expected = np.sqrt((10-0)**2 + (10 - 5)**2)\n",
"expected = np.sqrt((10 - 0) ** 2 + (10 - 5)**2)\n",
"assert_near_equal(p.get_val('phase1.timeseries.S')[-1], expected, tolerance=1.0E-3)"
]
}
Expand All @@ -319,7 +319,7 @@
}
},
"kernelspec": {
"display_name": "py312",
"display_name": "dev-local",
"language": "python",
"name": "python3"
},
Expand All @@ -333,7 +333,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.8"
"version": "3.13.13"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions docs/dymos_book/faq/use_partial_coloring.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
},
"outputs": [],
"source": [
"om.display_source(\"dymos.examples.min_time_climb.doc.dynamic_pressure_comp_partial_coloring.DynamicPressureCompFD\")"
"om.display_source(\"dymos.examples.min_time_climb.test.dynamic_pressure_comp_partial_coloring.DynamicPressureCompFD\")"
]
},
{
Expand Down Expand Up @@ -211,7 +211,7 @@
},
"outputs": [],
"source": [
"om.display_source(\"dymos.examples.min_time_climb.doc.min_time_climb_ode_partial_coloring.MinTimeClimbODE\")"
"om.display_source(\"dymos.examples.min_time_climb.test.min_time_climb_ode_partial_coloring.MinTimeClimbODE\")"
]
},
{
Expand Down Expand Up @@ -242,7 +242,7 @@
"import openmdao.api as om\n",
"\n",
"import dymos as dm\n",
"from dymos.examples.min_time_climb.doc.min_time_climb_ode_partial_coloring import MinTimeClimbODE\n",
"from dymos.examples.min_time_climb.test.min_time_climb_ode_partial_coloring import MinTimeClimbODE\n",
"\n",
"\n",
"for fd in (False, True):\n",
Expand Down Expand Up @@ -441,7 +441,7 @@
}
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "dev-local",
"language": "python",
"name": "python3"
},
Expand All @@ -455,7 +455,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.13.13"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from matplotlib.animation import FuncAnimation
# plt.switch_backend('Agg') # disable plotting to the screen

from dymos.examples.oscillator.doc.oscillator_ode import OscillatorODE
from dymos.examples.oscillator.oscillator_ode import OscillatorODE

NUM_SEG = 1
ORDER = 5
Expand Down
Loading
Loading