.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/05_solve_error.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_05_solve_error.py: 5. Example: Failing Corner Cases -------------------------------- Here we demonstrate that the solver PTRANS-I can fail to solve a given system. A warning is given in that case and the output will be a nan-array. .. GENERATED FROM PYTHON SOURCE LINES 8-19 .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/pentapy/envs/stable/lib/python3.11/site-packages/pentapy/core.py:88: UserWarning: pentapy: PTRANS-I not suitable for input-matrix. warnings.warn("pentapy: PTRANS-I not suitable for input-matrix.") [nan nan nan nan] | .. code-block:: Python import numpy as np import pentapy as pp # create a full pentadiagonal matrix mat = np.array([[3, 2, 1, 0], [-3, -2, 7, 1], [3, 2, -1, 5], [0, 1, 2, 3]]) V = np.array([6, 3, 9, 6]) # solve the LES with mat as a qudratic input matrix X = pp.solve(mat, V, is_flat=False, solver=1) print(X) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.001 seconds) .. _sphx_glr_download_examples_05_solve_error.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 05_solve_error.ipynb <05_solve_error.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 05_solve_error.py <05_solve_error.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 05_solve_error.zip <05_solve_error.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_