:orphan: .. Copyright 2021 IRT Saint Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Disciplines =========== .. raw:: html
.. thumbnail-parent-div-open .. raw:: html
.. only:: html .. image:: /examples/disciplines/images/thumb/sphx_glr_data_converter_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_data_converter.py` .. raw:: html
Use a data converter
.. thumbnail-parent-div-close .. raw:: html
.. toctree:: :hidden: /examples/disciplines/data_converter .. Copyright 2021 IRT Saint Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Fundamentals of disciplines ~~~~~~~~~~~~~~~~~~~~~~~~~~~ A discipline computes output data from input data. .. raw:: html
.. thumbnail-parent-div-open .. raw:: html
.. only:: html .. image:: /examples/disciplines/basics/images/thumb/sphx_glr_plot_check_jacobian_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_basics_plot_check_jacobian.py` .. raw:: html
Check the Jacobian of a discipline
.. raw:: html
.. only:: html .. image:: /examples/disciplines/basics/images/thumb/sphx_glr_plot_compute_jacobian_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_basics_plot_compute_jacobian.py` .. raw:: html
Compute the Jacobian of a discipline analytically
.. raw:: html
.. only:: html .. image:: /examples/disciplines/basics/images/thumb/sphx_glr_plot_compute_hybrid_jacobian_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_basics_plot_compute_hybrid_jacobian.py` .. raw:: html
Compute the Jacobian of a discipline with analytical and approximated elements
.. raw:: html
.. only:: html .. image:: /examples/disciplines/basics/images/thumb/sphx_glr_plot_compute_jacobian_fd_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_basics_plot_compute_jacobian_fd.py` .. raw:: html
Compute the Jacobian of a discipline with finite differences
.. raw:: html
.. only:: html .. image:: /examples/disciplines/basics/images/thumb/sphx_glr_plot_interface_exec_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_basics_plot_interface_exec.py` .. raw:: html
Create a discipline from an external executable
.. raw:: html
.. only:: html .. image:: /examples/disciplines/basics/images/thumb/sphx_glr_plot_data_frame_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_basics_plot_data_frame.py` .. raw:: html
Create a discipline that uses pandas DataFrames
.. thumbnail-parent-div-close .. raw:: html
.. toctree:: :hidden: /examples/disciplines/basics/plot_check_jacobian /examples/disciplines/basics/plot_compute_jacobian /examples/disciplines/basics/plot_compute_hybrid_jacobian /examples/disciplines/basics/plot_compute_jacobian_fd /examples/disciplines/basics/plot_interface_exec /examples/disciplines/basics/plot_data_frame .. Copyright 2021 IRT Saint Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Grammars for inputs and outputs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A grammar defines a set of variables from names and possibly types and default values. .. raw:: html
.. thumbnail-parent-div-open .. raw:: html
.. only:: html .. image:: /examples/disciplines/grammars/images/thumb/sphx_glr_plot_json_grammar_merge_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_grammars_plot_json_grammar_merge.py` .. raw:: html
Merge or update a JSONGrammar
.. raw:: html
.. only:: html .. image:: /examples/disciplines/grammars/images/thumb/sphx_glr_plot_name_mapping_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_grammars_plot_name_mapping.py` .. raw:: html
Rename discipline variables
.. raw:: html
.. only:: html .. image:: /examples/disciplines/grammars/images/thumb/sphx_glr_plot_pydantic_grammar_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_grammars_plot_pydantic_grammar.py` .. raw:: html
Use a Pydantic grammar
.. thumbnail-parent-div-close .. raw:: html
.. toctree:: :hidden: /examples/disciplines/grammars/plot_json_grammar_merge /examples/disciplines/grammars/plot_name_mapping /examples/disciplines/grammars/plot_pydantic_grammar .. Copyright 2021 IRT Saint Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Different types of disciplines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A few examples of templates to help you build your discipline faster. .. raw:: html
.. thumbnail-parent-div-open .. raw:: html
.. only:: html .. image:: /examples/disciplines/types/images/thumb/sphx_glr_plot_auto_py_discipline_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_types_plot_auto_py_discipline.py` .. raw:: html
Create a discipline from a Python function
.. raw:: html
.. only:: html .. image:: /examples/disciplines/types/images/thumb/sphx_glr_plot_analytic_discipline_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_types_plot_analytic_discipline.py` .. raw:: html
Create a discipline from analytical expressions
.. raw:: html
.. only:: html .. image:: /examples/disciplines/types/images/thumb/sphx_glr_plot_taylor_discipline_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_types_plot_taylor_discipline.py` .. raw:: html
Create a first-order Taylor polynomial
.. raw:: html
.. only:: html .. image:: /examples/disciplines/types/images/thumb/sphx_glr_plot_retry_discipline_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_types_plot_retry_discipline.py` .. raw:: html
Create a retry discipline
.. thumbnail-parent-div-close .. raw:: html
.. toctree:: :hidden: /examples/disciplines/types/plot_auto_py_discipline /examples/disciplines/types/plot_analytic_discipline /examples/disciplines/types/plot_taylor_discipline /examples/disciplines/types/plot_retry_discipline .. Copyright 2021 IRT Saint Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Changing input and output names ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sometimes you want to rename a discipline input or output variable, e.g. ``"a"`` to ``"x"``. This is *renaming*. Sometimes you want to rename some components of a discipline input or output variable, e.g. the first component of ``"a"`` to ``"x"`` and the other components to ``"y"``. This is *remapping*. This section proposes examples for each case. .. raw:: html
.. thumbnail-parent-div-open .. raw:: html
.. only:: html .. image:: /examples/disciplines/variables/images/thumb/sphx_glr_plot_remapping_discipline_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_variables_plot_remapping_discipline.py` .. raw:: html
Remapping the input and output variables
.. raw:: html
.. only:: html .. image:: /examples/disciplines/variables/images/thumb/sphx_glr_plot_variable_renaming_thumb.png :alt: :ref:`sphx_glr_examples_disciplines_variables_plot_variable_renaming.py` .. raw:: html
Renaming variables
.. thumbnail-parent-div-close .. raw:: html
.. toctree:: :hidden: /examples/disciplines/variables/plot_remapping_discipline /examples/disciplines/variables/plot_variable_renaming .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-gallery .. container:: sphx-glr-download sphx-glr-download-python :download:`Download all examples in Python source code: disciplines_python.zip ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download all examples in Jupyter notebooks: disciplines_jupyter.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_