From c98626855901bab52bb7758177651e657fa70d8e Mon Sep 17 00:00:00 2001 From: YigitElma Date: Sun, 20 Oct 2024 23:28:06 -0400 Subject: [PATCH] fix more errors --- docs/dev_guide/transform_2.ipynb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/dev_guide/transform_2.ipynb b/docs/dev_guide/transform_2.ipynb index 82f4bf2d8c..ab985265b5 100644 --- a/docs/dev_guide/transform_2.ipynb +++ b/docs/dev_guide/transform_2.ipynb @@ -52,6 +52,7 @@ "\n", "Define the transform matrix as $A_{(d\\rho,d\\theta,d\\zeta)}$ for the derivative of order ${(d\\rho,d\\theta,d\\zeta)}$ (where each are integers).\n", "This matrix transforms a spectral basis evaluated on a certain grid with a given set of coefficients $\\mathbf{c}$ to real space values $x$.\n", + "\n", "$$ A\\mathbf{c} = \\mathbf{x}$$\n", "\n", "- $\\mathbf{c}$ is a vector of length `Transform.basis.num_modes` (the number of modes in the basis)\n", @@ -93,18 +94,26 @@ "The pseudo-inverse transform, $A^{\\dagger}$, applied to $\\mathbf{x}$ represents the least-squares solution for the unknown given by $\\mathbf{c}$ to the system $A \\mathbf{c} = \\mathbf{x}$.\n", "\n", "It is required from the least-squares solution, $A^{\\dagger} \\mathbf{x}$, that\n", + "\n", "$$A^{\\dagger} \\mathbf{x} = \\min_{∀ \\mathbf{c}} \\lvert A \\mathbf{c} - \\mathbf{x} \\rvert \\; \\text{so that} \\; \\lvert A A^{\\dagger} \\mathbf{x} - \\mathbf{x}\\rvert \\; \\text{is minimized}$$\n", + "\n", "For this to be true, $A A^{\\dagger}$ must be the orthogonal projection onto the image of the transformation $A$.\n", "It follows that\n", + "\n", "$$A A^{\\dagger} \\mathbf{x} - \\mathbf{x} ∈ (\\text{image}(A))^{\\perp} = \\text{kernel}(A^T)$$\n", + "\n", + "$$\n", "\\begin{align*}\n", " A^T (A A^{\\dagger} \\mathbf{x} - \\mathbf{x}) &= 0 \\\\\n", " A^T A A^{\\dagger} \\mathbf{x} &= A^T \\mathbf{x} \\\\\n", " A^{\\dagger} &= (A^T A)^{-1} A^{T} \\quad \\text{if} \\; A \\; \\text{is invertible}\n", "\\end{align*}\n", + "$$\n", "\n", "Equivalently, if $A = U S V^{T}$ is the singular value decomposition of the transform matrix $A$, then\n", + "\n", "$$ A^{\\dagger} = V S^{+} U^{T}$$\n", + "\n", "where the diagonal of $S^{+}$ has entries which are are the recipricols of the entries on the diagonal of $S$, except that any entries in the diagonal with $0$ for the singular value are kept as $0$.\n", "(If there are no singular values corresponding to $0$, then $S^{+}=S^{-1} \\implies A^{\\dagger}=A^{-1}$, and hence $A^{-1}$ exists because there are no eigenvectors with eigenvalue $0^{2}$)." ] @@ -170,13 +179,13 @@ "Functions of the toroidal coordinate $\\zeta$ use Fourier series for their basis.\n", "So a Fourier transform can be used to transform real space values to spectral space for the pseudoinverse matrix.\n", "\n", - "Todo: Figure out how fft algorithm is used." + "`Todo: Figure out how fft algorithm is used.`" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "desc-env", "language": "python", "name": "python3" }, @@ -190,7 +199,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.16" + "version": "3.12.0" } }, "nbformat": 4,