{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The equation is solved by forming the extended hamiltonian matrix pencil, as described in "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "H - \\lambda J"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " given by the block matrices       "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "[ A    0    B ]             [ E   0    0 ]\n[-Q  -A^H  -S ] - \\lambda * [ 0  E^H   0 ]\n[ S^H B^H   R ]             [ 0   0    0 ]",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "and using a QZ decomposition method."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "In this algorithm, the fail conditions are linked to the symmetry of the product "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "U_2 U_1^{-1}"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and condition number of "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "U_1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". Here, "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "U"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the 2m-by-m matrix that holds the eigenvectors spanning the stable subspace with 2-m rows and partitioned into two m-row matrices. See "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "2"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for more details."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "In order to improve the QZ decomposition accuracy, the pencil goes through a balancing step where the sum of absolute values of "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "H"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "J"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " entries (after removing the diagonal entries of the sum) is balanced following the recipe given in "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "3"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "versionadded",
          "base_type": "neutral",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "versionadded 0.11.0"
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "",
              "annotation": "LinAlgError",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "For cases where the stable subspace of the pencil could not be isolated. See Notes section and the references for details."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "x",
              "annotation": "(M, M) ndarray",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Solution to the continuous-time algebraic Riccati equation."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Solves the continuous-time algebraic Riccati equation (CARE)."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "a",
              "annotation": "(M, M) array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Square matrix"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "b",
              "annotation": "(M, N) array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Input"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "q",
              "annotation": "(M, M) array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Input"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "r",
              "annotation": "(N, N) array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Nonsingular square matrix"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "e",
              "annotation": "(M, M) array_like, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Nonsingular square matrix"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "s",
              "annotation": "(M, N) array_like, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Input"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "balanced",
              "annotation": "bool, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The boolean that indicates whether a balancing step is performed on the data. The default is set to True."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The CARE is defined as"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": "X A + A^H X - X B R^{-1} B^H X + Q = 0"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The limitations for a solution to exist are :"
            }
          ]
        },
        {
          "__type": "Blockquote",
          "__tag": 4059,
          "children": [
            {
              "__type": "BulletList",
              "__tag": 4053,
              "ordered": false,
              "start": 1,
              "children": [
                {
                  "__type": "ListItem",
                  "__tag": 4054,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "All eigenvalues of "
                        },
                        {
                          "__type": "InlineMath",
                          "__tag": 4057,
                          "value": "A"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": " on the right half plane, should be       controllable."
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "ListItem",
                  "__tag": 4054,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "The associated hamiltonian pencil (See Notes), should have       eigenvalues sufficiently away from the imaginary axis."
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Moreover, if "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "e"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " or "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "s"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is not precisely "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "None"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", then the generalized version of CARE"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": "E^HXA + A^HXE - (E^HXB + S) R^{-1} (B^HXE + S^H) + Q = 0"
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "is solved. When omitted, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "e"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is assumed to be the identity and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "s"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is assumed to be the zero matrix with sizes compatible with "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "b"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", respectively."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The documentation is written assuming array arguments are of specified \"core\" shapes. However, array argument(s) of this function may have additional \"batch\" dimensions prepended to the core shape. In this case, the array is treated as a batch of lower-dimensional slices; see "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "linalg_batch",
              "domain": null,
              "role": "ref",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for details."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/scipy/linalg/_solvers.py",
  "item_line": 342,
  "item_type": "function",
  "aliases": [
    "scipy.linalg.solve_continuous_are"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "Given `a`, `b`, `q`, and `r` solve for `x`:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nfrom scipy import linalg\na = np.array([[4, 3], [-4.5, -3.5]])\nb = np.array([[1], [-1]])\nq = np.array([[9, 6], [6, 4.]])\nr = 1\nx = linalg.solve_continuous_are(a, b, q, r)\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "x\n",
        "execution_status": "failure"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.allclose(a.T.dot(x) + x.dot(a)-x.dot(b).dot(b.T).dot(x), -q)\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "solve_discrete_are",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.linalg._solvers:solve_discrete_are"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Solves the discrete-time algebraic Riccati equation"
            }
          ]
        }
      ],
      "type": null
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "a",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "b",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "q",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "r",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "e",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "s",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "balanced",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "True"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "solve_continuous_are"
  },
  "references": [
    ".. [1]  P. van Dooren , \"A Generalized Eigenvalue Approach For Solving",
    "   Riccati Equations.\", SIAM Journal on Scientific and Statistical",
    "   Computing, Vol.2(2), :doi:`10.1137/0902010`",
    "",
    ".. [2] A.J. Laub, \"A Schur Method for Solving Algebraic Riccati",
    "   Equations.\", Massachusetts Institute of Technology. Laboratory for",
    "   Information and Decision Systems. LIDS-R ; 859. Available online :",
    "   http://hdl.handle.net/1721.1/1301",
    "",
    ".. [3] P. Benner, \"Symplectic Balancing of Hamiltonian Matrices\", 2001,",
    "   SIAM J. Sci. Comput., 2001, Vol.22(5), :doi:`10.1137/S1064827500367993`"
  ],
  "qa": "scipy.linalg._solvers:solve_continuous_are",
  "arbitrary": [],
  "local_refs": [
    "a",
    "b",
    "balanced",
    "e",
    "q",
    "r",
    "s",
    "x"
  ]
}