{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "442cd699",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:46:42.976399Z",
     "iopub.status.busy": "2026-10-02T14:46:42.976185Z",
     "iopub.status.idle": "2026-10-02T14:46:42.980410Z",
     "shell.execute_reply": "2026-10-02T14:46:42.979734Z"
    },
    "hide_input": true,
    "papermill": {
     "duration": 0.007249,
     "end_time": "2026-10-02T14:46:42.981240+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:46:42.973991+00:00",
     "status": "completed"
    },
    "tags": [
     "active-ipynb",
     "remove-input",
     "remove-output"
    ]
   },
   "outputs": [],
   "source": [
    "try:\n",
    "    from openmdao.utils.notebook_utils import notebook_mode  # noqa: F401\n",
    "except ImportError:\n",
    "    !python -m pip install openmdao[notebooks]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f180e227",
   "metadata": {
    "papermill": {
     "duration": 0.126978,
     "end_time": "2026-10-02T14:46:43.109597+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:46:42.982619+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "# How to Cite OpenMDAO\n",
    "\n",
    "There is a general OpenMDAO paper that includes a high-level overview of the framework,\n",
    "including how implicit and explicit components leverage the underlying core APIs to support multidisciplinary modeling.\n",
    "There is a walk-through example of how some of the key underlying mathematics of the framework are used and how analytic derivatives are computed.\n",
    "Lastly, there are  examples of how and when to use some of the specialized algorithms for computing derivatives efficiently for different kinds of problems.\n",
    "\n",
    "We hope the paper helps you understand the framework better, and most importantly,\n",
    "helps you to solve some really nice MDO problems! If you do make use of OpenMDAO, please cite this paper.\n",
    "\n",
    "```\n",
    "@article{openmdao_2019,\n",
    "Author={Justin S. Gray and John T. Hwang and Joaquim R. R. A. Martins and Kenneth T. Moore and Bret A. Naylor},\n",
    "Title=\"{OpenMDAO: An Open-Source Framework for Multidisciplinary Design, Analysis, and Optimization}\",\n",
    "Journal=\"{Structural and Multidisciplinary Optimization}\",\n",
    "Year={2019},\n",
    "Volume={59},\n",
    "pages={1075-1104},\n",
    "issue={4},\n",
    "Publisher={Springer},\n",
    "pdf={http://www.umich.edu/~mdolaboratory/pdf/Gray2019a.pdf},\n",
    "Doi={10.1007/s00158-019-02211-z},\n",
    "}\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5453f4e4",
   "metadata": {
    "papermill": {
     "duration": 0.026741,
     "end_time": "2026-10-02T14:46:43.137570+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:46:43.110829+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "##  With the `openmdao` command\n",
    "\n",
    "Depending on which parts of OpenMDAO you are using, there are also a few other papers that are appropriate to cite.\n",
    "OpenMDAO can tell you which citations are appropriate, accounting for what classes you're actually using in your model.\n",
    "\n",
    "If you copy the following script into a file called `paraboloid.py`,\n",
    "then you can get the citations from the command line using the [openmdao command-line script](../other_useful_docs/om_command.ipynb).\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "1d1c3d4b",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:46:43.140561Z",
     "iopub.status.busy": "2026-10-02T14:46:43.140336Z",
     "iopub.status.idle": "2026-10-02T14:46:45.785969Z",
     "shell.execute_reply": "2026-10-02T14:46:45.785204Z"
    },
    "papermill": {
     "duration": 2.648239,
     "end_time": "2026-10-02T14:46:45.786737+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:46:43.138498+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-output"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952405.742962] [runnervm8df0l:10731:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x56492af13130 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\n",
      "[1790952405.743216] [runnervm8df0l:10731:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Optimization terminated successfully    (Exit mode 0)\n",
      "            Current function value: -27.33333333333333\n",
      "            Iterations: 5\n",
      "            Function evaluations: 6\n",
      "            Gradient evaluations: 5\n",
      "Optimization Complete\n",
      "-----------------------------------\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[runnervm8df0l:10731] pml_ucx.c:313  Error: Failed to create UCP worker\n"
     ]
    }
   ],
   "source": [
    "import openmdao.api as om\n",
    "\n",
    "# build the model\n",
    "prob = om.Problem()\n",
    "\n",
    "prob.model.add_subsystem('paraboloid', om.ExecComp('f = (x-3)**2 + x*y + (y+4)**2 - 3'))\n",
    "\n",
    "# setup the optimization\n",
    "prob.driver = om.ScipyOptimizeDriver()\n",
    "prob.driver.options['optimizer'] = 'SLSQP'\n",
    "\n",
    "prob.model.add_design_var('paraboloid.x', lower=-50, upper=50)\n",
    "prob.model.add_design_var('paraboloid.y', lower=-50, upper=50)\n",
    "prob.model.add_objective('paraboloid.f')\n",
    "\n",
    "prob.setup()\n",
    "\n",
    "# Set initial values.\n",
    "prob.set_val('paraboloid.x', 3.0)\n",
    "prob.set_val('paraboloid.y', -4.0)\n",
    "\n",
    "# run the optimization\n",
    "prob.run_driver();"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "a79731a9",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:46:45.789827Z",
     "iopub.status.busy": "2026-10-02T14:46:45.789493Z",
     "iopub.status.idle": "2026-10-02T14:46:45.796369Z",
     "shell.execute_reply": "2026-10-02T14:46:45.795755Z"
    },
    "hide_input": true,
    "papermill": {
     "duration": 0.009173,
     "end_time": "2026-10-02T14:46:45.797009+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:46:45.787836+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input",
     "remove-output"
    ]
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "np.float64(4.545456612206542e-07)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Test the results of the code above.\n",
    "from openmdao.utils.assert_utils import assert_near_equal\n",
    "\n",
    "# minimum value\n",
    "assert_near_equal(prob.get_val('paraboloid.f'), -27.33333, 1e-6)\n",
    "\n",
    "# location of the minimum\n",
    "assert_near_equal(prob.get_val('paraboloid.x'), 6.6667, 1e-4)\n",
    "assert_near_equal(prob.get_val('paraboloid.y'), -7.33333, 1e-4)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ee668d70",
   "metadata": {
    "papermill": {
     "duration": 0.001038,
     "end_time": "2026-10-02T14:46:45.803024+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:46:45.801986+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "The following cell issues the `openmdao cite paraboloid.py` command within a notebook.  \n",
    "The same capability exists in the command-line without the preceding !."
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "7936df86",
   "metadata": {
    "papermill": {
     "duration": 0.000824,
     "end_time": "2026-10-02T14:46:45.804785+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:46:45.803961+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "source": [
    "If you are in Colab or Binder, the shell command will not find the file because it is a single notebook without the included file."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "e6b64b6c",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:46:45.807437Z",
     "iopub.status.busy": "2026-10-02T14:46:45.807275Z",
     "iopub.status.idle": "2026-10-02T14:46:50.592884Z",
     "shell.execute_reply": "2026-10-02T14:46:50.592304Z"
    },
    "papermill": {
     "duration": 4.787943,
     "end_time": "2026-10-02T14:46:50.593626+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:46:45.805683+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952409.790943] [runnervm8df0l:10774:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x562982932b20 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952409.791190] [runnervm8df0l:10774:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:10774] pml_ucx.c:313  Error: Failed to create UCP worker\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Class: <class 'openmdao.core.problem.Problem'>\r\n",
      "    @article{openmdao_2019,\r\n",
      "        Author={Justin S. Gray and John T. Hwang and Joaquim R. R. A.\r\n",
      "                Martins and Kenneth T. Moore and Bret A. Naylor},\r\n",
      "        Title=\"{OpenMDAO: An Open-Source Framework for Multidisciplinary\r\n",
      "                Design, Analysis, and Optimization}\",\r\n",
      "        Journal=\"{Structural and Multidisciplinary Optimization}\",\r\n",
      "        Year={2019},\r\n",
      "        Publisher={Springer},\r\n",
      "        pdf={http://openmdao.org/pubs/openmdao_overview_2019.pdf},\r\n",
      "        note= {In Press}\r\n",
      "        }\r\n",
      "Class: <class 'openmdao.drivers.scipy_optimizer.ScipyOptimizeDriver'>\r\n",
      "    \r\n",
      "    @article{Hwang_maud_2018\r\n",
      "     author = {Hwang, John T. and Martins, Joaquim R.R.A.},\r\n",
      "     title = \"{A Computational Architecture for Coupling Heterogeneous\r\n",
      "              Numerical Models and Computing Coupled Derivatives}\",\r\n",
      "     journal = \"{ACM Trans. Math. Softw.}\",\r\n",
      "     volume = {44},\r\n",
      "     number = {4},\r\n",
      "     month = jun,\r\n",
      "     year = {2018},\r\n",
      "     pages = {37:1--37:39},\r\n",
      "     articleno = {37},\r\n",
      "     numpages = {39},\r\n",
      "     doi = {10.1145/3182393},\r\n",
      "     publisher = {ACM},\r\n",
      "    \r\n"
     ]
    }
   ],
   "source": [
    "!openmdao cite paraboloid.py"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Tags",
  "kernelspec": {
   "display_name": "Python 3",
   "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",
   "version": "3.13.14"
  },
  "papermill": {
   "default_parameters": {},
   "duration": 8.937895,
   "end_time": "2026-10-02T14:46:51.210519+00:00",
   "environment_variables": {},
   "exception": null,
   "input_path": "/home/runner/work/OpenMDAO/OpenMDAO/openmdao/docs/openmdao_book/other/citing.ipynb",
   "output_path": "/home/runner/work/OpenMDAO/OpenMDAO/openmdao/docs/_executed_book/other/citing.ipynb",
   "parameters": {},
   "start_time": "2026-10-02T14:46:42.272624+00:00",
   "version": "2.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}