Skip to content

Commit

Permalink
fix more errors
Browse files Browse the repository at this point in the history
  • Loading branch information
YigitElma committed Oct 21, 2024
1 parent 3b991f8 commit c986268
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions docs/dev_guide/transform_2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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}$)."
]
Expand Down Expand Up @@ -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"
},
Expand All @@ -190,7 +199,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.12.0"
}
},
"nbformat": 4,
Expand Down

0 comments on commit c986268

Please sign in to comment.