diff --git a/src/.quarto/_freeze/posts/2025-01-04-fourier-method-fixed-string/index/execute-results/html.json b/src/.quarto/_freeze/posts/2025-01-04-fourier-method-fixed-string/index/execute-results/html.json
deleted file mode 100644
index 395a203101ed7e219313d2eae216e70940947d23..0000000000000000000000000000000000000000
--- a/src/.quarto/_freeze/posts/2025-01-04-fourier-method-fixed-string/index/execute-results/html.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "hash": "f0f55934adc436eae855c6cf4696974e",
- "result": {
- "engine": "jupyter",
- "markdown": "---\ntitle: \"Fourier Method for the 1D Wave Equation: Fixed String\"\nauthor: \"Joana Levtcheva\"\ndate: \"2025-01-04\"\ncategories: [mathematics, pde]\ndraft: false\n---\n\n\n\n\nIn this post we are going to explore the Fourier method for solving the 1D wave equation. The method is more known under the name of the **method of separation of variables**. For the 1D wave equation we are going to show the application of the method to a fixed string. We are also going to attempt to outline some of the physical interpretations of the fixed string.\n\n# 1D Wave Equation\n\nThe 1D wave equation is of the form\n\n$$\nu_{tt} = a^2 u_{xx}.\n$$\n\n## Fixed String\n\nFirst, let's take a look at the model of a string with length $l$ which is also fixed at both ends:\n\n$$\n\\left\\{\\begin{aligned}\nu_{tt} = a^2 u_{xx}, \\\\ \nu(x, 0) = \\varphi_1(x),\\\\\nu_t(x, 0) = \\varphi_2(x), \\\\\nu(0, t) = u(l, t) = 0.\n\\end{aligned}\\right.\n$$\n\nA visualisation of the string can be seen in the figure below.\n\n{width=60%}\n\nWe start solving the equation by taking into account only the boundary conditions $u(0, t) = u(l, t) = 0$. The idea is to find solution $u(x, t)$ of the form\n\n$$\nu(x, t) = X(x)T(t).\n$$\n\nWe substitute this form of the solution into the wave equation and get \n\n$$\n\\frac{1}{a^2} T^{\\prime\\prime}(t)X(x) = T(t)X^{\\prime\\prime}(x),\n$$\n\nfurther divding by $X(x)T(t)$ leads to\n\n$$\n\\frac{1}{a^2} \\frac{T^{\\prime\\prime}(t)}{T(t)} = \\frac{X^{\\prime\\prime}(x)}{X(x)}.\n$$\n\nWe have two functions of independent variables which are equal. This is only possible if they are equal to the same constant. Therefore, let\n\n$$\n\\frac{1}{a^2} \\frac{T^{\\prime\\prime}(t)}{T(t)} = \\frac{X^{\\prime\\prime}(x)}{X(x)} = -\\lambda,\n$$\n\nproducing the following two equeations:\n\n$$\nT^{\\prime\\prime}(t) + a^2 \\lambda T(t) = 0\n$$\n\nand\n\n$$\\label{eq:ref}\nX^{\\prime\\prime}(x) + \\lambda X(x) = 0. \\tag{*}\n$$\n\nLet's begin with solving the second equation. The boundary conditions give\n\n$$\nX(0)T(t) = 0 \\quad \\text{and} \\quad X(l)T(t) = 0.\n$$\n\nBecause we are interested only in non-trivial solutions and thus $T \\neq 0$, we have\n\n$$\\label{eq:ref2}\nX(0) = 0 \\quad \\text{and} \\quad X(l) = 0. \\tag{**}\n$$\n\nNow, we have to find the non-trivial solutions for $X(x)$ satisfying\n\n$$\n\\left\\{\\begin{align*}\nX^{\\prime\\prime}(x) + \\lambda X(x) = 0, \\\\\nX(0) = 0, \\quad X(l) = 0.\n\\end{align*}\\right.\n$$\n\nThe above problem is an example of the so called **Sturm-Liouville problem**. In order to find the general solution of the second order linear homogeneous differential equation with constant coefficients $\\eqref{eq:ref}$ we should solve its characteristic equation\n\n$$\nr^2 + \\lambda = 0.\n$$\n\n- If $\\lambda < 0$, then $r_{1, 2} = \\pm \\sqrt{-\\lambda}$, hence the general solution is\n$$\nX(x) = c_1 e^{\\sqrt{-\\lambda}x} + c_2 e^{-\\sqrt{-\\lambda}x}\n$$\nfor some constants $c_1$ and $c_2$. In order to determine the constants we substitute the above solution into the boundary conditions $\\eqref{eq:ref2}$ and get the system\n$$\n\\left\\{\\begin{align*}\nc_1 + c_2 = 0, \\\\\nc_1 e^{\\sqrt{-\\lambda}l} + c_2 e^{-\\sqrt{-\\lambda}l} = 0. \n\\end{align*}\\right.\n$$\nThis results in $c_1 = c_2 = 0$, meaning our Sturm-Liouville problem doesn't have a non-zero solution for $\\lambda < 0$.\n\n- If $\\lambda = 0$, then $r_1 = r_2 = 0$ and the general solution is\n$$\nX(x) = c_1 + c_2 x.\n$$\nSubstituing it into the boundary conditions $\\eqref{eq:ref2}$ again lead to $c_1 = c_2 = 0$, hence no non-zero solutions of our Sturm-Liouville problem for $\\lambda \\leq 0$.\n\n- If $\\lambda > 0$, then $r_{1, 2} = \\pm i \\sqrt{\\lambda}$, and the general solution becomes\n$$\nX(x) = c_1 \\cos{\\left( \\sqrt{\\lambda} x \\right)} + c_2 \\sin{\\left(\\sqrt{\\lambda}x\\right)}.\n$$\nSubstituting into the boundary conditions $\\eqref{eq:ref2}$ results in\n$$\n\\left\\{\\begin{align*}\nc_1 = 0, \\\\\nc_2 \\sin{\\left(\\sqrt{\\lambda}l\\right)} = 0\n\\end{align*}\\right.\n$$\nIf $c_2 = 0$, then $X(x) \\equiv 0$ which is a trivial solution. Therefore, we set $c_2 \\neq 0$ and hence\n$$\n\\sin{\\left(\\sqrt{\\lambda}l\\right)} = 0,\n$$\ngiving $\\sqrt{\\lambda}l = k \\pi$, $k = \\pm 1, \\pm 2, ...$. Theerfore,\n$$\n\\lambda = \\lambda_k = \\left(\\frac{k \\pi}{l}\\right)^2,\n$$\nmeaning eigenvalues exist when $\\lambda > 0$. The eigenfunctions corresponding to the above eigenvalues are\n$$\nX_k(x) = \\sin{\\left(\\frac{k \\pi x}{l}\\right)}, \\quad k > 0, k \\in N.\n$$\n\nGoing back to $T^{\\prime\\prime}(t) + a^2 \\lambda T(t) = 0$, solving in analogical way, when $\\lambda = \\lambda_k$ the solution becomes\n\n$$\nT_k(t) = A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\n$$\n\nfor some constants $A_k$ and $B_k$. Hence,\n\n$$\nu_k(x,t) = X_k(x) T_k(t) = \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi x}{l}\\right)}, \\quad k > 0, k \\in N\n$$\n\nare solutions to our wave equation, also satisfying the boundary conditions. Since our equation is linear, forming a linear system with its conditions, the **principle of superposition** is valid. In other words, if $u_1, u_2, ..., u_n$ are solutions of our system, then\n\n$$\n\\alpha_1 u_1 + \\alpha_2 u_2 + ... + \\alpha_n u_n\n$$\n\nfor some constants $\\alpha_1, \\alpha_2, ..., \\alpha_n$ is also a solution of the system. But in our case we have an infinite number of functions $u_1, u_2, ...$ which satisfy the linear system. Therefore, we need the **generalised superposition principle** stating that in such case\n\n$$\nu = \\sum_n^{\\infty} \\alpha_n u_n\n$$\n\nfor some arbitrary constants $\\alpha_n$ is a solution to the system if the series converges uniformly and is twice differentiable termwise. This generalisation is a Lemma and should be prooved. The proof can be found in ...\n\nAssuming we have prooved the said Lemma, we can state that our system has a solution of the form\n\n$$\nu(x, t) = \\sum_{k=1}\n^{\\infty} u_k(x, t) = \\sum_{k=1}^{\\infty} \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi x}{l}\\right)}.\n$$\n\nThe next task we have to tackle is to determine the coefficients $A_k$ and $B_k$. We can achieve this by using the initial conditions \n\n$$\nu(x, 0) = \\varphi_1(x), \\quad \\text{and} \\quad u_t(x, 0) = \\varphi_2(x).\n$$\n\nWe get\n\n$$\nu(x, 0) = \\sum_{k=1}\n^{\\infty} A_k \\sin{\\left(\\frac{k \\pi x}{l}\\right)} = \\varphi_1(x)\n$$\n\nand\n\n$$\nu_t(x, 0) = \\sum_{k=1}^{\\infty} \\frac{ak\\pi}{l} B_k \\sin{\\left(\\frac{k \\pi x}{l}\\right)} = \\varphi_2(x).\n$$\n\nNow, we have to expand both $\\varphi_1(x)$ and $\\varphi_2(x)$ into series in terms of sines only (why?). We have\n\n$$\n\\varphi_1(x) = \\sum_{k=1}^{\\infty} \\varphi_k^{(1)} \\sin{\\left(\\frac{k \\pi}{l}x\\right)}\n$$\n\nand\n\n$$\n\\varphi_2(x) = \\sum_{k=1}^{\\infty} \\varphi_k^{(2)} \\sin{\\left(\\frac{k \\pi}{l}x\\right)}.\n$$\n\nBy the Fourier series theroem of uniqueness, we get\n\n$$\nA_k = \\varphi_k^{(1)} \\quad \\text{and} \\quad B_k = \\frac{l}{ak\\pi} \\varphi_k^{(2)},\n$$\n\nor (why?)\n\n$$\nA_k = \\frac{2}{l} \\int_{0}^{l} \\varphi_1(x) \\sin{\\left(\\frac{k \\pi}{l}x\\right)} \\mathrm{d}x\n$$\n\nand\n\n$$\nB_k = \\frac{2}{ak\\pi} \\int_{0}^{l} \\varphi_2(x) \\sin{\\left(\\frac{k \\pi}{l}x\\right)} \\mathrm{d}x.\n$$\n\nWe are left with the task of the covergence of the infinite series. We have to explore the following series\n\n$$\n|u(x, t)| \\leq \\sum_{k=1}^{\\infty}(|A_k| + |B_k|),\n$$\n\n$$\n|u_t(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{ak\\pi}{l}(|A_k| + |B_k|),\n$$\n\n$$\n|u_x(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{k\\pi}{l}(|A_k| + |B_k|),\n$$\n\n$$\n|u_{tt}(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{a^2 k^2 \\pi^2}{l^2}(|A_k| + |B_k|),\n$$\n\n$$\n|u_{xx}(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{k^2 \\pi^2}{l^2}(|A_k| + |B_k|).\n$$\n\nIf the series on the right side (majorizing series) converge then the series on the left would also converge and the needed differentiation would exist. It is enough (why?) for the following series to converge\n\n$$\n\\sum_{k=1}^{\\infty} k^j \\left(|\\varphi_k^{(1)}| + \\frac{2}{ak\\pi}|\\varphi_k^{(2)}|\\right), j = 0, 1, 2.\n$$\n\nThis is possible only if \n\n$$\n\\left\\{\\begin{align*}\n\\sum_{k=1}^{\\infty} k^j |\\varphi_k^{(1)}|, \\\\\n\\sum_{k=1}^{\\infty} k^{j-1} |\\varphi_k^{(2)}|,\n\\end{align*}\\right. \\quad j = 0, 1, 2.\n$$\n\nconverge. From Calculus we know (theorem) that if $\\varphi(x)$ is $m$-times differentiable then\n\n$$\n\\sum_{k=1}^{\\infty} k^{m-1} |\\varphi_k|\n$$\n\nconvergres. Therefore, in order for all the majorzing series to converge it is enough $\\varphi_1(x)$ to be $3$-times differentiable, and $\\varphi_2(x)$ to be $2$-times differentiable.\n\nFinally, we should note a few things about the expansion of $\\varphi_1(x)$ and $\\varphi_2(x)$ into sine series. We have to note that in order to do that the function needs to be continued as an odd function which my lead to loss of the regularity of the lower derivatives. Let $\\tilde{\\varphi}_1(x)$ be the continuation of $\\varphi_1(x)$ as an odd function (see the Figure below) defined as\n\n{width=50%}\n\n\n$$\n\\tilde{\\varphi}_1(x) = \\left\\{\\begin{align*}\n\\varphi_1(x), \\quad 0 \\leq x \\leq l, \\\\\n-\\varphi_1(-x), \\quad -l \\leq x \\leq 0.\n\\end{align*}\\right.\n$$\n\nHence, in order for it to be continous and continously differentibale we need to enforce the following condition\n\n$$\n\\varphi_1(0) = \\varphi_1(l) = 0.\n$$\n\nTo summarise, in order for $\\sum_{k=1}^{\\infty} \\varphi_k^{(1)} \\sin{\\left( \\frac{k\\pi}{l}x\\right)}$ to converge in $[0, l]$ it is necessary to enforce the above conditions to have zero values at both ends of the interval. As for the second derivative, if it exists it would be continuous as well. Similarly, for the third derivative to exist we enforce\n\n$$\n\\varphi_1^{\\prime\\prime}(0) = \\varphi_1^{\\prime\\prime}(l) = 0\n$$\n\nand obtain the corresponding necessary condition\n\n$$\n\\varphi_2(0) = \\varphi_2(l) = 0.\n$$\n\nFinally, after these enforced conditions we can conclude that (tehorem)\n\n$$\nu(x, t) = \\sum_{k=1}^{\\infty} \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi x}{l}\\right)}\n$$\n\nis a regular solution of the problem.\n\n**Physical interpretation:**\n\nIf we go back to the eigenfunction\n\n$$\nu_k(x,t) = \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi}{l}x\\right)}, \\quad k > 0, k \\in N\n$$\n\nwe can rewrite it as\n\n$$\nu_k(x,t) = \\sqrt{A_k^2 + B_k^2} \\sin{\\left(\\frac{k \\pi}{l}x\\right)} \\sin{\\left(\\frac{ak\\pi}{l}t + \\phi_k\\right)}, \\quad k \\in N,\n$$\n\nwhere\n\n$$\n\\tan{(\\phi_k)} = \\frac{A_k}{B_k}.\n$$\n\nWe can translate this as the points of the string to oscillate at the frequency $\\omega_k = \\frac{ak\\pi}{l}$ with phase $\\phi_k$. The amplitude is dependant on $x$ and is given by\n$$\nF_k = \\sqrt{A_k^2 + B_k^2} \\sin{\\left(\\frac{k\\pi}{l}x\\right)}.\n$$\n\nThe $u_k(x, t)$ waves are called **standing-waves**. Depending on the values of $k$ we have the following scenarios:\n\n- When $k = 1$ there are $2$ motionless points which are the ends of the (fixed) string\n- When $k = 2$ a third moitonless point $x = \\frac{l}{2}$ is added\n\nThese motionless points are called **nodes** of the standing wave. In general, $u_k(x, t)$ has $(k + 1)$ nodes located ate $0, \\frac{1}{k}l, \\frac{2}{k}l, ..., \\frac{k-1}{k}l, l$. The maximum amplitude is achieved in the middle points between two nodes. These points are called **crests**. The fundamental tone, or the lowest tone, has frequency of $\\omega_1 = \\frac{a\\pi}{l}$. The frequencies $\\omega_k$ are called **harmonics**, while the higher tones corresponding to $\\omega_k$, $k = 2, 3, ...$ are called **overtones**. It is quite natural to notice that the higher the value of $k$ the rapidly lower the amplitude of $u_k(x, t)$ becomes. Meaning, the effect from the higher harmonics all combined influences the quality of the sound. The below figure shows the harmonics for $k = 1, 2, 3$.\n\n{width=70%}\n\n### Example\n\nHere, we are going to show an example of a fixed string. We are going to show an animated solution with the help of Python. The fixed string problem is given by\n\n$$\n\\left\\{\\begin{aligned}\nu_{tt} = \\left(\\frac{2}{3}\\right)^2 u_{xx}, \\\\ \nu(x, 0) = \\left\\{\\begin{align*}\n\\sin^3{(\\pi x)}, \\quad 1 \\leq x \\leq3, \\\\\n0, \\quad x \\in R \\backslash [1, 3],\n\\end{align*}\\right.,\\\\\nu_t(x, 0) = 0, \\\\\nu(0, t) = u(\\pi \\sqrt{5}, t) = 0.\n\\end{aligned}\\right.\n$$\n\nUsing the $100$-th partial Fourier sum, below is shown the animated solution for $t \\in [0, 30]$.\n\n::: {#1b9c3320 .cell execution_count=1}\n``` {.python .cell-code code-fold=\"true\" code-summary=\"Click to expand the code\"}\nimport numpy as np\nimport pandas as pd\nimport plotly.express as px\n\n# Define constants\nL = np.pi * np.sqrt(5)\na = 2 / 3\ntmax = 30\nx = np.linspace(0, L, 101)\nt = np.linspace(0, tmax, 31) # Fewer points for smoother interaction\n\n\n# Define the initial condition phi(x)\ndef phi(x):\n y = np.zeros_like(x)\n y[(1 < x) & (x < 3)] = np.sin(np.pi * x[(1 < x) & (x < 3)]) ** 3\n return y\n\n\n# Define the initial velocity psi(x)\ndef psi(x):\n return np.zeros_like(x)\n\n\n# Define the Fourier solution for u(x, t)\ndef fourier_u(x, t):\n y = np.zeros_like(x)\n for k in range(1, 101):\n Xk = np.sin(k * np.pi * x / L)\n Ak = (2 / L) * np.trapezoid(phi(x) * Xk, x)\n Bk = (2 / (a * k * np.pi)) * np.trapezoid(psi(x) * Xk, x)\n Tk = Ak * np.cos(a * k * np.pi * t / L) + Bk * np.sin(a * k * np.pi * t / L)\n y += Tk * Xk\n return y\n\n\n# Create animation data\ndata = []\nfor t_val in t:\n y = fourier_u(x, t_val)\n for x_val, y_val in zip(x, y):\n data.append({\"x\": x_val, \"y\": y_val, \"t\": f\"t = {t_val:.2f}\"})\n\n# Create DataFrame and plot\ndf = pd.DataFrame(data)\nfig = px.line(\n df,\n x=\"x\",\n y=\"y\",\n animation_frame=\"t\",\n # title=\"String Motion\",\n labels={\"x\": \"x\", \"y\": \"u(x, t)\"},\n range_x=[-0.06, L + 0.06],\n range_y=[-1.1, 1.1],\n color_discrete_sequence=[\"red\"],\n)\n\n# Add fixed points as black dots\nfixed_points = pd.DataFrame(\n {\n \"x\": [0, L],\n \"y\": [0, 0],\n }\n)\n\nfig.add_scatter(\n x=fixed_points[\"x\"],\n y=fixed_points[\"y\"],\n mode=\"markers\",\n marker=dict(color=\"black\", size=10),\n showlegend=False,\n)\n\nfig.update_layout(\n showlegend=False,\n height=280,\n margin=dict(l=10, r=30, t=30, b=10),\n updatemenus=[\n {\n \"buttons\": [\n {\n \"args\": [\n None,\n {\n \"frame\": {\"duration\": 200, \"redraw\": True},\n \"fromcurrent\": True,\n \"mode\": \"immediate\",\n \"transition\": {\"duration\": 0},\n },\n ],\n \"label\": \"Play\",\n \"method\": \"animate\",\n },\n {\n \"args\": [\n [None],\n {\n \"frame\": {\"duration\": 0, \"redraw\": True},\n \"mode\": \"immediate\",\n \"transition\": {\"duration\": 0},\n },\n ],\n \"label\": \"Pause\",\n \"method\": \"animate\",\n },\n ],\n \"type\": \"buttons\",\n \"direction\": \"left\",\n \"showactive\": True,\n \"x\": 0.2,\n \"y\": 0.3,\n \"xanchor\": \"right\",\n \"yanchor\": \"top\",\n }\n ],\n sliders=[\n {\n \"active\": 0,\n \"yanchor\": \"top\",\n \"xanchor\": \"left\",\n \"currentvalue\": {\"font\": {\"size\": 16}, \"visible\": True, \"xanchor\": \"right\"},\n \"transition\": {\"duration\": 500, \"easing\": \"cubic-in-out\"},\n \"pad\": {\"b\": 10, \"t\": 50},\n \"len\": 1,\n \"x\": 0,\n \"y\": 0,\n \"steps\": [\n {\n \"args\": [\n [f\"t = {t:.2f}\"],\n {\n \"frame\": {\n \"duration\": 500,\n \"easing\": \"cubic-in-out\",\n \"redraw\": True,\n },\n \"mode\": \"immediate\",\n \"transition\": {\"duration\": 0},\n },\n ],\n \"label\": f\"{t:.0f}\",\n \"method\": \"animate\",\n }\n for t in t\n ],\n }\n ],\n)\n\nconfig = {\n \"displayModeBar\": True, # Show the toolbar\n # \"modeBarButtonsToRemove\": [\"lasso2d\", \"select2d\"], # Remove unused buttons\n \"displaylogo\": False,\n \"toImageButtonOptions\": {\"height\": 500, \"width\": 800}, # Image export size\n}\nfig.write_html(\n \"content/code/2025-01-04-fourier-method-fixed-string/fixed_string_animation.html\",\n include_plotlyjs=True,\n full_html=True,\n auto_play=False,\n config=config,\n)\n```\n:::\n\n\n\n\nTest\n\n::: {#25903f52 .cell fig-format='html' execution_count=2}\n``` {.python .cell-code}\nimport plotly.io as pio\nimport numpy as np\nimport pandas as pd\nimport plotly.express as px\n\npio.renderers.default = \"plotly_mimetype+notebook_connected\"\n\n# Define constants\nL = np.pi * np.sqrt(5)\na = 2 / 3\ntmax = 30\nx = np.linspace(0, L, 101)\nt = np.linspace(0, tmax, 31) # Fewer points for smoother interaction\n\n\n# Define the initial condition phi(x)\ndef phi(x):\n y = np.zeros_like(x)\n y[(1 < x) & (x < 3)] = np.sin(np.pi * x[(1 < x) & (x < 3)]) ** 3\n return y\n\n\n# Define the initial velocity psi(x)\ndef psi(x):\n return np.zeros_like(x)\n\n\n# Define the Fourier solution for u(x, t)\ndef fourier_u(x, t):\n y = np.zeros_like(x)\n for k in range(1, 101):\n Xk = np.sin(k * np.pi * x / L)\n Ak = (2 / L) * np.trapezoid(phi(x) * Xk, x)\n Bk = (2 / (a * k * np.pi)) * np.trapezoid(psi(x) * Xk, x)\n Tk = Ak * np.cos(a * k * np.pi * t / L) + Bk * np.sin(a * k * np.pi * t / L)\n y += Tk * Xk\n return y\n\n\n# Create animation data\ndata = []\nfor t_val in t:\n y = fourier_u(x, t_val)\n for x_val, y_val in zip(x, y):\n data.append({\"x\": x_val, \"y\": y_val, \"t\": f\"t = {t_val:.2f}\"})\n\n# Create DataFrame and plot\ndf = pd.DataFrame(data)\nfig = px.line(\n df,\n x=\"x\",\n y=\"y\",\n animation_frame=\"t\",\n # title=\"String Motion\",\n labels={\"x\": \"x\", \"y\": \"u(x, t)\"},\n range_x=[-0.06, L + 0.06],\n range_y=[-1.1, 1.1],\n color_discrete_sequence=[\"red\"],\n)\n\n# Add fixed points as black dots\nfixed_points = pd.DataFrame(\n {\n \"x\": [0, L],\n \"y\": [0, 0],\n }\n)\n\nfig.add_scatter(\n x=fixed_points[\"x\"],\n y=fixed_points[\"y\"],\n mode=\"markers\",\n marker=dict(color=\"black\", size=10),\n showlegend=False,\n)\n\nfig.update_layout(\n showlegend=False,\n height=280,\n margin=dict(l=10, r=30, t=30, b=10),\n updatemenus=[\n {\n \"buttons\": [\n {\n \"args\": [\n None,\n {\n \"frame\": {\"duration\": 200, \"redraw\": True},\n \"fromcurrent\": True,\n \"mode\": \"immediate\",\n \"transition\": {\"duration\": 0},\n },\n ],\n \"label\": \"Play\",\n \"method\": \"animate\",\n },\n {\n \"args\": [\n [None],\n {\n \"frame\": {\"duration\": 0, \"redraw\": True},\n \"mode\": \"immediate\",\n \"transition\": {\"duration\": 0},\n },\n ],\n \"label\": \"Pause\",\n \"method\": \"animate\",\n },\n ],\n \"type\": \"buttons\",\n \"direction\": \"left\",\n \"showactive\": True,\n \"x\": 0.2,\n \"y\": 0.3,\n \"xanchor\": \"right\",\n \"yanchor\": \"top\",\n }\n ],\n sliders=[\n {\n \"active\": 0,\n \"yanchor\": \"top\",\n \"xanchor\": \"left\",\n \"currentvalue\": {\"font\": {\"size\": 16}, \"visible\": True, \"xanchor\": \"right\"},\n \"transition\": {\"duration\": 500, \"easing\": \"cubic-in-out\"},\n \"pad\": {\"b\": 10, \"t\": 50},\n \"len\": 1,\n \"x\": 0,\n \"y\": 0,\n \"steps\": [\n {\n \"args\": [\n [f\"t = {t:.2f}\"],\n {\n \"frame\": {\n \"duration\": 500,\n \"easing\": \"cubic-in-out\",\n \"redraw\": True,\n },\n \"mode\": \"immediate\",\n \"transition\": {\"duration\": 0},\n },\n ],\n \"label\": f\"{t:.0f}\",\n \"method\": \"animate\",\n }\n for t in t\n ],\n }\n ],\n)\n\nfig.show()\n```\n\n::: {.cell-output .cell-output-display}\n```{=html}\n \n \n \n```\n:::\n\n::: {.cell-output .cell-output-display}\n```{=html}\n
\n```\n:::\n:::\n\n\n::: {#dc22265c .cell fig-format='html' execution_count=3}\n``` {.python .cell-code}\nimport plotly.express as px\nimport plotly.io as pio\nimport numpy as np\nimport pandas as pd\nimport plotly.express as px\n\npio.renderers.default = \"plotly_mimetype+notebook_connected\"\n\ndf = px.data.iris()\nfig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\", \n color=\"species\", \n marginal_y=\"violin\", marginal_x=\"box\", \n trendline=\"ols\", template=\"simple_white\")\nfig.show()\n```\n\n::: {.cell-output .cell-output-display}\n```{=html}\n \n \n \n```\n:::\n\n::: {.cell-output .cell-output-display}\n```{=html}\n\n```\n:::\n:::\n\n\nTest\n\n",
- "supporting": [
- "index_files"
- ],
- "filters": [],
- "includes": {
- "include-in-header": [
- "\n\n\n"
- ]
- }
- }
-}
\ No newline at end of file
diff --git a/src/.quarto/_freeze/posts/2025-01-06-chebyshev-polynomials/index/execute-results/html.json b/src/.quarto/_freeze/posts/2025-01-06-chebyshev-polynomials/index/execute-results/html.json
deleted file mode 100644
index 48378e4154d97e749d25adf91aa96d387178be2f..0000000000000000000000000000000000000000
--- a/src/.quarto/_freeze/posts/2025-01-06-chebyshev-polynomials/index/execute-results/html.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "hash": "aa583ba3ab0462ca32f88764351645de",
- "result": {
- "engine": "jupyter",
- "markdown": "---\ntitle: \"Chebyshev Polynomials: Part 1\"\nauthor: \"Joana Levtcheva\"\ndate: \"2025-01-06\"\ncategories: [mathematics, polynomials]\ndraft: false\n---\n\n\n\n\nChebyshev polynomials are a sequence of orthogonal polynomials that play a central role in numerical analysis, approximation theory, and applied mathematics. They are named after the Russian mathematician Pafnuty Chebyshev and come in two primary types: Chebyshev polynomials of the first kind ($T_n(x)$) and Chebyshev polynomials of the second kind ($U_n(x)$). In this post we are going to focus on the Chebyshev polynomials of the first kind.\n\n# Chebyshev Polynomials of the First Kind\n\nThere are many different ways to define the Chebyshev polynomials of the first kind. The one that seems most logical to me and most useful in terms of outlining various properties of the polynomials is\n\n$$\\label{eq:1}\nT_{n}(x) = \\cos{\\left(n \\arccos{x}\\right)}, \\quad x \\in [-1, 1].\\tag{1}\n$$\n\nLooking at \\eqref{eq:1} it is not obvious why $T_{n}(x)$ would be a polynomial. In order to show it is indeed a polynomial let's recall the de Moivre's formula\n\n$$\n\\cos{(n \\theta)} + i\\sin{(n \\theta)} = (\\cos(\\theta) + i \\sin{\\theta})^n.\n$$\n\nWe can apply binomial expansion and take the real part from it to obatin\n\n$$\\label{eq:2}\n\\cos(n \\theta) = \\sum_{k = 0}^{\\frac{n}{2}} C(n, 2k) (-1)^k \\cos^{n - 2k}\\theta \\sin^{2k}{\\theta}. \\tag{2}\n$$\n\nwhere \n\n$$\nC(n, 2k) = \\frac{n!}{(2k)!(n-2k)!}, \\quad n \\geq 2k, k \\in N, n \\in N\n$$ \n\ndenotes the binomal coefficient. We can also notice that\n\n$$\n\\sin^{2k}\\theta = (\\sin^2{\\theta})^k = (1 - \\cos^2{\\theta})^k,\n$$\n\nshowing that \\eqref{eq:2} is a polynomial of $\\cos{\\theta}$ of degree $n$. Now, let\n\n$$\n\\theta = \\arccos{x},\n$$\n\nand by utilising $\\cos{\\left(\\arccos{x}\\right)} = x$ we get\n\n$$\nx = \\cos{\\theta}.\n$$\n\nThis transforms \\eqref{eq:1} to \n\n$$\\label{eq:3}\nT_{n}(\\cos{\\theta}) = \\cos{\\left(n \\theta\\right)} \\tag{3}\n$$\n\nwhich we already showed is a polynomial of degree $n$. From here, because $\\cos(.)$ is an even function, we can note that\n\n$$\nT_{n}(x) = T_{-n}(x) = T_{|n|}(x.)\n$$\n\nFrom \\eqref{eq:3} it is also obvious that the values of $T_n$ in the interval $[-1, 1]$ are bounded in $[-1, 1]$ because of the cosine.\n\n## Chebyshev Nodes of the First Kind\n\nBefore we continue with exploring the roots of the polynomials, let's recall some trigonometry. \n\n---\n\nThe **unit circle** is a circle with a radius of 1, centered at the origin of the Cartesian coordinate system. Below is shown part of the unit circle corresponding to the region from $0$ to $\\frac{\\pi}{2}$.\n\n\n\nThe cosine of an angle $\\theta$ corresponds to the $x$-coordinate of the point where the terminal side of the angle (measured counterclockwise from the positive $x$-axis) intersects the unit circle. In other words, $\\cos(\\theta)$ gives the horizontal distance from the origin to this intersection point. \n\nThe **arccosine** is the inverse function of cosine, and it maps a cosine value back to its corresponding angle in the range $[0, \\pi]$ radians. For a given $x$-coordinate on the unit circle, the arccosine gives the angle $\\theta$ such that $\\cos(\\theta) = x$, meaning\n\n$$\n\\arccos(x) = \\theta, \\quad \\text{where } \\theta \\in [0, \\pi].\n$$\n\nMoreover, a **radian** is defined as the angle subtended at the center of a circle by an arc whose length is equal to the radius of the circle. For any circle, the length of an arc $s$ is given by\n\n$$\ns = r \\cdot \\theta,\n$$\n\nwhere $r$ is the radius of the circle, $\\theta$ is the angle subtended by the arc at the center. This means that on the unit circle the length of the arc equals the measure of the angle in radians because $r = 1$, and hence\n\n$$\ns = \\theta.\n$$\n\n---\n\nNow, let's find the roots of the polynomial $T_{n}(x)$. If we take the definition in \\eqref{eq:1} we have to solve\n\n$$\n\\cos{\\left(n \\arccos{x}\\right)} = 0, k \\in N.\n$$\n\nThe solutions in the interval $(-1, 1)$ are given by\n\n$$\nx_k = \\cos{\\left(\\frac{2k - 1}{2n}\\pi\\right)}, n \\in N, k = 1, 2, ...n.\n$$\n\nThese roots are known as the **Chebyshev nodes of the first kind**, or the **Chebyshev zeros**. If we are working with an arbitrary interval $(a, b)$ the affine transformation \n\n$$\nx_k = \\frac{a + b}{2} + \\frac{b - a}{2}\\cos{\\left(\\frac{2k - 1}{2n}\\pi\\right)}, n \\in N, k = 1, 2, ...n\n$$\n\nis needed. From the cosine properties we can also note that the nodes are symmetric with respect to the midpoint of the interval, and that the extrema of $T_n(x)$ over the interval $[-1, 1]$ alternate between $-1$ and $1$. Also, a very useful fact is that these nodes are used in polynomial interpolation to minimize the **Runge phenomenon**.\n\nIn the figure below we have shown the roots of $T_{8}(x)$ in blue. We have also built the perpendiculars from the roots to their interesction with the upper half of the unit circle, and marked these points in red.\n\n{ width=45% }{ width=45% }\n\nLooking at the figure we can notice that the arc lengths between the red points seem to be of the same length. Let's show that this is indeed the truth.\n\nWe showed the roots are the cosine functions $\\cos{\\left(\\frac{2k - 1}{2n}\\pi\\right)}, n \\in N, k = 1, 2, ...n$. Thus, in the unit circle we have that the length of the corresponding arcs are equal to $\\left( \\frac{2k - 1}{2n}\\pi \\right), n \\in N, k = 1, 2, ...n$. Let's take two red points which are direct neighbours, or in other words let's take two red points corresponding to the randomly chosen $m$ and $m + 1$ roots, $m \\in k = \\{1, 2, ..., n\\}$. If we subtract them we are going to determine the length of the arc between them. We have\n\n$$\n\\frac{2(m + 1) - 1}{2n}\\pi - \\frac{2m - 1}{2n}\\pi = \\frac{\\pi}{n},\n$$\n\nmeaning that between every two nodes the arc length is equal and has a value of $\\frac{\\pi}{n}$. A polynomial of degree $n$ has $n$ roots, which in our case are in the open interval $(-1, 1)$, meaning the arcs corresponding to every two neighbouring roots are $n - 1$, and the two arcs between the $x$-axis and the first and last roots due to the symmetry of roots have lenghts of\n\n$$\n\\frac{1}{2}\\left(\\pi - \\frac{n-1}{n}\\pi\\right) = \\frac{\\pi}{2n}.\n$$\n\n## Recurrence relation\n\nThis is probably a bit out of nowhere, but let's take a look at the following trigonometric identity\n\n$$\\label{eq:4}\n\\cos{\\left((n + 1)\\theta\\right)} + \\cos{\\left((n - 1)\\theta\\right)} = 2 \\cos{(\\theta)} \\cos{(n\\theta)},\\tag{4}\n$$\n\nand show that the left side indeed is equal to the right one. We are going to need the following two fundamental formulas of angle addition in trigonometry\n\n$$\n\\cos{(\\alpha + \\beta)} = \\cos{\\alpha} \\cos{\\beta} - \\sin{\\alpha} \\sin{\\beta},\n$$\n\nand\n\n$$\n\\cos{(\\alpha - \\beta)} = \\cos{\\alpha} \\cos{\\beta} + \\sin{\\alpha} \\sin{\\beta}.\n$$\n\nIn our case we have\n\n$$\n\\cos{\\left((n + 1)\\theta\\right)} = \\cos{\\left(n\\theta + \\theta\\right)} = \\cos{(n\\theta)} \\cos{\\theta} - \\sin{(n\\theta)} \\sin{\\theta},\n$$\n\nand\n\n$$\n\\cos{\\left((n - 1)\\theta\\right)} = \\cos{\\left(n\\theta - \\theta\\right)} = \\cos{(n\\theta)} \\cos{\\theta} + \\sin{(n\\theta)} \\sin{\\theta}.\n$$\n\nAdding the above equations leads to the wanted result.\n\nNow, we can see that the terms of \\eqref{eq:4} are exactly in the form of the right side of \\eqref{eq:1}, \\eqref{eq:3}, hence we get\n\n$$\nT_{n + 1}(x) + T_{n - 1}(x) = 2T_{n}(x)T_{1}(x),\n$$\n\nor we get the useful **recurrence relation**\n\n$$\\label{eq:5}\nT_{n + 1}(x) - 2xT_{n}(x) + T_{n - 1}(x) = 0.\\tag{5}\n$$\n\nThis relation along with adding $T_{0}(x) = 1$ and $T_{1}(x) = x$ is another famous way to define the Chebyshev polynomials of the first kind, or\n\n$$\n\\left\\{\\begin{align*}\nT_{0}(x) = 1, \\\\\nT_{1}(x) = x, \\\\\nT_{n + 1}(x) - 2xT_{n}(x) + T_{n - 1}(x) = 0.\n\\end{align*}\\right.\\label{eq:6}\\tag{6}\n$$\n\nLet's write the first $6$ polynomials by using \\eqref{eq:6}:\n\n$$\n\\left\\{\\begin{align*}\nT_{0}(x) = 1, \\quad \\text{(even)}\\\\\nT_{1}(x) = x, \\quad \\text{(odd)}\\\\\nT_{2}(x) = 2x^2 - 1, \\quad \\text{(even)}\\\\\nT_{3}(x) = 4x^3 - 3x, \\quad \\text{(odd)}\\\\\nT_{4}(x) = 8x^4 - 8x^2 + 1, \\quad \\text{(even)}\\\\\nT_{5}(x) = 16x^5 - 20x^3 + 5x. \\quad \\text{(odd)}\n\\end{align*}\\right.\n$$\n\nWe can notice that\n\n$$\nT_{k}(x) = 2^{k-1}x^k + ...,\n$$\n\nand $T_{k}(x)$ is alternating between an even and an odd polynomial depending on whether $k$ is even or odd respectively.\n\nBefore we continue with some visualisations and more facts, let's mention that an interesting way to represent the recurrence relation \\eqref{eq:5} is via the determinant\n\n$$\nT_{k}(x) = \\det \\begin{bmatrix}\nx & 1 & 0 & \\dots & 0 \\\\\n1 & 2x & 1 & \\ddots & \\vdots \\\\\n0 & 1 & 2x & \\ddots & 0 \\\\\n\\vdots & \\ddots & \\ddots & \\ddots & 1 \\\\\n0 & \\dots & 0 & 1 & 2x\n\\end{bmatrix}.\n$$\n\nNow, let's visualise the first $8$ polynomials.\n\n\n\nBut what can we notice if we stack them together?\n\n\n\nIt is quite obvious that at the roots of the $N$-th Chebyshev polynomial there is an **aliasing** effect, meaning higher order polynomials look like lower order ones. We can formally show it by fixing $N$, at the roots $x_k$ of $T_{N}(x) = 0$, and using the Chebyshev identity\n\n$$\n\\cos{\\left((m + N)\\theta\\right)} + \\cos{\\left((m - N)\\theta\\right)} = 2\\cos{(m\\theta)}\\cos{(N\\theta)},\n$$\n\nor equivalently\n\n$$\nT_{m + N}(x) + T_{m - N}(x) = 2T_{m}(x)T_{N}(x).\n$$\n\nNow, having $T_{N}(x) = 0$ leads to\n\n$$\nT_{m + N}(x) = -T_{m - N}(x).\n$$\n\nIf we consecutevly set $m = N$, $m = 2N$, ..., $m = 6N$, etc. we would get\n\n$$\n\\left\\{\\begin{align*}\nT_{2N}(x_k) = -T_{0}(x_k) = -1, \\\\\nT_{3N}(x_k) = 0, \\\\\nT_{4N}(x_k) = 1, \\\\\nT_{5N}(x_k) = 0, \\\\\nT_{6N}(x_k) = -1, \\\\\n\\text{etc}.\n\\end{align*}\\right.\n$$\n\nWe can safely say that any higher-order Chebyshev polynomial $T_{N}(x)$ can be reduced to a lower-order $j, 0 \\leq j \\leq N$ Chebyshev polynomial at the sample points $x_k$ which are the roots of $T_{N}(x)$. In the figure below we attempt to visualise this statement.\n\n\n\nThe horizontal axis represents the order of Chebyshev polynomials, and the blue wavy line represents a \"folded ribbon\". Think of it as taking the sequence of polynomial orders and folding it back and forth. This folding happens at specific points where higher-order polynomials can be reduced to lower-order ones, which are the red **x** marks showing the sample points: the roots of $T_n(x)$. The key insight is that at these special sample points, we don't need to work with the higher-order polynomials because we can use equivalent lower-order ones instead. This is incredibly useful in numerical computations as it can help reduce computational complexity, and makes the Chebyshev polynomials very computationally efficient.\n\nLet's illustarte this with a simple example. Let $N = 2$, then for even $m$ we have\n\n$$\n\\left\\{\\begin{align*}\nT_{4}(x_k) = -T_{0}(x_k) = -1, \\\\\nT_{6}(x_k) = - T_{2}(x_k) = 0, \\\\\nT_{8}(x_k) = - T_{4}(x_k) = 1, \\\\\nT_{10}(x_k) = -T_{6}(x_k) = 0, \\\\\n\\text{etc}.\n\\end{align*}\\right.\n$$\n\nIn the figure below we can see the even polynomials and that indeed $T_{10}(x)$ behaves like $-T_{6}(x)$ which behaves like $T_{2}(x)$ at the roots having value $0$, $T_{8}(x)$ behaves like $-T_{4}(x)$ at the roots with value $1$ as in $T_{0}(x)$, $T_{6}(x)$ behaves like $-T_{2}(x)$ with value $0$, and $T_{4}(x)$ behaves like $-T_{0}(x)$ with value $-1$.\n\n::: {#be218886 .cell execution_count=1}\n``` {.python .cell-code code-fold=\"true\" code-summary=\"Click to expand the code\"}\nfrom typing import Union\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef chebyshev_polynomial(\n n: int, x: Union[float, np.ndarray]\n) -> Union[float, np.ndarray]:\n \"\"\"\n Calculate nth Chebyshev polynomial of the first kind T_n(x).\n\n Args:\n n: Order of polynomial (non-negative integer)\n x: Point(s) at which to evaluate polynomial\n\n Returns:\n Value of T_n(x)\n \"\"\"\n if n < 0:\n raise ValueError(\"Order must be non-negative\")\n\n if n == 0:\n return np.ones_like(x)\n elif n == 1:\n return x\n else:\n t_prev = np.ones_like(x) # T_0\n t_curr = x # T_1\n\n for _ in range(2, n + 1):\n t_next = 2 * x * t_curr - t_prev\n t_prev = t_curr\n t_curr = t_next\n\n return t_curr\n\n\ndef chebyshev_nodes(n):\n \"\"\"Generate n Chebyshev nodes in [-1,1]\"\"\"\n k = np.arange(1, n + 1)\n return np.cos((2 * k - 1) * np.pi / (2 * n))\n\n\nif __name__ == \"__main__\":\n\n x = np.linspace(-1, 1, 1000)\n plt.figure(figsize=(12, 6))\n plt.plot(x, -chebyshev_polynomial(0, x), \"--\", label=f\"-T_{0}(x)\", alpha=0.5)\n for n in [0, 2, 4, 6, 8, 10]:\n y = chebyshev_polynomial(n, x)\n plt.plot(x, y, label=f\"T_{n}(x)\")\n\n # plot nodes for n = 2\n n = 2\n nodes = chebyshev_nodes(n)\n y_nodes = np.cos(n * np.arccos(nodes))\n plt.plot(nodes, np.zeros_like(nodes), \"bo\", label=\"T_2(x) roots\")\n for node in nodes:\n plt.plot([node, node], [-1, 1], \"--\", color=\"gray\", alpha=0.5)\n\n # plt.grid(True)\n # Set aspect ratio to be equal\n # plt.gca().set_aspect('equal', adjustable='box')\n plt.xlabel(\"x\")\n plt.ylabel(\"T_n(x)\")\n plt.title(\"Chebyshev Polynomials Aliasing\")\n plt.legend(loc=\"center left\", bbox_to_anchor=(1, 0.5), fontsize=8)\n plt.xlim(-1.1, 1.1)\n plt.ylim(-1.1, 1.1)\n plt.axhline(y=0, color=\"k\", linestyle=\"-\", alpha=0.7)\n plt.savefig(\n \"content/images/2025-01-06-chebyshev-polynomials/chebyshev_polynomials_aliasing_even.png\"\n )\n plt.show()\n```\n:::\n\n\n\n\nFor odd $m$ we have\n$$\n\\left\\{\\begin{align*}\nT_{3}(x_k) = - T_{1}(x_k) = - x\\\\\nT_{5}(x_k) = - T_{3}(x_k) = x\\\\\nT_{7}(x_k) = - T_{5}(x_k) = -x, \\\\\nT_{9}(x_k) = - T_{7}(x_k) = x, \\\\\n\\text{etc}.\n\\end{align*}\\right.\n$$\n\nIn the figure below we can see the odd polynomials and the aliasing as in the previous example.\n\n::: {#54809f08 .cell execution_count=2}\n``` {.python .cell-code code-fold=\"true\" code-summary=\"Click to expand the code\"}\nfrom typing import Union\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef chebyshev_polynomial(\n n: int, x: Union[float, np.ndarray]\n) -> Union[float, np.ndarray]:\n \"\"\"\n Calculate nth Chebyshev polynomial of the first kind T_n(x).\n\n Args:\n n: Order of polynomial (non-negative integer)\n x: Point(s) at which to evaluate polynomial\n\n Returns:\n Value of T_n(x)\n \"\"\"\n if n < 0:\n raise ValueError(\"Order must be non-negative\")\n\n if n == 0:\n return np.ones_like(x)\n elif n == 1:\n return x\n else:\n t_prev = np.ones_like(x) # T_0\n t_curr = x # T_1\n\n for _ in range(2, n + 1):\n t_next = 2 * x * t_curr - t_prev\n t_prev = t_curr\n t_curr = t_next\n\n return t_curr\n\n\ndef chebyshev_nodes(n):\n \"\"\"Generate n Chebyshev nodes in [-1,1]\"\"\"\n k = np.arange(1, n + 1)\n return np.cos((2 * k - 1) * np.pi / (2 * n))\n\n\nif __name__ == \"__main__\":\n\n x = np.linspace(-1, 1, 1000)\n plt.figure(figsize=(12, 6))\n plt.plot(x, -chebyshev_polynomial(1, x), \"--\", label=f\"-T_{1}(x)\", alpha=0.5)\n for n in [1, 2, 3, 5, 7, 9]:\n y = chebyshev_polynomial(n, x)\n plt.plot(x, y, label=f\"T_{n}(x)\")\n\n # plot nodes for n = 2\n n = 2\n nodes = chebyshev_nodes(n)\n y_nodes = np.cos(n * np.arccos(nodes))\n plt.plot(nodes, np.zeros_like(nodes), \"bo\", label=\"T_2(x) roots\")\n for node in nodes:\n plt.plot([node, node], [-1, 1], \"--\", color=\"gray\", alpha=0.5)\n\n # plt.grid(True)\n # Set aspect ratio to be equal\n # plt.gca().set_aspect('equal', adjustable='box')\n plt.xlabel(\"x\")\n plt.ylabel(\"T_n(x)\")\n plt.title(\"Chebyshev Polynomials Aliasing\")\n plt.legend(loc=\"center left\", bbox_to_anchor=(1, 0.5), fontsize=8)\n plt.xlim(-1.1, 1.1)\n plt.ylim(-1.1, 1.1)\n plt.axhline(y=0, color=\"k\", linestyle=\"-\", alpha=0.7)\n plt.savefig(\n \"content/images/2025-01-06-chebyshev-polynomials/chebyshev_polynomials_aliasing_odd.png\"\n )\n plt.show()\n```\n:::\n\n\n\n\n## Radial Plots\n\nAn interesting plot can be observed by plotting $T_n(x)$ radially. This means that instead of evaluating the polynomials over $[-1, 1]$ in a Cartesian plane we are evaluating them at $\\frac{\\theta}{\\pi} - 1$, and plotting $r = n + T_n(\\frac{\\theta}{\\pi} - 1)$ on polar axes. In other words, the input domain has been shifted and extended, and the results are drawn as radial distances $r$ around a circle defined by $\\theta$. This creates a polar visualization where each $n$ produces a distinct spiral-like ornament. We are also filling in the areas between the curves for a visual effect.\n\n::: {#b2db675f .cell execution_count=3}\n``` {.python .cell-code code-fold=\"true\" code-summary=\"Click to expand the code\"}\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom numpy.polynomial.chebyshev import Chebyshev\n\ntheta = np.linspace(0, 2 * np.pi, 2000)\nfig, ax = plt.subplots(subplot_kw={\"projection\": \"polar\"})\n\n# Generate and fill between consecutive curves\nfor n in range(0, 19 * 2, 2):\n r1 = n + Chebyshev([0] * n + [1])(theta / np.pi - 1)\n r2 = (n + 2) + Chebyshev([0] * (n + 2) + [1])(theta / np.pi - 1)\n\n # Create black and white alternating pattern\n if n % 4 == 0:\n ax.fill_between(theta, r1, r2, color=\"black\")\n else:\n ax.fill_between(theta, r1, r2, color=\"white\")\nax.set_title(\"x = t/π - 1\", y=1)\nplt.axis(\"off\")\nplt.show()\n```\n:::\n\n\n{ width=50% }{ width=41% }\n\nMore visualusations can be achieved by doing other domain changes. They can be seen below.\n\n{ width=25% }{ width=25% }{ width=25% }{ width=25% }\n\n{ width=25% }{ width=25% }{ width=25% }{ width=25% }\n\n{ width=25% }{ width=25% }{ width=25% }{ width=25% }\n\nIn a separate post, Chebyshev Polynomials, Part 2, we are going to explore the Chebyshev polynomials of the second kind, and their relations to the polynomials of the first kind.\n\n",
- "supporting": [
- "index_files"
- ],
- "filters": [],
- "includes": {}
- }
-}
\ No newline at end of file
diff --git a/src/.quarto/_freeze/posts/wave-equation/index/execute-results/html.json b/src/.quarto/_freeze/posts/wave-equation/index/execute-results/html.json
deleted file mode 100644
index d68c60e0fdff0ee47c89af5b48572b91157fe993..0000000000000000000000000000000000000000
--- a/src/.quarto/_freeze/posts/wave-equation/index/execute-results/html.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "hash": "acdc50e3128605e35f826beed13579e3",
- "result": {
- "engine": "jupyter",
- "markdown": "---\ntitle: \"Wave Equation\"\nauthor: \"JoJo\"\ndate: \"2024-12-19\"\ncategories: [mathematics, python]\nimage: \"./images/rectangular_membrane_1_animation.gif\"\ndraft: true\n---\n\n\n\n\nPartial differential equations...\n\n# Introduction\n\nLet $u(x, y, t)$ be ...\n \nThe homogenous wave equation is given by\n\n$$\n\\frac{\\partial^2 u}{\\partial t^2} - c^2 (\\frac{\\partial^2 u}{\\partial x^2} + \\frac{\\partial^2 u}{\\partial y^2}) = 0\n$$\n\nor\n\n\\begin{equation}\nu_{tt} - c^2 (u_{xx} + u_{yy}) = 0.\n\\end{equation}\n\n# Physical interpretation\n\nThe wave equation is a simplified model for a vibrating\nstring (𝑛 = 1), membrane (𝑛 = 2), or elastic solid (𝑛 = 3). In these\nphysical interpretations 𝑢(𝑥, 𝑡) represents the displacement in some direction\nof the point 𝑥 at time 𝑡 ≥ 0.\n\n1D and 2D Equations\n\n# Rectangular Membrane\n\nPass\n\n$$\nD := \\{0 < x < a, 0 < y < b\\}\n$$\n\n...\n\n$$\n\\left\\{\\begin{align*}\nu_{tt} - c^2 (u_{xx} + u_{yy}) = 0, (x,y,t) \\in G = D \\times (0, +\\infty), \\\\ \nu|_{t=0} = \\varphi(x, y), u_t |_{t=0} = \\psi(x, y), (x, y) \\in \\bar{D}, \\\\\nu|_{\\partial D} = 0, t \\geq 0.\n\\end{align*}\\right.\n$$\n\n...\n\n$$\n\\varphi(x, y) \\in C^3 (\\bar{D}), \\psi(x, y) \\in C^2 (\\bar{D})\n$$\n\nand ...\n\n$$\n\\varphi |_{\\partial D} = \\varphi_{xx} |_{x = 0} = \\varphi_{xx} |_{x = a} = \\varphi_{yy} |_{y =0} = \\varphi_{yy} |_{y = b} = \\psi |_{\\partial D} = 0.\n$$\n\nSolution... :\n\n$$\nu(x, y, t) = \\sum_{n, m = 1}^{\\infty} \\left(A_{n, m} \\cos{\\sqrt{\\lambda_{n, m}} ct} + B_{n, m} \\sin{\\sqrt{\\lambda_{n, m}} ct} \\right) \\sin{\\frac{\\pi n}{a}} x \\sin{\\frac{\\pi m}{b}} y,\n$$\n\nwhere\n\n$$\n\\lambda_{n, m} = \\left(\\frac{\\pi n}{a} \\right)^2 + \\left(\\frac{\\pi m}{b} \\right)^2.\n$$\n\nFrom the initial conditions it follows\n\n$$\nA_{n, m} = \\frac{4}{ab} \\int_D \\varphi(x, y) \\sin{\\frac{\\pi n}{a}} x \\sin{\\frac{\\pi m}{b}} y \\mathrm{d}x \\mathrm{d}y,\n$$\n\nand\n\n$$\nB_{n, m} = \\frac{4}{abc\\sqrt{\\lambda_{n, m}}} \\int_D \\psi(x, y) \\sin{\\frac{\\pi n}{a}} x \\sin{\\frac{\\pi m}{b}} y \\mathrm{d}x \\mathrm{d}y.\n$$\n\n## Example 1\n\n...\n\n$$\n\\left\\{\\begin{align*}\nu_{tt} - u_{xx} - u_{yy} = 0, 0 < x < \\pi, 0 < y < \\pi, t > 0, \\\\\nu|_{t=0} = \\sin{x} \\sin{y}, u_t |_{t=0} = \\sin{4x} \\sin{3y}, x, y \\in (0, \\pi), \\\\\nu|_{x = 0} = 0, u|_{x = \\pi} = 0, 0 < y < \\pi, t > 0, \\\\\nu|_{y = 0} = 0, u|_{y = \\pi} = 0, 0 < x < \\pi, t > 0.\n\\end{align*}\\right.\n$$\n\nSolution:\n\n$$\nu(x, y, t) = \\sum_{n, m = 1}^{\\infty} \\left(A_{n, m} \\cos{\\sqrt{\\lambda_{n, m}} t} + B_{n, m} \\sin{\\sqrt{\\lambda_{n, m}} t} \\right) \\sin{n} x \\sin{m} y,\n$$\n\nwhere\n\n$$\n\\lambda_{n, m} = n^2 + m^2,\n$$\n\n$$\nA_{n, m} = \\frac{4}{\\pi^2} \\int_0^\\pi \\sin{x} \\sin{nx} \\mathrm{d}x \\int_0^\\pi \\sin{y} \\sin{my} \\mathrm{d}y,\n$$\n\n$$\nB_{n, m} = \\frac{4}{\\pi^2\\sqrt{\\lambda_{n, m}}} \\int_0^\\pi \\sin{4x} \\sin{nx} \\mathrm{d}x \\int_0^\\pi \\sin{3y} \\sin{my} \\mathrm{d}y.\n$$\n\nTherefore, $A_{1, 1} = 1$, $B_{4, 3} = \\frac{1}{5}$, and every other coefficients is equal to $0$. Finally, \n\n$$\nu(x, y, t) = \\cos{\\sqrt{2}t} \\sin{x} \\sin{y} + \\frac{1}{5} \\sin{5t} \\sin{4x} \\sin{3y}.\n$$\n\nFor $t \\in [0, 6]$:\n\nAnimation:\n\n\n\n::: {#596976bd .cell execution_count=1}\n``` {.python .cell-code code-fold=\"true\" code-summary=\"Click to expand the code\"}\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom matplotlib.animation import FuncAnimation\n\n\ndef rectangular_membrane_1(t_max: int = 6):\n t = np.linspace(0, t_max, 100) # Time points for animation\n x = np.linspace(0, np.pi, 51) # x grid\n y = np.linspace(0, np.pi, 51) # y grid\n X, Y = np.meshgrid(x, y)\n\n # Define the solution function\n def solution(x, y, t):\n return (\n np.cos(np.sqrt(2) * t) * np.sin(x) * np.sin(y)\n + np.sin(5 * t) * np.sin(4 * x) * np.sin(3 * y) / 5\n )\n\n # Set up the figure and axis for animation\n fig = plt.figure()\n ax = fig.add_subplot(111, projection=\"3d\")\n ax.set_xlim(0, np.pi)\n ax.set_ylim(0, np.pi)\n ax.set_zlim(-1, 1)\n ax.set_xlabel(\"x\")\n ax.set_ylabel(\"y\")\n ax.set_zlabel(\"u(x,y,t)\")\n ax.set_title(\"Rectangular Membrane\")\n\n # Update function for FuncAnimation\n def update(frame):\n ax.clear() # Clear the previous frame\n Z = solution(X, Y, frame) # Compute the new Z values\n _ = ax.plot_surface(X, Y, Z, cmap=\"viridis\", vmin=-1, vmax=1)\n ax.set_xlim(0, np.pi)\n ax.set_ylim(0, np.pi)\n ax.set_zlim(-1, 1)\n ax.set_xlabel(\"x\")\n ax.set_ylabel(\"y\")\n ax.set_zlabel(\"u(x,y,t)\")\n ax.set_title(\"Rectangular Membrane\")\n\n # Create and save the animation\n anim = FuncAnimation(fig, update, frames=t, interval=50)\n anim.save(\"rectangular_membrane_1_animation.gif\", writer=\"imagemagick\", fps=20)\n\n plt.show()\n```\n:::\n\n\nSnapshots:\n\n{width=33%}{width=33%}{width=33%}\n\n## Example 2\n\n...\n\n$$\n\\left\\{\\begin{align*}\nu_{tt} - \\pi^2 (u_{xx} + u_{yy}) = 0, 0 < x < 1, 0 < y < 2, t > 0, \\\\\nu|_{t=0} = \\cos{\\left(\\left(x + \\frac{1}{2}\\right)\\pi\\right)} \\cos{\\left(\\frac{\\pi}{2}\\left(y + 1\\right)\\right)}, u_t |_{t=0} = 0, 0 \\leq x \\leq 1, 0 \\leq y \\leq 2, \\\\\nu|_{x = 0} = 0, u|_{x = 1} = 0, 0 \\leq y < 2, t \\geq 0, \\\\\nu|_{y = 0} = 0, u|_{y = 2} = 0, 0 \\leq x \\leq 1, t \\geq 0.\n\\end{align*}\\right.\n$$\n\nSolution with Fourier method:\n\n$$\nu(x, y, t) = \\sum_{n, m = 1}^{\\infty} \\left(A_{n, m} \\cos{\\sqrt{\\lambda_{n, m}} t} + B_{n, m} \\sin{\\sqrt{\\lambda_{n, m}} t} \\right) \\sin{\\pi n} x \\sin{\\pi m} y,\n$$\n\nwhere\n\n$$\n\\lambda_{n, m} = \\pi^2 (n^2 + m^2)\n$$\n\nand\n\n$$\nB_{n, m} = 0.\n$$\n\n$$\nA_{n, m} = 2 \\int_{0}^{1} \\cos{\\left(\\left(x + \\frac{1}{2}\\right)\\pi\\right)} \\sin{\\pi nx} \\mathrm{d}x \\int_0^2 \\cos{\\left(\\frac{\\pi}{2}\\left(y + 1\\right)\\right)} \\sin{\\pi my} \\mathrm{d}y.\n$$\n\nVisualising the solution for $t \\in [0, 6]$ with the partial sum\n\n$$\n\\tilde{u}(x, y, t) = \\sum_{n, m = 1}^{30} A_{n, m} \\cos{\\sqrt{\\lambda_{n, m}} t} \\sin{\\pi n} x \\sin{\\pi m} y.\n$$\n\nAnimation:\n\n\n\n::: {#f1605c55 .cell execution_count=2}\n``` {.python .cell-code code-fold=\"true\" code-summary=\"Click to expand the code\"}\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom matplotlib.animation import FuncAnimation\n\n\ndef rectangular_membrane_2(a: float = 1, b: float = 2, c: float = np.pi, tmax: int = 6):\n t = np.linspace(0, tmax, 100) # Time points for animation\n x = np.linspace(0, a, 50) # x grid\n y = np.linspace(0, b, 50) # y grid\n X, Y = np.meshgrid(x, y)\n\n # Define the solution function\n def solution(x, y, t):\n z = 0\n for n in range(1, 31):\n for m in range(1, 31):\n lambda_nm = np.pi**2 * (n**2 / a**2 + m**2 / b**2)\n # Compute the coefficient Anm\n xx = np.linspace(0, a, 100)\n yy = np.linspace(0, b, 100)\n Anm = (\n 4\n * np.trapezoid(\n np.cos(np.pi / 2 + np.pi * xx / a) * np.sin(n * np.pi * xx / a),\n xx,\n )\n * np.trapezoid(\n np.cos(np.pi / 2 + np.pi * yy / b) * np.sin(m * np.pi * yy / b),\n yy,\n )\n / (a * b)\n )\n z += (\n Anm\n * np.cos(c * np.sqrt(lambda_nm) * t)\n * np.sin(n * np.pi * x / a)\n * np.sin(m * np.pi * y / b)\n )\n return z\n\n # Set up the figure and axis for animation\n fig = plt.figure()\n ax = fig.add_subplot(111, projection=\"3d\")\n ax.set_xlim(0, a)\n ax.set_ylim(0, b)\n ax.set_zlim(-1, 1)\n ax.set_xlabel(\"x\")\n ax.set_ylabel(\"y\")\n ax.set_zlabel(\"u(x,y,t)\")\n ax.set_title(\"Rectangular Membrane\")\n\n # Update function for FuncAnimation\n def update(frame):\n ax.clear()\n Z = solution(X, Y, frame) # Compute the new Z values\n ax.plot_surface(X, Y, Z, cmap=\"viridis\", vmin=-1, vmax=1)\n ax.set_xlim(0, a)\n ax.set_ylim(0, b)\n ax.set_zlim(-1, 1)\n ax.set_xlabel(\"x\")\n ax.set_ylabel(\"y\")\n ax.set_zlabel(\"u(x,y,t)\")\n ax.set_title(\"Rectangular Membrane\")\n\n # Create and save the animation\n anim = FuncAnimation(fig, update, frames=t, interval=50)\n anim.save(\"rectangular_membrane_2_animation.gif\", writer=\"imagemagick\", fps=20)\n\n plt.show()\n```\n:::\n\n\nSnapshots:\n\n{width=33%}{width=33%}{width=33%}\n\n# Circular Membrane\n\nPass\n\n$$\n\\left\\{\\begin{align*}\nu_{tt} - \\frac{1}{4} (u_{xx} + u_{yy}) = 0, x^2 + y^2 < 9, t > 0, \\\\ \nu|_{t=0} = (x^2 + y^2) \\sin^3(\\pi \\sqrt{x^2 + y^2}), u_t |_{t=0} = 0, x^2 + y^2 \\leq 9, \\\\\nu|_{x^2 + y^2 = 9} = 0, t \\geq 0.\n\\end{align*}\\right.\n$$\n\nFourier method: Change to polar coordinates\n\n$$\n\\left\\{\\begin{align*}\nx = \\rho \\cos(\\varphi), \\\\\ny = \\rho \\sin(\\varphi)\n\\end{align*}\\right.\n$$\n\n...\n\nThen the function in the first initial condition $u |_{t=0}$ becomes\n\n$$\n\\tau(\\rho) = \\rho^2 \\sin^3(\\pi \\rho)\n$$\n\nwhich is radially symmetric and hence the solution will be also radially symmetric. It is given by\n\n$$\nu(\\rho, t) = \\sum_{m=1}^{\\infty} A_m \\cos{\\frac{a \\mu_m^{(0)}t}{r}} J_0\\left(\\frac{\\mu_m^{(0)}}{r}\\rho\\right),\n$$\n\nwhere\n\n$$\nA_m = \\frac{4}{r^2 J_1^2(\\mu_m^{(0)})} \\int_0^r \\rho^3 \\sin^3(\\pi \\rho) J_0\\left(\\frac{\\mu_m^{(0)}}{r}\\rho\\right) d\\rho,\n$$\n\nand $\\mu_m^{(0)}$ are the positive solutions to $J_0(\\mu) = 0$.\n\n...\n\n\n\n...\n\nAnimation:\n\n\n\n::: {#d8e21121 .cell execution_count=3}\n``` {.python .cell-code code-fold=\"true\" code-summary=\"Click to expand the code\"}\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom matplotlib.animation import FuncAnimation\nfrom scipy.optimize import root_scalar\nfrom scipy.special import jv as besselj\n\n\ndef CircularMembrane(a=0.5, r=3, tmax=30, N=40):\n rho = np.linspace(0, r, 51) # Radial grid points\n phi = np.linspace(0, 2 * np.pi, 51) # Angular grid points\n t = np.linspace(0, tmax, 100) # Time steps\n\n # Find the first 40 positive zeros of the Bessel function J0\n mju = []\n for n in range(1, N + 1):\n zero = root_scalar(\n lambda x: besselj(0, x), bracket=[(n - 1) * np.pi, n * np.pi]\n )\n mju.append(zero.root)\n mju = np.array(mju)\n\n # Define the initial position function\n def tau(rho):\n return rho**2 * np.sin(np.pi * rho) ** 3\n\n # Compute the solution for given R and t\n def solution(R, t):\n y = np.zeros_like(R)\n for m in range(N):\n s = tau(R[0, :]) * R[0, :] * besselj(0, mju[m] * R[0, :] / r)\n A0m = 4 * np.trapezoid(s, R[0, :]) / ((r**2) * (besselj(1, mju[m]) ** 2))\n y += A0m * np.cos(a * mju[m] * t / r) * besselj(0, mju[m] * R / r)\n return y\n\n # Create a grid of points\n R, p = np.meshgrid(rho, phi)\n X = R * np.cos(p)\n Y = R * np.sin(p)\n\n # Set up the figure and axis for animation\n fig = plt.figure()\n ax = fig.add_subplot(111, projection=\"3d\")\n ax.set_xlim(-r, r)\n ax.set_ylim(-r, r)\n ax.set_zlim(-30, 30)\n ax.set_xlabel(\"x\")\n ax.set_ylabel(\"y\")\n ax.set_zlabel(\"u(x,y,t)\")\n ax.set_title(\"Circular Membrane\")\n\n # Update function for animation\n def update(frame):\n ax.clear()\n Z = solution(R, frame)\n ax.plot_surface(X, Y, Z, cmap=\"viridis\", vmin=-30, vmax=30)\n ax.set_xlim(-r, r)\n ax.set_ylim(-r, r)\n ax.set_zlim(-30, 30)\n ax.set_title(\"Circular Membrane\")\n ax.set_xlabel(\"x\")\n ax.set_ylabel(\"y\")\n ax.set_zlabel(\"u(x,y,t)\")\n\n # Create and save the animation\n anim = FuncAnimation(fig, update, frames=t, interval=50)\n anim.save(\"circular_membrane_animation.gif\", writer=\"imagemagick\", fps=20)\n\n plt.show()\n```\n:::\n\n\nSnapshots:\n\n{width=33%}{width=33%}{width=33%}\n\n# References\n\n- [1](https://www.amazon.co.uk/Partial-Differential-Equations-Graduate-Mathematics/dp/1470469421/ref=sr_1_3?crid=2BINQDJ5R7XUB&dib=eyJ2IjoiMSJ9.GgU4uQBUKYO960lL6EjVJjksjFysLhCJKEHP436_saFGnfKf4uvgqyl_3WBjV779K4AwonOY5XnkRxVFCIqqGZCCE3I8YEjIC7mzvLwUa2lBPvByBCoFxTvGhrSKGLiAKlAvTVFSlbwklqyWEj4o852csy80_D3G2Gk9pedHKz22vqyc8UI8HAxWZ1wfu5bNoaqOOEDhy0W2XLaSijLCENnzVXjxTLS5xZkMCXr72G0.NeT6LdhY-WV9xVA26fbGHp37FbAKGo7mLwpV9m_2Rdk&dib_tag=se&keywords=partial+differential+equations&nsdOptOutParam=true&qid=1734133658&sprefix=partial+diff%2Caps%2C129&sr=8-3)\n- [2](https://mathworld.wolfram.com/BesselFunctionoftheFirstKind.html)\n\n",
- "supporting": [
- "index_files"
- ],
- "filters": [],
- "includes": {}
- }
-}
\ No newline at end of file
diff --git a/src/.quarto/_freeze/site_libs/clipboard/clipboard.min.js b/src/.quarto/_freeze/site_libs/clipboard/clipboard.min.js
deleted file mode 100644
index 1103f811ed80f17985ecf61e0d50e3359484244f..0000000000000000000000000000000000000000
--- a/src/.quarto/_freeze/site_libs/clipboard/clipboard.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/*!
- * clipboard.js v2.0.11
- * https://clipboardjs.com/
- *
- * Licensed MIT © Zeno Rocha
- */
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=10?setTimeout((function(){e(r,n,s)}),1):(t.update(),n(s))}}},"./src/filter.js":function(t){t.exports=function(t){return t.handlers.filterStart=t.handlers.filterStart||[],t.handlers.filterComplete=t.handlers.filterComplete||[],function(e){if(t.trigger("filterStart"),t.i=1,t.reset.filter(),void 0===e)t.filtered=!1;else{t.filtered=!0;for(var r=t.items,n=0,s=r.length;nv.page,a=new g(t[s],void 0,n),v.items.push(a),r.push(a)}return v.update(),r}m(t.slice(0),e)}},this.show=function(t,e){return this.i=t,this.page=e,v.update(),v},this.remove=function(t,e,r){for(var n=0,s=0,i=v.items.length;s-1&&r.splice(n,1),v},this.trigger=function(t){for(var e=v.handlers[t].length;e--;)v.handlers[t][e](v);return v},this.reset={filter:function(){for(var t=v.items,e=t.length;e--;)t[e].filtered=!1;return v},search:function(){for(var t=v.items,e=t.length;e--;)t[e].found=!1;return v}},this.update=function(){var t=v.items,e=t.length;v.visibleItems=[],v.matchingItems=[],v.templater.clear();for(var r=0;r=v.i&&v.visibleItems.lengthe},innerWindow:function(t,e,r){return t>=e-r&&t<=e+r},dotted:function(t,e,r,n,s,i,a){return this.dottedLeft(t,e,r,n,s,i)||this.dottedRight(t,e,r,n,s,i,a)},dottedLeft:function(t,e,r,n,s,i){return e==r+1&&!this.innerWindow(e,s,i)&&!this.right(e,n)},dottedRight:function(t,e,r,n,s,i,a){return!t.items[a-1].values().dotted&&(e==n&&!this.innerWindow(e,s,i)&&!this.right(e,n))}};return function(e){var n=new i(t.listContainer.id,{listClass:e.paginationClass||"pagination",item:e.item||" ",valueNames:["page","dotted"],searchClass:"pagination-search-that-is-not-supposed-to-exist",sortClass:"pagination-sort-that-is-not-supposed-to-exist"});s.bind(n.listContainer,"click",(function(e){var r=e.target||e.srcElement,n=t.utils.getAttribute(r,"data-page"),s=t.utils.getAttribute(r,"data-i");s&&t.show((s-1)*n+1,n)})),t.on("updated",(function(){r(n,e)})),r(n,e)}}},"./src/parse.js":function(t,e,r){t.exports=function(t){var e=r("./src/item.js")(t),n=function(r,n){for(var s=0,i=r.length;s0?setTimeout((function(){e(r,s)}),1):(t.update(),t.trigger("parseComplete"))};return t.handlers.parseComplete=t.handlers.parseComplete||[],function(){var e=function(t){for(var e=t.childNodes,r=[],n=0,s=e.length;n]/g.exec(t)){var e=document.createElement("tbody");return e.innerHTML=t,e.firstElementChild}if(-1!==t.indexOf("<")){var r=document.createElement("div");return r.innerHTML=t,r.firstElementChild}}},a=function(e,r,n){var s=void 0,i=function(e){for(var r=0,n=t.valueNames.length;r=1;)t.list.removeChild(t.list.firstChild)},function(){var r;if("function"!=typeof t.item){if(!(r="string"==typeof t.item?-1===t.item.indexOf("<")?document.getElementById(t.item):i(t.item):s()))throw new Error("The list needs to have at least one item on init otherwise you'll have to add a template.");r=n(r,t.valueNames),e=function(){return r.cloneNode(!0)}}else e=function(e){var r=t.item(e);return i(r)}}()};t.exports=function(t){return new e(t)}},"./src/utils/classes.js":function(t,e,r){var n=r("./src/utils/index-of.js"),s=/\s+/;Object.prototype.toString;function i(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}t.exports=function(t){return new i(t)},i.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~n(e,t)||e.push(t),this.el.className=e.join(" "),this},i.prototype.remove=function(t){if(this.list)return this.list.remove(t),this;var e=this.array(),r=n(e,t);return~r&&e.splice(r,1),this.el.className=e.join(" "),this},i.prototype.toggle=function(t,e){return this.list?(void 0!==e?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):(void 0!==e?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},i.prototype.array=function(){var t=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(s);return""===t[0]&&t.shift(),t},i.prototype.has=i.prototype.contains=function(t){return this.list?this.list.contains(t):!!~n(this.array(),t)}},"./src/utils/events.js":function(t,e,r){var n=window.addEventListener?"addEventListener":"attachEvent",s=window.removeEventListener?"removeEventListener":"detachEvent",i="addEventListener"!==n?"on":"",a=r("./src/utils/to-array.js");e.bind=function(t,e,r,s){for(var o=0,l=(t=a(t)).length;o32)return!1;var a=n,o=function(){var t,r={};for(t=0;t=p;b--){var j=o[t.charAt(b-1)];if(C[b]=0===m?(C[b+1]<<1|1)&j:(C[b+1]<<1|1)&j|(v[b+1]|v[b])<<1|1|v[b+1],C[b]&d){var x=l(m,b-1);if(x<=u){if(u=x,!((c=b-1)>a))break;p=Math.max(1,2*a-c)}}}if(l(m+1,a)>u)break;v=C}return!(c<0)}},"./src/utils/get-attribute.js":function(t){t.exports=function(t,e){var r=t.getAttribute&&t.getAttribute(e)||null;if(!r)for(var n=t.attributes,s=n.length,i=0;i=48&&t<=57}function i(t,e){for(var i=(t+="").length,a=(e+="").length,o=0,l=0;o=i&&l=a?-1:l>=a&&o=i?1:i-a}i.caseInsensitive=i.i=function(t,e){return i((""+t).toLowerCase(),(""+e).toLowerCase())},Object.defineProperties(i,{alphabet:{get:function(){return e},set:function(t){r=[];var s=0;if(e=t)for(;s {
- category = atob(category);
- if (categoriesLoaded) {
- activateCategory(category);
- setCategoryHash(category);
- }
-};
-
-window["quarto-listing-loaded"] = () => {
- // Process any existing hash
- const hash = getHash();
-
- if (hash) {
- // If there is a category, switch to that
- if (hash.category) {
- // category hash are URI encoded so we need to decode it before processing
- // so that we can match it with the category element processed in JS
- activateCategory(decodeURIComponent(hash.category));
- }
- // Paginate a specific listing
- const listingIds = Object.keys(window["quarto-listings"]);
- for (const listingId of listingIds) {
- const page = hash[getListingPageKey(listingId)];
- if (page) {
- showPage(listingId, page);
- }
- }
- }
-
- const listingIds = Object.keys(window["quarto-listings"]);
- for (const listingId of listingIds) {
- // The actual list
- const list = window["quarto-listings"][listingId];
-
- // Update the handlers for pagination events
- refreshPaginationHandlers(listingId);
-
- // Render any visible items that need it
- renderVisibleProgressiveImages(list);
-
- // Whenever the list is updated, we also need to
- // attach handlers to the new pagination elements
- // and refresh any newly visible items.
- list.on("updated", function () {
- renderVisibleProgressiveImages(list);
- setTimeout(() => refreshPaginationHandlers(listingId));
-
- // Show or hide the no matching message
- toggleNoMatchingMessage(list);
- });
- }
-};
-
-window.document.addEventListener("DOMContentLoaded", function (_event) {
- // Attach click handlers to categories
- const categoryEls = window.document.querySelectorAll(
- ".quarto-listing-category .category"
- );
-
- for (const categoryEl of categoryEls) {
- // category needs to support non ASCII characters
- const category = decodeURIComponent(
- atob(categoryEl.getAttribute("data-category"))
- );
- categoryEl.onclick = () => {
- activateCategory(category);
- setCategoryHash(category);
- };
- }
-
- // Attach a click handler to the category title
- // (there should be only one, but since it is a class name, handle N)
- const categoryTitleEls = window.document.querySelectorAll(
- ".quarto-listing-category-title"
- );
- for (const categoryTitleEl of categoryTitleEls) {
- categoryTitleEl.onclick = () => {
- activateCategory("");
- setCategoryHash("");
- };
- }
-
- categoriesLoaded = true;
-});
-
-function toggleNoMatchingMessage(list) {
- const selector = `#${list.listContainer.id} .listing-no-matching`;
- const noMatchingEl = window.document.querySelector(selector);
- if (noMatchingEl) {
- if (list.visibleItems.length === 0) {
- noMatchingEl.classList.remove("d-none");
- } else {
- if (!noMatchingEl.classList.contains("d-none")) {
- noMatchingEl.classList.add("d-none");
- }
- }
- }
-}
-
-function setCategoryHash(category) {
- setHash({ category });
-}
-
-function setPageHash(listingId, page) {
- const currentHash = getHash() || {};
- currentHash[getListingPageKey(listingId)] = page;
- setHash(currentHash);
-}
-
-function getListingPageKey(listingId) {
- return `${listingId}-page`;
-}
-
-function refreshPaginationHandlers(listingId) {
- const listingEl = window.document.getElementById(listingId);
- const paginationEls = listingEl.querySelectorAll(
- ".pagination li.page-item:not(.disabled) .page.page-link"
- );
- for (const paginationEl of paginationEls) {
- paginationEl.onclick = (sender) => {
- setPageHash(listingId, sender.target.getAttribute("data-i"));
- showPage(listingId, sender.target.getAttribute("data-i"));
- return false;
- };
- }
-}
-
-function renderVisibleProgressiveImages(list) {
- // Run through the visible items and render any progressive images
- for (const item of list.visibleItems) {
- const itemEl = item.elm;
- if (itemEl) {
- const progressiveImgs = itemEl.querySelectorAll(
- `img[${kProgressiveAttr}]`
- );
- for (const progressiveImg of progressiveImgs) {
- const srcValue = progressiveImg.getAttribute(kProgressiveAttr);
- if (srcValue) {
- progressiveImg.setAttribute("src", srcValue);
- }
- progressiveImg.removeAttribute(kProgressiveAttr);
- }
- }
- }
-}
-
-function getHash() {
- // Hashes are of the form
- // #name:value|name1:value1|name2:value2
- const currentUrl = new URL(window.location);
- const hashRaw = currentUrl.hash ? currentUrl.hash.slice(1) : undefined;
- return parseHash(hashRaw);
-}
-
-const kAnd = "&";
-const kEquals = "=";
-
-function parseHash(hash) {
- if (!hash) {
- return undefined;
- }
- const hasValuesStrs = hash.split(kAnd);
- const hashValues = hasValuesStrs
- .map((hashValueStr) => {
- const vals = hashValueStr.split(kEquals);
- if (vals.length === 2) {
- return { name: vals[0], value: vals[1] };
- } else {
- return undefined;
- }
- })
- .filter((value) => {
- return value !== undefined;
- });
-
- const hashObj = {};
- hashValues.forEach((hashValue) => {
- hashObj[hashValue.name] = decodeURIComponent(hashValue.value);
- });
- return hashObj;
-}
-
-function makeHash(obj) {
- return Object.keys(obj)
- .map((key) => {
- return `${key}${kEquals}${obj[key]}`;
- })
- .join(kAnd);
-}
-
-function setHash(obj) {
- const hash = makeHash(obj);
- window.history.pushState(null, null, `#${hash}`);
-}
-
-function showPage(listingId, page) {
- const list = window["quarto-listings"][listingId];
- if (list) {
- list.show((page - 1) * list.page + 1, list.page);
- }
-}
-
-function activateCategory(category) {
- // Deactivate existing categories
- const activeEls = window.document.querySelectorAll(
- ".quarto-listing-category .category.active"
- );
- for (const activeEl of activeEls) {
- activeEl.classList.remove("active");
- }
-
- // Activate this category
- const categoryEl = window.document.querySelector(
- `.quarto-listing-category .category[data-category='${btoa(
- encodeURIComponent(category)
- )}']`
- );
- if (categoryEl) {
- categoryEl.classList.add("active");
- }
-
- // Filter the listings to this category
- filterListingCategory(category);
-}
-
-function filterListingCategory(category) {
- const listingIds = Object.keys(window["quarto-listings"]);
- for (const listingId of listingIds) {
- const list = window["quarto-listings"][listingId];
- if (list) {
- if (category === "") {
- // resets the filter
- list.filter();
- } else {
- // filter to this category
- list.filter(function (item) {
- const itemValues = item.values();
- if (itemValues.categories !== null) {
- const categories = decodeURIComponent(
- atob(itemValues.categories)
- ).split(",");
- return categories.includes(category);
- } else {
- return false;
- }
- });
- }
- }
- }
-}
diff --git a/src/.quarto/idx/about.qmd.json b/src/.quarto/idx/about.qmd.json
deleted file mode 100644
index e795e4a3cafcd63b7246c76fcce749eeb512e8b4..0000000000000000000000000000000000000000
--- a/src/.quarto/idx/about.qmd.json
+++ /dev/null
@@ -1 +0,0 @@
-{"title":"About","markdown":{"yaml":{"title":"About","image":"profile.jpg","about":{"template":"jolla","links":[{"icon":"linkedin","text":"LinkedIn","href":"https://www.linkedin.com/in/joana-levtcheva-479844164/"},{"icon":"github","text":"Github","href":"https://github.com/JoeJoe1313"}]}},"containsRefs":false,"markdown":"\n\nAbout this blog\n","srcMarkdownNoYaml":"\n\nAbout this blog\n"},"formats":{"html":{"identifier":{"display-name":"HTML","target-format":"html","base-format":"html"},"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":false,"cache":null,"freeze":true,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":null,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"ipynb-shell-interactivity":null,"plotly-connected":true,"engine":"markdown"},"render":{"keep-tex":false,"keep-typ":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"inline-includes":false,"preserve-yaml":false,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-min-runs":1,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[],"notebook-links":true},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","html-math-method":"mathjax","css":["styles.css"],"output-file":"about.html"},"language":{"toc-title-document":"Table of contents","toc-title-website":"On this page","related-formats-title":"Other Formats","related-notebooks-title":"Notebooks","source-notebooks-prefix":"Source","other-links-title":"Other Links","code-links-title":"Code Links","launch-dev-container-title":"Launch Dev Container","launch-binder-title":"Launch Binder","article-notebook-label":"Article Notebook","notebook-preview-download":"Download Notebook","notebook-preview-download-src":"Download Source","notebook-preview-back":"Back to Article","manuscript-meca-bundle":"MECA Bundle","section-title-abstract":"Abstract","section-title-appendices":"Appendices","section-title-footnotes":"Footnotes","section-title-references":"References","section-title-reuse":"Reuse","section-title-copyright":"Copyright","section-title-citation":"Citation","appendix-attribution-cite-as":"For attribution, please cite this work as:","appendix-attribution-bibtex":"BibTeX citation:","appendix-view-license":"View License","title-block-author-single":"Author","title-block-author-plural":"Authors","title-block-affiliation-single":"Affiliation","title-block-affiliation-plural":"Affiliations","title-block-published":"Published","title-block-modified":"Modified","title-block-keywords":"Keywords","callout-tip-title":"Tip","callout-note-title":"Note","callout-warning-title":"Warning","callout-important-title":"Important","callout-caution-title":"Caution","code-summary":"Code","code-tools-menu-caption":"Code","code-tools-show-all-code":"Show All Code","code-tools-hide-all-code":"Hide All Code","code-tools-view-source":"View Source","code-tools-source-code":"Source Code","tools-share":"Share","tools-download":"Download","code-line":"Line","code-lines":"Lines","copy-button-tooltip":"Copy to Clipboard","copy-button-tooltip-success":"Copied!","repo-action-links-edit":"Edit this page","repo-action-links-source":"View source","repo-action-links-issue":"Report an issue","back-to-top":"Back to top","search-no-results-text":"No results","search-matching-documents-text":"matching documents","search-copy-link-title":"Copy link to search","search-hide-matches-text":"Hide additional matches","search-more-match-text":"more match in this document","search-more-matches-text":"more matches in this document","search-clear-button-title":"Clear","search-text-placeholder":"","search-detached-cancel-button-title":"Cancel","search-submit-button-title":"Submit","search-label":"Search","toggle-section":"Toggle section","toggle-sidebar":"Toggle sidebar navigation","toggle-dark-mode":"Toggle dark mode","toggle-reader-mode":"Toggle reader mode","toggle-navigation":"Toggle navigation","crossref-fig-title":"Figure","crossref-tbl-title":"Table","crossref-lst-title":"Listing","crossref-thm-title":"Theorem","crossref-lem-title":"Lemma","crossref-cor-title":"Corollary","crossref-prp-title":"Proposition","crossref-cnj-title":"Conjecture","crossref-def-title":"Definition","crossref-exm-title":"Example","crossref-exr-title":"Exercise","crossref-ch-prefix":"Chapter","crossref-apx-prefix":"Appendix","crossref-sec-prefix":"Section","crossref-eq-prefix":"Equation","crossref-lof-title":"List of Figures","crossref-lot-title":"List of Tables","crossref-lol-title":"List of Listings","environment-proof-title":"Proof","environment-remark-title":"Remark","environment-solution-title":"Solution","listing-page-order-by":"Order By","listing-page-order-by-default":"Default","listing-page-order-by-date-asc":"Oldest","listing-page-order-by-date-desc":"Newest","listing-page-order-by-number-desc":"High to Low","listing-page-order-by-number-asc":"Low to High","listing-page-field-date":"Date","listing-page-field-title":"Title","listing-page-field-description":"Description","listing-page-field-author":"Author","listing-page-field-filename":"File Name","listing-page-field-filemodified":"Modified","listing-page-field-subtitle":"Subtitle","listing-page-field-readingtime":"Reading Time","listing-page-field-wordcount":"Word Count","listing-page-field-categories":"Categories","listing-page-minutes-compact":"{0} min","listing-page-category-all":"All","listing-page-no-matches":"No matching items","listing-page-words":"{0} words","listing-page-filter":"Filter","draft":"Draft"},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.6.39","theme":"flatly","title":"About","image":"profile.jpg","about":{"template":"jolla","links":[{"icon":"linkedin","text":"LinkedIn","href":"https://www.linkedin.com/in/joana-levtcheva-479844164/"},{"icon":"github","text":"Github","href":"https://github.com/JoeJoe1313"}]}},"extensions":{"book":{"multiFile":true}}}},"projectFormats":["html"]}
\ No newline at end of file
diff --git a/src/.quarto/idx/index.qmd.json b/src/.quarto/idx/index.qmd.json
deleted file mode 100644
index d94958cb82660da2c56a39d375d6c9aa77ea9ea2..0000000000000000000000000000000000000000
--- a/src/.quarto/idx/index.qmd.json
+++ /dev/null
@@ -1 +0,0 @@
-{"title":"quarto-blog","markdown":{"yaml":{"title":"quarto-blog","listing":{"contents":"posts","sort":"date desc","type":"default","categories":true,"sort-ui":false,"filter-ui":false},"page-layout":"full","title-block-banner":true},"containsRefs":false,"markdown":"\n","srcMarkdownNoYaml":"\n"},"formats":{"html":{"identifier":{"display-name":"HTML","target-format":"html","base-format":"html"},"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":false,"cache":null,"freeze":true,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":null,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"ipynb-shell-interactivity":null,"plotly-connected":true,"engine":"markdown"},"render":{"keep-tex":false,"keep-typ":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"inline-includes":false,"preserve-yaml":false,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-min-runs":1,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[],"notebook-links":true},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","html-math-method":"mathjax","css":["styles.css"],"output-file":"index.html"},"language":{"toc-title-document":"Table of contents","toc-title-website":"On this page","related-formats-title":"Other Formats","related-notebooks-title":"Notebooks","source-notebooks-prefix":"Source","other-links-title":"Other Links","code-links-title":"Code Links","launch-dev-container-title":"Launch Dev Container","launch-binder-title":"Launch Binder","article-notebook-label":"Article Notebook","notebook-preview-download":"Download Notebook","notebook-preview-download-src":"Download Source","notebook-preview-back":"Back to Article","manuscript-meca-bundle":"MECA Bundle","section-title-abstract":"Abstract","section-title-appendices":"Appendices","section-title-footnotes":"Footnotes","section-title-references":"References","section-title-reuse":"Reuse","section-title-copyright":"Copyright","section-title-citation":"Citation","appendix-attribution-cite-as":"For attribution, please cite this work as:","appendix-attribution-bibtex":"BibTeX citation:","appendix-view-license":"View License","title-block-author-single":"Author","title-block-author-plural":"Authors","title-block-affiliation-single":"Affiliation","title-block-affiliation-plural":"Affiliations","title-block-published":"Published","title-block-modified":"Modified","title-block-keywords":"Keywords","callout-tip-title":"Tip","callout-note-title":"Note","callout-warning-title":"Warning","callout-important-title":"Important","callout-caution-title":"Caution","code-summary":"Code","code-tools-menu-caption":"Code","code-tools-show-all-code":"Show All Code","code-tools-hide-all-code":"Hide All Code","code-tools-view-source":"View Source","code-tools-source-code":"Source Code","tools-share":"Share","tools-download":"Download","code-line":"Line","code-lines":"Lines","copy-button-tooltip":"Copy to Clipboard","copy-button-tooltip-success":"Copied!","repo-action-links-edit":"Edit this page","repo-action-links-source":"View source","repo-action-links-issue":"Report an issue","back-to-top":"Back to top","search-no-results-text":"No results","search-matching-documents-text":"matching documents","search-copy-link-title":"Copy link to search","search-hide-matches-text":"Hide additional matches","search-more-match-text":"more match in this document","search-more-matches-text":"more matches in this document","search-clear-button-title":"Clear","search-text-placeholder":"","search-detached-cancel-button-title":"Cancel","search-submit-button-title":"Submit","search-label":"Search","toggle-section":"Toggle section","toggle-sidebar":"Toggle sidebar navigation","toggle-dark-mode":"Toggle dark mode","toggle-reader-mode":"Toggle reader mode","toggle-navigation":"Toggle navigation","crossref-fig-title":"Figure","crossref-tbl-title":"Table","crossref-lst-title":"Listing","crossref-thm-title":"Theorem","crossref-lem-title":"Lemma","crossref-cor-title":"Corollary","crossref-prp-title":"Proposition","crossref-cnj-title":"Conjecture","crossref-def-title":"Definition","crossref-exm-title":"Example","crossref-exr-title":"Exercise","crossref-ch-prefix":"Chapter","crossref-apx-prefix":"Appendix","crossref-sec-prefix":"Section","crossref-eq-prefix":"Equation","crossref-lof-title":"List of Figures","crossref-lot-title":"List of Tables","crossref-lol-title":"List of Listings","environment-proof-title":"Proof","environment-remark-title":"Remark","environment-solution-title":"Solution","listing-page-order-by":"Order By","listing-page-order-by-default":"Default","listing-page-order-by-date-asc":"Oldest","listing-page-order-by-date-desc":"Newest","listing-page-order-by-number-desc":"High to Low","listing-page-order-by-number-asc":"Low to High","listing-page-field-date":"Date","listing-page-field-title":"Title","listing-page-field-description":"Description","listing-page-field-author":"Author","listing-page-field-filename":"File Name","listing-page-field-filemodified":"Modified","listing-page-field-subtitle":"Subtitle","listing-page-field-readingtime":"Reading Time","listing-page-field-wordcount":"Word Count","listing-page-field-categories":"Categories","listing-page-minutes-compact":"{0} min","listing-page-category-all":"All","listing-page-no-matches":"No matching items","listing-page-words":"{0} words","listing-page-filter":"Filter","draft":"Draft"},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.6.39","theme":"flatly","title":"quarto-blog","listing":{"contents":"posts","sort":"date desc","type":"default","categories":true,"sort-ui":false,"filter-ui":false},"page-layout":"full","title-block-banner":true},"extensions":{"book":{"multiFile":true}}}},"projectFormats":["html"]}
\ No newline at end of file
diff --git a/src/.quarto/idx/posts/2025-01-04-fourier-method-fixed-string/index.qmd.json b/src/.quarto/idx/posts/2025-01-04-fourier-method-fixed-string/index.qmd.json
deleted file mode 100644
index 7996b78cd27947fdc013b903d45236952b4c94b7..0000000000000000000000000000000000000000
--- a/src/.quarto/idx/posts/2025-01-04-fourier-method-fixed-string/index.qmd.json
+++ /dev/null
@@ -1 +0,0 @@
-{"title":"Fourier Method for the 1D Wave Equation: Fixed String","markdown":{"yaml":{"title":"Fourier Method for the 1D Wave Equation: Fixed String","author":"Joana Levtcheva","date":"2025-01-04","categories":["mathematics","pde"],"draft":false},"headingText":"1D Wave Equation","containsRefs":false,"markdown":"\n\nIn this post we are going to explore the Fourier method for solving the 1D wave equation. The method is more known under the name of the **method of separation of variables**. For the 1D wave equation we are going to show the application of the method to a fixed string. We are also going to attempt to outline some of the physical interpretations of the fixed string.\n\n\nThe 1D wave equation is of the form\n\n$$\nu_{tt} = a^2 u_{xx}.\n$$\n\n## Fixed String\n\nFirst, let's take a look at the model of a string with length $l$ which is also fixed at both ends:\n\n$$\n\\left\\{\\begin{aligned}\nu_{tt} = a^2 u_{xx}, \\\\ \nu(x, 0) = \\varphi_1(x),\\\\\nu_t(x, 0) = \\varphi_2(x), \\\\\nu(0, t) = u(l, t) = 0.\n\\end{aligned}\\right.\n$$\n\nA visualisation of the string can be seen in the figure below.\n\n{width=60%}\n\nWe start solving the equation by taking into account only the boundary conditions $u(0, t) = u(l, t) = 0$. The idea is to find solution $u(x, t)$ of the form\n\n$$\nu(x, t) = X(x)T(t).\n$$\n\nWe substitute this form of the solution into the wave equation and get \n\n$$\n\\frac{1}{a^2} T^{\\prime\\prime}(t)X(x) = T(t)X^{\\prime\\prime}(x),\n$$\n\nfurther divding by $X(x)T(t)$ leads to\n\n$$\n\\frac{1}{a^2} \\frac{T^{\\prime\\prime}(t)}{T(t)} = \\frac{X^{\\prime\\prime}(x)}{X(x)}.\n$$\n\nWe have two functions of independent variables which are equal. This is only possible if they are equal to the same constant. Therefore, let\n\n$$\n\\frac{1}{a^2} \\frac{T^{\\prime\\prime}(t)}{T(t)} = \\frac{X^{\\prime\\prime}(x)}{X(x)} = -\\lambda,\n$$\n\nproducing the following two equeations:\n\n$$\nT^{\\prime\\prime}(t) + a^2 \\lambda T(t) = 0\n$$\n\nand\n\n$$\\label{eq:ref}\nX^{\\prime\\prime}(x) + \\lambda X(x) = 0. \\tag{*}\n$$\n\nLet's begin with solving the second equation. The boundary conditions give\n\n$$\nX(0)T(t) = 0 \\quad \\text{and} \\quad X(l)T(t) = 0.\n$$\n\nBecause we are interested only in non-trivial solutions and thus $T \\neq 0$, we have\n\n$$\\label{eq:ref2}\nX(0) = 0 \\quad \\text{and} \\quad X(l) = 0. \\tag{**}\n$$\n\nNow, we have to find the non-trivial solutions for $X(x)$ satisfying\n\n$$\n\\left\\{\\begin{align*}\nX^{\\prime\\prime}(x) + \\lambda X(x) = 0, \\\\\nX(0) = 0, \\quad X(l) = 0.\n\\end{align*}\\right.\n$$\n\nThe above problem is an example of the so called **Sturm-Liouville problem**. In order to find the general solution of the second order linear homogeneous differential equation with constant coefficients $\\eqref{eq:ref}$ we should solve its characteristic equation\n\n$$\nr^2 + \\lambda = 0.\n$$\n\n- If $\\lambda < 0$, then $r_{1, 2} = \\pm \\sqrt{-\\lambda}$, hence the general solution is\n$$\nX(x) = c_1 e^{\\sqrt{-\\lambda}x} + c_2 e^{-\\sqrt{-\\lambda}x}\n$$\nfor some constants $c_1$ and $c_2$. In order to determine the constants we substitute the above solution into the boundary conditions $\\eqref{eq:ref2}$ and get the system\n$$\n\\left\\{\\begin{align*}\nc_1 + c_2 = 0, \\\\\nc_1 e^{\\sqrt{-\\lambda}l} + c_2 e^{-\\sqrt{-\\lambda}l} = 0. \n\\end{align*}\\right.\n$$\nThis results in $c_1 = c_2 = 0$, meaning our Sturm-Liouville problem doesn't have a non-zero solution for $\\lambda < 0$.\n\n- If $\\lambda = 0$, then $r_1 = r_2 = 0$ and the general solution is\n$$\nX(x) = c_1 + c_2 x.\n$$\nSubstituing it into the boundary conditions $\\eqref{eq:ref2}$ again lead to $c_1 = c_2 = 0$, hence no non-zero solutions of our Sturm-Liouville problem for $\\lambda \\leq 0$.\n\n- If $\\lambda > 0$, then $r_{1, 2} = \\pm i \\sqrt{\\lambda}$, and the general solution becomes\n$$\nX(x) = c_1 \\cos{\\left( \\sqrt{\\lambda} x \\right)} + c_2 \\sin{\\left(\\sqrt{\\lambda}x\\right)}.\n$$\nSubstituting into the boundary conditions $\\eqref{eq:ref2}$ results in\n$$\n\\left\\{\\begin{align*}\nc_1 = 0, \\\\\nc_2 \\sin{\\left(\\sqrt{\\lambda}l\\right)} = 0\n\\end{align*}\\right.\n$$\nIf $c_2 = 0$, then $X(x) \\equiv 0$ which is a trivial solution. Therefore, we set $c_2 \\neq 0$ and hence\n$$\n\\sin{\\left(\\sqrt{\\lambda}l\\right)} = 0,\n$$\ngiving $\\sqrt{\\lambda}l = k \\pi$, $k = \\pm 1, \\pm 2, ...$. Theerfore,\n$$\n\\lambda = \\lambda_k = \\left(\\frac{k \\pi}{l}\\right)^2,\n$$\nmeaning eigenvalues exist when $\\lambda > 0$. The eigenfunctions corresponding to the above eigenvalues are\n$$\nX_k(x) = \\sin{\\left(\\frac{k \\pi x}{l}\\right)}, \\quad k > 0, k \\in N.\n$$\n\nGoing back to $T^{\\prime\\prime}(t) + a^2 \\lambda T(t) = 0$, solving in analogical way, when $\\lambda = \\lambda_k$ the solution becomes\n\n$$\nT_k(t) = A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\n$$\n\nfor some constants $A_k$ and $B_k$. Hence,\n\n$$\nu_k(x,t) = X_k(x) T_k(t) = \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi x}{l}\\right)}, \\quad k > 0, k \\in N\n$$\n\nare solutions to our wave equation, also satisfying the boundary conditions. Since our equation is linear, forming a linear system with its conditions, the **principle of superposition** is valid. In other words, if $u_1, u_2, ..., u_n$ are solutions of our system, then\n\n$$\n\\alpha_1 u_1 + \\alpha_2 u_2 + ... + \\alpha_n u_n\n$$\n\nfor some constants $\\alpha_1, \\alpha_2, ..., \\alpha_n$ is also a solution of the system. But in our case we have an infinite number of functions $u_1, u_2, ...$ which satisfy the linear system. Therefore, we need the **generalised superposition principle** stating that in such case\n\n$$\nu = \\sum_n^{\\infty} \\alpha_n u_n\n$$\n\nfor some arbitrary constants $\\alpha_n$ is a solution to the system if the series converges uniformly and is twice differentiable termwise. This generalisation is a Lemma and should be prooved. The proof can be found in ...\n\nAssuming we have prooved the said Lemma, we can state that our system has a solution of the form\n\n$$\nu(x, t) = \\sum_{k=1}\n^{\\infty} u_k(x, t) = \\sum_{k=1}^{\\infty} \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi x}{l}\\right)}.\n$$\n\nThe next task we have to tackle is to determine the coefficients $A_k$ and $B_k$. We can achieve this by using the initial conditions \n\n$$\nu(x, 0) = \\varphi_1(x), \\quad \\text{and} \\quad u_t(x, 0) = \\varphi_2(x).\n$$\n\nWe get\n\n$$\nu(x, 0) = \\sum_{k=1}\n^{\\infty} A_k \\sin{\\left(\\frac{k \\pi x}{l}\\right)} = \\varphi_1(x)\n$$\n\nand\n\n$$\nu_t(x, 0) = \\sum_{k=1}^{\\infty} \\frac{ak\\pi}{l} B_k \\sin{\\left(\\frac{k \\pi x}{l}\\right)} = \\varphi_2(x).\n$$\n\nNow, we have to expand both $\\varphi_1(x)$ and $\\varphi_2(x)$ into series in terms of sines only (why?). We have\n\n$$\n\\varphi_1(x) = \\sum_{k=1}^{\\infty} \\varphi_k^{(1)} \\sin{\\left(\\frac{k \\pi}{l}x\\right)}\n$$\n\nand\n\n$$\n\\varphi_2(x) = \\sum_{k=1}^{\\infty} \\varphi_k^{(2)} \\sin{\\left(\\frac{k \\pi}{l}x\\right)}.\n$$\n\nBy the Fourier series theroem of uniqueness, we get\n\n$$\nA_k = \\varphi_k^{(1)} \\quad \\text{and} \\quad B_k = \\frac{l}{ak\\pi} \\varphi_k^{(2)},\n$$\n\nor (why?)\n\n$$\nA_k = \\frac{2}{l} \\int_{0}^{l} \\varphi_1(x) \\sin{\\left(\\frac{k \\pi}{l}x\\right)} \\mathrm{d}x\n$$\n\nand\n\n$$\nB_k = \\frac{2}{ak\\pi} \\int_{0}^{l} \\varphi_2(x) \\sin{\\left(\\frac{k \\pi}{l}x\\right)} \\mathrm{d}x.\n$$\n\nWe are left with the task of the covergence of the infinite series. We have to explore the following series\n\n$$\n|u(x, t)| \\leq \\sum_{k=1}^{\\infty}(|A_k| + |B_k|),\n$$\n\n$$\n|u_t(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{ak\\pi}{l}(|A_k| + |B_k|),\n$$\n\n$$\n|u_x(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{k\\pi}{l}(|A_k| + |B_k|),\n$$\n\n$$\n|u_{tt}(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{a^2 k^2 \\pi^2}{l^2}(|A_k| + |B_k|),\n$$\n\n$$\n|u_{xx}(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{k^2 \\pi^2}{l^2}(|A_k| + |B_k|).\n$$\n\nIf the series on the right side (majorizing series) converge then the series on the left would also converge and the needed differentiation would exist. It is enough (why?) for the following series to converge\n\n$$\n\\sum_{k=1}^{\\infty} k^j \\left(|\\varphi_k^{(1)}| + \\frac{2}{ak\\pi}|\\varphi_k^{(2)}|\\right), j = 0, 1, 2.\n$$\n\nThis is possible only if \n\n$$\n\\left\\{\\begin{align*}\n\\sum_{k=1}^{\\infty} k^j |\\varphi_k^{(1)}|, \\\\\n\\sum_{k=1}^{\\infty} k^{j-1} |\\varphi_k^{(2)}|,\n\\end{align*}\\right. \\quad j = 0, 1, 2.\n$$\n\nconverge. From Calculus we know (theorem) that if $\\varphi(x)$ is $m$-times differentiable then\n\n$$\n\\sum_{k=1}^{\\infty} k^{m-1} |\\varphi_k|\n$$\n\nconvergres. Therefore, in order for all the majorzing series to converge it is enough $\\varphi_1(x)$ to be $3$-times differentiable, and $\\varphi_2(x)$ to be $2$-times differentiable.\n\nFinally, we should note a few things about the expansion of $\\varphi_1(x)$ and $\\varphi_2(x)$ into sine series. We have to note that in order to do that the function needs to be continued as an odd function which my lead to loss of the regularity of the lower derivatives. Let $\\tilde{\\varphi}_1(x)$ be the continuation of $\\varphi_1(x)$ as an odd function (see the Figure below) defined as\n\n{width=50%}\n\n\n$$\n\\tilde{\\varphi}_1(x) = \\left\\{\\begin{align*}\n\\varphi_1(x), \\quad 0 \\leq x \\leq l, \\\\\n-\\varphi_1(-x), \\quad -l \\leq x \\leq 0.\n\\end{align*}\\right.\n$$\n\nHence, in order for it to be continous and continously differentibale we need to enforce the following condition\n\n$$\n\\varphi_1(0) = \\varphi_1(l) = 0.\n$$\n\nTo summarise, in order for $\\sum_{k=1}^{\\infty} \\varphi_k^{(1)} \\sin{\\left( \\frac{k\\pi}{l}x\\right)}$ to converge in $[0, l]$ it is necessary to enforce the above conditions to have zero values at both ends of the interval. As for the second derivative, if it exists it would be continuous as well. Similarly, for the third derivative to exist we enforce\n\n$$\n\\varphi_1^{\\prime\\prime}(0) = \\varphi_1^{\\prime\\prime}(l) = 0\n$$\n\nand obtain the corresponding necessary condition\n\n$$\n\\varphi_2(0) = \\varphi_2(l) = 0.\n$$\n\nFinally, after these enforced conditions we can conclude that (tehorem)\n\n$$\nu(x, t) = \\sum_{k=1}^{\\infty} \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi x}{l}\\right)}\n$$\n\nis a regular solution of the problem.\n\n**Physical interpretation:**\n\nIf we go back to the eigenfunction\n\n$$\nu_k(x,t) = \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi}{l}x\\right)}, \\quad k > 0, k \\in N\n$$\n\nwe can rewrite it as\n\n$$\nu_k(x,t) = \\sqrt{A_k^2 + B_k^2} \\sin{\\left(\\frac{k \\pi}{l}x\\right)} \\sin{\\left(\\frac{ak\\pi}{l}t + \\phi_k\\right)}, \\quad k \\in N,\n$$\n\nwhere\n\n$$\n\\tan{(\\phi_k)} = \\frac{A_k}{B_k}.\n$$\n\nWe can translate this as the points of the string to oscillate at the frequency $\\omega_k = \\frac{ak\\pi}{l}$ with phase $\\phi_k$. The amplitude is dependant on $x$ and is given by\n$$\nF_k = \\sqrt{A_k^2 + B_k^2} \\sin{\\left(\\frac{k\\pi}{l}x\\right)}.\n$$\n\nThe $u_k(x, t)$ waves are called **standing-waves**. Depending on the values of $k$ we have the following scenarios:\n\n- When $k = 1$ there are $2$ motionless points which are the ends of the (fixed) string\n- When $k = 2$ a third moitonless point $x = \\frac{l}{2}$ is added\n\nThese motionless points are called **nodes** of the standing wave. In general, $u_k(x, t)$ has $(k + 1)$ nodes located ate $0, \\frac{1}{k}l, \\frac{2}{k}l, ..., \\frac{k-1}{k}l, l$. The maximum amplitude is achieved in the middle points between two nodes. These points are called **crests**. The fundamental tone, or the lowest tone, has frequency of $\\omega_1 = \\frac{a\\pi}{l}$. The frequencies $\\omega_k$ are called **harmonics**, while the higher tones corresponding to $\\omega_k$, $k = 2, 3, ...$ are called **overtones**. It is quite natural to notice that the higher the value of $k$ the rapidly lower the amplitude of $u_k(x, t)$ becomes. Meaning, the effect from the higher harmonics all combined influences the quality of the sound. The below figure shows the harmonics for $k = 1, 2, 3$.\n\n{width=70%}\n\n### Example\n\nHere, we are going to show an example of a fixed string. We are going to show an animated solution with the help of Python. The fixed string problem is given by\n\n$$\n\\left\\{\\begin{aligned}\nu_{tt} = \\left(\\frac{2}{3}\\right)^2 u_{xx}, \\\\ \nu(x, 0) = \\left\\{\\begin{align*}\n\\sin^3{(\\pi x)}, \\quad 1 \\leq x \\leq3, \\\\\n0, \\quad x \\in R \\backslash [1, 3],\n\\end{align*}\\right.,\\\\\nu_t(x, 0) = 0, \\\\\nu(0, t) = u(\\pi \\sqrt{5}, t) = 0.\n\\end{aligned}\\right.\n$$\n\nUsing the $100$-th partial Fourier sum, below is shown the animated solution for $t \\in [0, 30]$.\n\n```{python}\n#| code-fold: true\n#| code-summary: \"Click to expand the code\"\n{{< include code/fixed_string.py >}}\n```\n\n\n\nTest\n\n```{python}\n#| echo: true\n#| eval: true\n#| fig-format: html\n#| output: true\nimport plotly.io as pio\nimport numpy as np\nimport pandas as pd\nimport plotly.express as px\n\npio.renderers.default = \"plotly_mimetype+notebook_connected\"\n\n# Define constants\nL = np.pi * np.sqrt(5)\na = 2 / 3\ntmax = 30\nx = np.linspace(0, L, 101)\nt = np.linspace(0, tmax, 31) # Fewer points for smoother interaction\n\n\n# Define the initial condition phi(x)\ndef phi(x):\n y = np.zeros_like(x)\n y[(1 < x) & (x < 3)] = np.sin(np.pi * x[(1 < x) & (x < 3)]) ** 3\n return y\n\n\n# Define the initial velocity psi(x)\ndef psi(x):\n return np.zeros_like(x)\n\n\n# Define the Fourier solution for u(x, t)\ndef fourier_u(x, t):\n y = np.zeros_like(x)\n for k in range(1, 101):\n Xk = np.sin(k * np.pi * x / L)\n Ak = (2 / L) * np.trapezoid(phi(x) * Xk, x)\n Bk = (2 / (a * k * np.pi)) * np.trapezoid(psi(x) * Xk, x)\n Tk = Ak * np.cos(a * k * np.pi * t / L) + Bk * np.sin(a * k * np.pi * t / L)\n y += Tk * Xk\n return y\n\n\n# Create animation data\ndata = []\nfor t_val in t:\n y = fourier_u(x, t_val)\n for x_val, y_val in zip(x, y):\n data.append({\"x\": x_val, \"y\": y_val, \"t\": f\"t = {t_val:.2f}\"})\n\n# Create DataFrame and plot\ndf = pd.DataFrame(data)\nfig = px.line(\n df,\n x=\"x\",\n y=\"y\",\n animation_frame=\"t\",\n # title=\"String Motion\",\n labels={\"x\": \"x\", \"y\": \"u(x, t)\"},\n range_x=[-0.06, L + 0.06],\n range_y=[-1.1, 1.1],\n color_discrete_sequence=[\"red\"],\n)\n\n# Add fixed points as black dots\nfixed_points = pd.DataFrame(\n {\n \"x\": [0, L],\n \"y\": [0, 0],\n }\n)\n\nfig.add_scatter(\n x=fixed_points[\"x\"],\n y=fixed_points[\"y\"],\n mode=\"markers\",\n marker=dict(color=\"black\", size=10),\n showlegend=False,\n)\n\nfig.update_layout(\n showlegend=False,\n height=280,\n margin=dict(l=10, r=30, t=30, b=10),\n updatemenus=[\n {\n \"buttons\": [\n {\n \"args\": [\n None,\n {\n \"frame\": {\"duration\": 200, \"redraw\": True},\n \"fromcurrent\": True,\n \"mode\": \"immediate\",\n \"transition\": {\"duration\": 0},\n },\n ],\n \"label\": \"Play\",\n \"method\": \"animate\",\n },\n {\n \"args\": [\n [None],\n {\n \"frame\": {\"duration\": 0, \"redraw\": True},\n \"mode\": \"immediate\",\n \"transition\": {\"duration\": 0},\n },\n ],\n \"label\": \"Pause\",\n \"method\": \"animate\",\n },\n ],\n \"type\": \"buttons\",\n \"direction\": \"left\",\n \"showactive\": True,\n \"x\": 0.2,\n \"y\": 0.3,\n \"xanchor\": \"right\",\n \"yanchor\": \"top\",\n }\n ],\n sliders=[\n {\n \"active\": 0,\n \"yanchor\": \"top\",\n \"xanchor\": \"left\",\n \"currentvalue\": {\"font\": {\"size\": 16}, \"visible\": True, \"xanchor\": \"right\"},\n \"transition\": {\"duration\": 500, \"easing\": \"cubic-in-out\"},\n \"pad\": {\"b\": 10, \"t\": 50},\n \"len\": 1,\n \"x\": 0,\n \"y\": 0,\n \"steps\": [\n {\n \"args\": [\n [f\"t = {t:.2f}\"],\n {\n \"frame\": {\n \"duration\": 500,\n \"easing\": \"cubic-in-out\",\n \"redraw\": True,\n },\n \"mode\": \"immediate\",\n \"transition\": {\"duration\": 0},\n },\n ],\n \"label\": f\"{t:.0f}\",\n \"method\": \"animate\",\n }\n for t in t\n ],\n }\n ],\n)\n\nfig.show()\n```\n\n```{python}\n#| eval: true\n#| echo: true\n#| fig-format: html\n#| output: true\nimport plotly.express as px\nimport plotly.io as pio\nimport numpy as np\nimport pandas as pd\nimport plotly.express as px\n\npio.renderers.default = \"plotly_mimetype+notebook_connected\"\n\ndf = px.data.iris()\nfig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\", \n color=\"species\", \n marginal_y=\"violin\", marginal_x=\"box\", \n trendline=\"ols\", template=\"simple_white\")\nfig.show()\n```\n\nTest\n","srcMarkdownNoYaml":"\n\nIn this post we are going to explore the Fourier method for solving the 1D wave equation. The method is more known under the name of the **method of separation of variables**. For the 1D wave equation we are going to show the application of the method to a fixed string. We are also going to attempt to outline some of the physical interpretations of the fixed string.\n\n# 1D Wave Equation\n\nThe 1D wave equation is of the form\n\n$$\nu_{tt} = a^2 u_{xx}.\n$$\n\n## Fixed String\n\nFirst, let's take a look at the model of a string with length $l$ which is also fixed at both ends:\n\n$$\n\\left\\{\\begin{aligned}\nu_{tt} = a^2 u_{xx}, \\\\ \nu(x, 0) = \\varphi_1(x),\\\\\nu_t(x, 0) = \\varphi_2(x), \\\\\nu(0, t) = u(l, t) = 0.\n\\end{aligned}\\right.\n$$\n\nA visualisation of the string can be seen in the figure below.\n\n{width=60%}\n\nWe start solving the equation by taking into account only the boundary conditions $u(0, t) = u(l, t) = 0$. The idea is to find solution $u(x, t)$ of the form\n\n$$\nu(x, t) = X(x)T(t).\n$$\n\nWe substitute this form of the solution into the wave equation and get \n\n$$\n\\frac{1}{a^2} T^{\\prime\\prime}(t)X(x) = T(t)X^{\\prime\\prime}(x),\n$$\n\nfurther divding by $X(x)T(t)$ leads to\n\n$$\n\\frac{1}{a^2} \\frac{T^{\\prime\\prime}(t)}{T(t)} = \\frac{X^{\\prime\\prime}(x)}{X(x)}.\n$$\n\nWe have two functions of independent variables which are equal. This is only possible if they are equal to the same constant. Therefore, let\n\n$$\n\\frac{1}{a^2} \\frac{T^{\\prime\\prime}(t)}{T(t)} = \\frac{X^{\\prime\\prime}(x)}{X(x)} = -\\lambda,\n$$\n\nproducing the following two equeations:\n\n$$\nT^{\\prime\\prime}(t) + a^2 \\lambda T(t) = 0\n$$\n\nand\n\n$$\\label{eq:ref}\nX^{\\prime\\prime}(x) + \\lambda X(x) = 0. \\tag{*}\n$$\n\nLet's begin with solving the second equation. The boundary conditions give\n\n$$\nX(0)T(t) = 0 \\quad \\text{and} \\quad X(l)T(t) = 0.\n$$\n\nBecause we are interested only in non-trivial solutions and thus $T \\neq 0$, we have\n\n$$\\label{eq:ref2}\nX(0) = 0 \\quad \\text{and} \\quad X(l) = 0. \\tag{**}\n$$\n\nNow, we have to find the non-trivial solutions for $X(x)$ satisfying\n\n$$\n\\left\\{\\begin{align*}\nX^{\\prime\\prime}(x) + \\lambda X(x) = 0, \\\\\nX(0) = 0, \\quad X(l) = 0.\n\\end{align*}\\right.\n$$\n\nThe above problem is an example of the so called **Sturm-Liouville problem**. In order to find the general solution of the second order linear homogeneous differential equation with constant coefficients $\\eqref{eq:ref}$ we should solve its characteristic equation\n\n$$\nr^2 + \\lambda = 0.\n$$\n\n- If $\\lambda < 0$, then $r_{1, 2} = \\pm \\sqrt{-\\lambda}$, hence the general solution is\n$$\nX(x) = c_1 e^{\\sqrt{-\\lambda}x} + c_2 e^{-\\sqrt{-\\lambda}x}\n$$\nfor some constants $c_1$ and $c_2$. In order to determine the constants we substitute the above solution into the boundary conditions $\\eqref{eq:ref2}$ and get the system\n$$\n\\left\\{\\begin{align*}\nc_1 + c_2 = 0, \\\\\nc_1 e^{\\sqrt{-\\lambda}l} + c_2 e^{-\\sqrt{-\\lambda}l} = 0. \n\\end{align*}\\right.\n$$\nThis results in $c_1 = c_2 = 0$, meaning our Sturm-Liouville problem doesn't have a non-zero solution for $\\lambda < 0$.\n\n- If $\\lambda = 0$, then $r_1 = r_2 = 0$ and the general solution is\n$$\nX(x) = c_1 + c_2 x.\n$$\nSubstituing it into the boundary conditions $\\eqref{eq:ref2}$ again lead to $c_1 = c_2 = 0$, hence no non-zero solutions of our Sturm-Liouville problem for $\\lambda \\leq 0$.\n\n- If $\\lambda > 0$, then $r_{1, 2} = \\pm i \\sqrt{\\lambda}$, and the general solution becomes\n$$\nX(x) = c_1 \\cos{\\left( \\sqrt{\\lambda} x \\right)} + c_2 \\sin{\\left(\\sqrt{\\lambda}x\\right)}.\n$$\nSubstituting into the boundary conditions $\\eqref{eq:ref2}$ results in\n$$\n\\left\\{\\begin{align*}\nc_1 = 0, \\\\\nc_2 \\sin{\\left(\\sqrt{\\lambda}l\\right)} = 0\n\\end{align*}\\right.\n$$\nIf $c_2 = 0$, then $X(x) \\equiv 0$ which is a trivial solution. Therefore, we set $c_2 \\neq 0$ and hence\n$$\n\\sin{\\left(\\sqrt{\\lambda}l\\right)} = 0,\n$$\ngiving $\\sqrt{\\lambda}l = k \\pi$, $k = \\pm 1, \\pm 2, ...$. Theerfore,\n$$\n\\lambda = \\lambda_k = \\left(\\frac{k \\pi}{l}\\right)^2,\n$$\nmeaning eigenvalues exist when $\\lambda > 0$. The eigenfunctions corresponding to the above eigenvalues are\n$$\nX_k(x) = \\sin{\\left(\\frac{k \\pi x}{l}\\right)}, \\quad k > 0, k \\in N.\n$$\n\nGoing back to $T^{\\prime\\prime}(t) + a^2 \\lambda T(t) = 0$, solving in analogical way, when $\\lambda = \\lambda_k$ the solution becomes\n\n$$\nT_k(t) = A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\n$$\n\nfor some constants $A_k$ and $B_k$. Hence,\n\n$$\nu_k(x,t) = X_k(x) T_k(t) = \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi x}{l}\\right)}, \\quad k > 0, k \\in N\n$$\n\nare solutions to our wave equation, also satisfying the boundary conditions. Since our equation is linear, forming a linear system with its conditions, the **principle of superposition** is valid. In other words, if $u_1, u_2, ..., u_n$ are solutions of our system, then\n\n$$\n\\alpha_1 u_1 + \\alpha_2 u_2 + ... + \\alpha_n u_n\n$$\n\nfor some constants $\\alpha_1, \\alpha_2, ..., \\alpha_n$ is also a solution of the system. But in our case we have an infinite number of functions $u_1, u_2, ...$ which satisfy the linear system. Therefore, we need the **generalised superposition principle** stating that in such case\n\n$$\nu = \\sum_n^{\\infty} \\alpha_n u_n\n$$\n\nfor some arbitrary constants $\\alpha_n$ is a solution to the system if the series converges uniformly and is twice differentiable termwise. This generalisation is a Lemma and should be prooved. The proof can be found in ...\n\nAssuming we have prooved the said Lemma, we can state that our system has a solution of the form\n\n$$\nu(x, t) = \\sum_{k=1}\n^{\\infty} u_k(x, t) = \\sum_{k=1}^{\\infty} \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi x}{l}\\right)}.\n$$\n\nThe next task we have to tackle is to determine the coefficients $A_k$ and $B_k$. We can achieve this by using the initial conditions \n\n$$\nu(x, 0) = \\varphi_1(x), \\quad \\text{and} \\quad u_t(x, 0) = \\varphi_2(x).\n$$\n\nWe get\n\n$$\nu(x, 0) = \\sum_{k=1}\n^{\\infty} A_k \\sin{\\left(\\frac{k \\pi x}{l}\\right)} = \\varphi_1(x)\n$$\n\nand\n\n$$\nu_t(x, 0) = \\sum_{k=1}^{\\infty} \\frac{ak\\pi}{l} B_k \\sin{\\left(\\frac{k \\pi x}{l}\\right)} = \\varphi_2(x).\n$$\n\nNow, we have to expand both $\\varphi_1(x)$ and $\\varphi_2(x)$ into series in terms of sines only (why?). We have\n\n$$\n\\varphi_1(x) = \\sum_{k=1}^{\\infty} \\varphi_k^{(1)} \\sin{\\left(\\frac{k \\pi}{l}x\\right)}\n$$\n\nand\n\n$$\n\\varphi_2(x) = \\sum_{k=1}^{\\infty} \\varphi_k^{(2)} \\sin{\\left(\\frac{k \\pi}{l}x\\right)}.\n$$\n\nBy the Fourier series theroem of uniqueness, we get\n\n$$\nA_k = \\varphi_k^{(1)} \\quad \\text{and} \\quad B_k = \\frac{l}{ak\\pi} \\varphi_k^{(2)},\n$$\n\nor (why?)\n\n$$\nA_k = \\frac{2}{l} \\int_{0}^{l} \\varphi_1(x) \\sin{\\left(\\frac{k \\pi}{l}x\\right)} \\mathrm{d}x\n$$\n\nand\n\n$$\nB_k = \\frac{2}{ak\\pi} \\int_{0}^{l} \\varphi_2(x) \\sin{\\left(\\frac{k \\pi}{l}x\\right)} \\mathrm{d}x.\n$$\n\nWe are left with the task of the covergence of the infinite series. We have to explore the following series\n\n$$\n|u(x, t)| \\leq \\sum_{k=1}^{\\infty}(|A_k| + |B_k|),\n$$\n\n$$\n|u_t(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{ak\\pi}{l}(|A_k| + |B_k|),\n$$\n\n$$\n|u_x(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{k\\pi}{l}(|A_k| + |B_k|),\n$$\n\n$$\n|u_{tt}(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{a^2 k^2 \\pi^2}{l^2}(|A_k| + |B_k|),\n$$\n\n$$\n|u_{xx}(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{k^2 \\pi^2}{l^2}(|A_k| + |B_k|).\n$$\n\nIf the series on the right side (majorizing series) converge then the series on the left would also converge and the needed differentiation would exist. It is enough (why?) for the following series to converge\n\n$$\n\\sum_{k=1}^{\\infty} k^j \\left(|\\varphi_k^{(1)}| + \\frac{2}{ak\\pi}|\\varphi_k^{(2)}|\\right), j = 0, 1, 2.\n$$\n\nThis is possible only if \n\n$$\n\\left\\{\\begin{align*}\n\\sum_{k=1}^{\\infty} k^j |\\varphi_k^{(1)}|, \\\\\n\\sum_{k=1}^{\\infty} k^{j-1} |\\varphi_k^{(2)}|,\n\\end{align*}\\right. \\quad j = 0, 1, 2.\n$$\n\nconverge. From Calculus we know (theorem) that if $\\varphi(x)$ is $m$-times differentiable then\n\n$$\n\\sum_{k=1}^{\\infty} k^{m-1} |\\varphi_k|\n$$\n\nconvergres. Therefore, in order for all the majorzing series to converge it is enough $\\varphi_1(x)$ to be $3$-times differentiable, and $\\varphi_2(x)$ to be $2$-times differentiable.\n\nFinally, we should note a few things about the expansion of $\\varphi_1(x)$ and $\\varphi_2(x)$ into sine series. We have to note that in order to do that the function needs to be continued as an odd function which my lead to loss of the regularity of the lower derivatives. Let $\\tilde{\\varphi}_1(x)$ be the continuation of $\\varphi_1(x)$ as an odd function (see the Figure below) defined as\n\n{width=50%}\n\n\n$$\n\\tilde{\\varphi}_1(x) = \\left\\{\\begin{align*}\n\\varphi_1(x), \\quad 0 \\leq x \\leq l, \\\\\n-\\varphi_1(-x), \\quad -l \\leq x \\leq 0.\n\\end{align*}\\right.\n$$\n\nHence, in order for it to be continous and continously differentibale we need to enforce the following condition\n\n$$\n\\varphi_1(0) = \\varphi_1(l) = 0.\n$$\n\nTo summarise, in order for $\\sum_{k=1}^{\\infty} \\varphi_k^{(1)} \\sin{\\left( \\frac{k\\pi}{l}x\\right)}$ to converge in $[0, l]$ it is necessary to enforce the above conditions to have zero values at both ends of the interval. As for the second derivative, if it exists it would be continuous as well. Similarly, for the third derivative to exist we enforce\n\n$$\n\\varphi_1^{\\prime\\prime}(0) = \\varphi_1^{\\prime\\prime}(l) = 0\n$$\n\nand obtain the corresponding necessary condition\n\n$$\n\\varphi_2(0) = \\varphi_2(l) = 0.\n$$\n\nFinally, after these enforced conditions we can conclude that (tehorem)\n\n$$\nu(x, t) = \\sum_{k=1}^{\\infty} \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi x}{l}\\right)}\n$$\n\nis a regular solution of the problem.\n\n**Physical interpretation:**\n\nIf we go back to the eigenfunction\n\n$$\nu_k(x,t) = \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi}{l}x\\right)}, \\quad k > 0, k \\in N\n$$\n\nwe can rewrite it as\n\n$$\nu_k(x,t) = \\sqrt{A_k^2 + B_k^2} \\sin{\\left(\\frac{k \\pi}{l}x\\right)} \\sin{\\left(\\frac{ak\\pi}{l}t + \\phi_k\\right)}, \\quad k \\in N,\n$$\n\nwhere\n\n$$\n\\tan{(\\phi_k)} = \\frac{A_k}{B_k}.\n$$\n\nWe can translate this as the points of the string to oscillate at the frequency $\\omega_k = \\frac{ak\\pi}{l}$ with phase $\\phi_k$. The amplitude is dependant on $x$ and is given by\n$$\nF_k = \\sqrt{A_k^2 + B_k^2} \\sin{\\left(\\frac{k\\pi}{l}x\\right)}.\n$$\n\nThe $u_k(x, t)$ waves are called **standing-waves**. Depending on the values of $k$ we have the following scenarios:\n\n- When $k = 1$ there are $2$ motionless points which are the ends of the (fixed) string\n- When $k = 2$ a third moitonless point $x = \\frac{l}{2}$ is added\n\nThese motionless points are called **nodes** of the standing wave. In general, $u_k(x, t)$ has $(k + 1)$ nodes located ate $0, \\frac{1}{k}l, \\frac{2}{k}l, ..., \\frac{k-1}{k}l, l$. The maximum amplitude is achieved in the middle points between two nodes. These points are called **crests**. The fundamental tone, or the lowest tone, has frequency of $\\omega_1 = \\frac{a\\pi}{l}$. The frequencies $\\omega_k$ are called **harmonics**, while the higher tones corresponding to $\\omega_k$, $k = 2, 3, ...$ are called **overtones**. It is quite natural to notice that the higher the value of $k$ the rapidly lower the amplitude of $u_k(x, t)$ becomes. Meaning, the effect from the higher harmonics all combined influences the quality of the sound. The below figure shows the harmonics for $k = 1, 2, 3$.\n\n{width=70%}\n\n### Example\n\nHere, we are going to show an example of a fixed string. We are going to show an animated solution with the help of Python. The fixed string problem is given by\n\n$$\n\\left\\{\\begin{aligned}\nu_{tt} = \\left(\\frac{2}{3}\\right)^2 u_{xx}, \\\\ \nu(x, 0) = \\left\\{\\begin{align*}\n\\sin^3{(\\pi x)}, \\quad 1 \\leq x \\leq3, \\\\\n0, \\quad x \\in R \\backslash [1, 3],\n\\end{align*}\\right.,\\\\\nu_t(x, 0) = 0, \\\\\nu(0, t) = u(\\pi \\sqrt{5}, t) = 0.\n\\end{aligned}\\right.\n$$\n\nUsing the $100$-th partial Fourier sum, below is shown the animated solution for $t \\in [0, 30]$.\n\n```{python}\n#| code-fold: true\n#| code-summary: \"Click to expand the code\"\n{{< include code/fixed_string.py >}}\n```\n\n\n\nTest\n\n```{python}\n#| echo: true\n#| eval: true\n#| fig-format: html\n#| output: true\nimport plotly.io as pio\nimport numpy as np\nimport pandas as pd\nimport plotly.express as px\n\npio.renderers.default = \"plotly_mimetype+notebook_connected\"\n\n# Define constants\nL = np.pi * np.sqrt(5)\na = 2 / 3\ntmax = 30\nx = np.linspace(0, L, 101)\nt = np.linspace(0, tmax, 31) # Fewer points for smoother interaction\n\n\n# Define the initial condition phi(x)\ndef phi(x):\n y = np.zeros_like(x)\n y[(1 < x) & (x < 3)] = np.sin(np.pi * x[(1 < x) & (x < 3)]) ** 3\n return y\n\n\n# Define the initial velocity psi(x)\ndef psi(x):\n return np.zeros_like(x)\n\n\n# Define the Fourier solution for u(x, t)\ndef fourier_u(x, t):\n y = np.zeros_like(x)\n for k in range(1, 101):\n Xk = np.sin(k * np.pi * x / L)\n Ak = (2 / L) * np.trapezoid(phi(x) * Xk, x)\n Bk = (2 / (a * k * np.pi)) * np.trapezoid(psi(x) * Xk, x)\n Tk = Ak * np.cos(a * k * np.pi * t / L) + Bk * np.sin(a * k * np.pi * t / L)\n y += Tk * Xk\n return y\n\n\n# Create animation data\ndata = []\nfor t_val in t:\n y = fourier_u(x, t_val)\n for x_val, y_val in zip(x, y):\n data.append({\"x\": x_val, \"y\": y_val, \"t\": f\"t = {t_val:.2f}\"})\n\n# Create DataFrame and plot\ndf = pd.DataFrame(data)\nfig = px.line(\n df,\n x=\"x\",\n y=\"y\",\n animation_frame=\"t\",\n # title=\"String Motion\",\n labels={\"x\": \"x\", \"y\": \"u(x, t)\"},\n range_x=[-0.06, L + 0.06],\n range_y=[-1.1, 1.1],\n color_discrete_sequence=[\"red\"],\n)\n\n# Add fixed points as black dots\nfixed_points = pd.DataFrame(\n {\n \"x\": [0, L],\n \"y\": [0, 0],\n }\n)\n\nfig.add_scatter(\n x=fixed_points[\"x\"],\n y=fixed_points[\"y\"],\n mode=\"markers\",\n marker=dict(color=\"black\", size=10),\n showlegend=False,\n)\n\nfig.update_layout(\n showlegend=False,\n height=280,\n margin=dict(l=10, r=30, t=30, b=10),\n updatemenus=[\n {\n \"buttons\": [\n {\n \"args\": [\n None,\n {\n \"frame\": {\"duration\": 200, \"redraw\": True},\n \"fromcurrent\": True,\n \"mode\": \"immediate\",\n \"transition\": {\"duration\": 0},\n },\n ],\n \"label\": \"Play\",\n \"method\": \"animate\",\n },\n {\n \"args\": [\n [None],\n {\n \"frame\": {\"duration\": 0, \"redraw\": True},\n \"mode\": \"immediate\",\n \"transition\": {\"duration\": 0},\n },\n ],\n \"label\": \"Pause\",\n \"method\": \"animate\",\n },\n ],\n \"type\": \"buttons\",\n \"direction\": \"left\",\n \"showactive\": True,\n \"x\": 0.2,\n \"y\": 0.3,\n \"xanchor\": \"right\",\n \"yanchor\": \"top\",\n }\n ],\n sliders=[\n {\n \"active\": 0,\n \"yanchor\": \"top\",\n \"xanchor\": \"left\",\n \"currentvalue\": {\"font\": {\"size\": 16}, \"visible\": True, \"xanchor\": \"right\"},\n \"transition\": {\"duration\": 500, \"easing\": \"cubic-in-out\"},\n \"pad\": {\"b\": 10, \"t\": 50},\n \"len\": 1,\n \"x\": 0,\n \"y\": 0,\n \"steps\": [\n {\n \"args\": [\n [f\"t = {t:.2f}\"],\n {\n \"frame\": {\n \"duration\": 500,\n \"easing\": \"cubic-in-out\",\n \"redraw\": True,\n },\n \"mode\": \"immediate\",\n \"transition\": {\"duration\": 0},\n },\n ],\n \"label\": f\"{t:.0f}\",\n \"method\": \"animate\",\n }\n for t in t\n ],\n }\n ],\n)\n\nfig.show()\n```\n\n```{python}\n#| eval: true\n#| echo: true\n#| fig-format: html\n#| output: true\nimport plotly.express as px\nimport plotly.io as pio\nimport numpy as np\nimport pandas as pd\nimport plotly.express as px\n\npio.renderers.default = \"plotly_mimetype+notebook_connected\"\n\ndf = px.data.iris()\nfig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\", \n color=\"species\", \n marginal_y=\"violin\", marginal_x=\"box\", \n trendline=\"ols\", template=\"simple_white\")\nfig.show()\n```\n\nTest\n"},"formats":{"html":{"identifier":{"display-name":"HTML","target-format":"html","base-format":"html"},"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":false,"cache":null,"freeze":true,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":null,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"ipynb-shell-interactivity":null,"plotly-connected":true,"engine":"jupyter"},"render":{"keep-tex":false,"keep-typ":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"inline-includes":false,"preserve-yaml":false,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-min-runs":1,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[],"notebook-links":true},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","html-math-method":"mathjax","css":["../../styles.css"],"output-file":"index.html"},"language":{"toc-title-document":"Table of contents","toc-title-website":"On this page","related-formats-title":"Other Formats","related-notebooks-title":"Notebooks","source-notebooks-prefix":"Source","other-links-title":"Other Links","code-links-title":"Code Links","launch-dev-container-title":"Launch Dev Container","launch-binder-title":"Launch Binder","article-notebook-label":"Article Notebook","notebook-preview-download":"Download Notebook","notebook-preview-download-src":"Download Source","notebook-preview-back":"Back to Article","manuscript-meca-bundle":"MECA Bundle","section-title-abstract":"Abstract","section-title-appendices":"Appendices","section-title-footnotes":"Footnotes","section-title-references":"References","section-title-reuse":"Reuse","section-title-copyright":"Copyright","section-title-citation":"Citation","appendix-attribution-cite-as":"For attribution, please cite this work as:","appendix-attribution-bibtex":"BibTeX citation:","appendix-view-license":"View License","title-block-author-single":"Author","title-block-author-plural":"Authors","title-block-affiliation-single":"Affiliation","title-block-affiliation-plural":"Affiliations","title-block-published":"Published","title-block-modified":"Modified","title-block-keywords":"Keywords","callout-tip-title":"Tip","callout-note-title":"Note","callout-warning-title":"Warning","callout-important-title":"Important","callout-caution-title":"Caution","code-summary":"Code","code-tools-menu-caption":"Code","code-tools-show-all-code":"Show All Code","code-tools-hide-all-code":"Hide All Code","code-tools-view-source":"View Source","code-tools-source-code":"Source Code","tools-share":"Share","tools-download":"Download","code-line":"Line","code-lines":"Lines","copy-button-tooltip":"Copy to Clipboard","copy-button-tooltip-success":"Copied!","repo-action-links-edit":"Edit this page","repo-action-links-source":"View source","repo-action-links-issue":"Report an issue","back-to-top":"Back to top","search-no-results-text":"No results","search-matching-documents-text":"matching documents","search-copy-link-title":"Copy link to search","search-hide-matches-text":"Hide additional matches","search-more-match-text":"more match in this document","search-more-matches-text":"more matches in this document","search-clear-button-title":"Clear","search-text-placeholder":"","search-detached-cancel-button-title":"Cancel","search-submit-button-title":"Submit","search-label":"Search","toggle-section":"Toggle section","toggle-sidebar":"Toggle sidebar navigation","toggle-dark-mode":"Toggle dark mode","toggle-reader-mode":"Toggle reader mode","toggle-navigation":"Toggle navigation","crossref-fig-title":"Figure","crossref-tbl-title":"Table","crossref-lst-title":"Listing","crossref-thm-title":"Theorem","crossref-lem-title":"Lemma","crossref-cor-title":"Corollary","crossref-prp-title":"Proposition","crossref-cnj-title":"Conjecture","crossref-def-title":"Definition","crossref-exm-title":"Example","crossref-exr-title":"Exercise","crossref-ch-prefix":"Chapter","crossref-apx-prefix":"Appendix","crossref-sec-prefix":"Section","crossref-eq-prefix":"Equation","crossref-lof-title":"List of Figures","crossref-lot-title":"List of Tables","crossref-lol-title":"List of Listings","environment-proof-title":"Proof","environment-remark-title":"Remark","environment-solution-title":"Solution","listing-page-order-by":"Order By","listing-page-order-by-default":"Default","listing-page-order-by-date-asc":"Oldest","listing-page-order-by-date-desc":"Newest","listing-page-order-by-number-desc":"High to Low","listing-page-order-by-number-asc":"Low to High","listing-page-field-date":"Date","listing-page-field-title":"Title","listing-page-field-description":"Description","listing-page-field-author":"Author","listing-page-field-filename":"File Name","listing-page-field-filemodified":"Modified","listing-page-field-subtitle":"Subtitle","listing-page-field-readingtime":"Reading Time","listing-page-field-wordcount":"Word Count","listing-page-field-categories":"Categories","listing-page-minutes-compact":"{0} min","listing-page-category-all":"All","listing-page-no-matches":"No matching items","listing-page-words":"{0} words","listing-page-filter":"Filter","draft":"Draft"},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.6.39","theme":"flatly","title-block-banner":true,"title":"Fourier Method for the 1D Wave Equation: Fixed String","author":"Joana Levtcheva","date":"2025-01-04","categories":["mathematics","pde"],"draft":false},"extensions":{"book":{"multiFile":true}}}},"draft":false,"projectFormats":["html"]}
\ No newline at end of file
diff --git a/src/.quarto/idx/posts/2025-01-06-chebyshev-polynomials/index.qmd.json b/src/.quarto/idx/posts/2025-01-06-chebyshev-polynomials/index.qmd.json
deleted file mode 100644
index fb0c67ed3526da9c50b542694b1e4f5b1448bef6..0000000000000000000000000000000000000000
--- a/src/.quarto/idx/posts/2025-01-06-chebyshev-polynomials/index.qmd.json
+++ /dev/null
@@ -1 +0,0 @@
-{"title":"Chebyshev Polynomials: Part 1","markdown":{"yaml":{"title":"Chebyshev Polynomials: Part 1","author":"Joana Levtcheva","date":"2025-01-06","categories":["mathematics","polynomials"],"draft":false},"headingText":"Chebyshev Polynomials of the First Kind","containsRefs":false,"markdown":"\n\nChebyshev polynomials are a sequence of orthogonal polynomials that play a central role in numerical analysis, approximation theory, and applied mathematics. They are named after the Russian mathematician Pafnuty Chebyshev and come in two primary types: Chebyshev polynomials of the first kind ($T_n(x)$) and Chebyshev polynomials of the second kind ($U_n(x)$). In this post we are going to focus on the Chebyshev polynomials of the first kind.\n\n\nThere are many different ways to define the Chebyshev polynomials of the first kind. The one that seems most logical to me and most useful in terms of outlining various properties of the polynomials is\n\n$$\\label{eq:1}\nT_{n}(x) = \\cos{\\left(n \\arccos{x}\\right)}, \\quad x \\in [-1, 1].\\tag{1}\n$$\n\nLooking at \\eqref{eq:1} it is not obvious why $T_{n}(x)$ would be a polynomial. In order to show it is indeed a polynomial let's recall the de Moivre's formula\n\n$$\n\\cos{(n \\theta)} + i\\sin{(n \\theta)} = (\\cos(\\theta) + i \\sin{\\theta})^n.\n$$\n\nWe can apply binomial expansion and take the real part from it to obatin\n\n$$\\label{eq:2}\n\\cos(n \\theta) = \\sum_{k = 0}^{\\frac{n}{2}} C(n, 2k) (-1)^k \\cos^{n - 2k}\\theta \\sin^{2k}{\\theta}. \\tag{2}\n$$\n\nwhere \n\n$$\nC(n, 2k) = \\frac{n!}{(2k)!(n-2k)!}, \\quad n \\geq 2k, k \\in N, n \\in N\n$$ \n\ndenotes the binomal coefficient. We can also notice that\n\n$$\n\\sin^{2k}\\theta = (\\sin^2{\\theta})^k = (1 - \\cos^2{\\theta})^k,\n$$\n\nshowing that \\eqref{eq:2} is a polynomial of $\\cos{\\theta}$ of degree $n$. Now, let\n\n$$\n\\theta = \\arccos{x},\n$$\n\nand by utilising $\\cos{\\left(\\arccos{x}\\right)} = x$ we get\n\n$$\nx = \\cos{\\theta}.\n$$\n\nThis transforms \\eqref{eq:1} to \n\n$$\\label{eq:3}\nT_{n}(\\cos{\\theta}) = \\cos{\\left(n \\theta\\right)} \\tag{3}\n$$\n\nwhich we already showed is a polynomial of degree $n$. From here, because $\\cos(.)$ is an even function, we can note that\n\n$$\nT_{n}(x) = T_{-n}(x) = T_{|n|}(x.)\n$$\n\nFrom \\eqref{eq:3} it is also obvious that the values of $T_n$ in the interval $[-1, 1]$ are bounded in $[-1, 1]$ because of the cosine.\n\n## Chebyshev Nodes of the First Kind\n\nBefore we continue with exploring the roots of the polynomials, let's recall some trigonometry. \n\n---\n\nThe **unit circle** is a circle with a radius of 1, centered at the origin of the Cartesian coordinate system. Below is shown part of the unit circle corresponding to the region from $0$ to $\\frac{\\pi}{2}$.\n\n\n\nThe cosine of an angle $\\theta$ corresponds to the $x$-coordinate of the point where the terminal side of the angle (measured counterclockwise from the positive $x$-axis) intersects the unit circle. In other words, $\\cos(\\theta)$ gives the horizontal distance from the origin to this intersection point. \n\nThe **arccosine** is the inverse function of cosine, and it maps a cosine value back to its corresponding angle in the range $[0, \\pi]$ radians. For a given $x$-coordinate on the unit circle, the arccosine gives the angle $\\theta$ such that $\\cos(\\theta) = x$, meaning\n\n$$\n\\arccos(x) = \\theta, \\quad \\text{where } \\theta \\in [0, \\pi].\n$$\n\nMoreover, a **radian** is defined as the angle subtended at the center of a circle by an arc whose length is equal to the radius of the circle. For any circle, the length of an arc $s$ is given by\n\n$$\ns = r \\cdot \\theta,\n$$\n\nwhere $r$ is the radius of the circle, $\\theta$ is the angle subtended by the arc at the center. This means that on the unit circle the length of the arc equals the measure of the angle in radians because $r = 1$, and hence\n\n$$\ns = \\theta.\n$$\n\n---\n\nNow, let's find the roots of the polynomial $T_{n}(x)$. If we take the definition in \\eqref{eq:1} we have to solve\n\n$$\n\\cos{\\left(n \\arccos{x}\\right)} = 0, k \\in N.\n$$\n\nThe solutions in the interval $(-1, 1)$ are given by\n\n$$\nx_k = \\cos{\\left(\\frac{2k - 1}{2n}\\pi\\right)}, n \\in N, k = 1, 2, ...n.\n$$\n\nThese roots are known as the **Chebyshev nodes of the first kind**, or the **Chebyshev zeros**. If we are working with an arbitrary interval $(a, b)$ the affine transformation \n\n$$\nx_k = \\frac{a + b}{2} + \\frac{b - a}{2}\\cos{\\left(\\frac{2k - 1}{2n}\\pi\\right)}, n \\in N, k = 1, 2, ...n\n$$\n\nis needed. From the cosine properties we can also note that the nodes are symmetric with respect to the midpoint of the interval, and that the extrema of $T_n(x)$ over the interval $[-1, 1]$ alternate between $-1$ and $1$. Also, a very useful fact is that these nodes are used in polynomial interpolation to minimize the **Runge phenomenon**.\n\nIn the figure below we have shown the roots of $T_{8}(x)$ in blue. We have also built the perpendiculars from the roots to their interesction with the upper half of the unit circle, and marked these points in red.\n\n{ width=45% }{ width=45% }\n\nLooking at the figure we can notice that the arc lengths between the red points seem to be of the same length. Let's show that this is indeed the truth.\n\nWe showed the roots are the cosine functions $\\cos{\\left(\\frac{2k - 1}{2n}\\pi\\right)}, n \\in N, k = 1, 2, ...n$. Thus, in the unit circle we have that the length of the corresponding arcs are equal to $\\left( \\frac{2k - 1}{2n}\\pi \\right), n \\in N, k = 1, 2, ...n$. Let's take two red points which are direct neighbours, or in other words let's take two red points corresponding to the randomly chosen $m$ and $m + 1$ roots, $m \\in k = \\{1, 2, ..., n\\}$. If we subtract them we are going to determine the length of the arc between them. We have\n\n$$\n\\frac{2(m + 1) - 1}{2n}\\pi - \\frac{2m - 1}{2n}\\pi = \\frac{\\pi}{n},\n$$\n\nmeaning that between every two nodes the arc length is equal and has a value of $\\frac{\\pi}{n}$. A polynomial of degree $n$ has $n$ roots, which in our case are in the open interval $(-1, 1)$, meaning the arcs corresponding to every two neighbouring roots are $n - 1$, and the two arcs between the $x$-axis and the first and last roots due to the symmetry of roots have lenghts of\n\n$$\n\\frac{1}{2}\\left(\\pi - \\frac{n-1}{n}\\pi\\right) = \\frac{\\pi}{2n}.\n$$\n\n## Recurrence relation\n\nThis is probably a bit out of nowhere, but let's take a look at the following trigonometric identity\n\n$$\\label{eq:4}\n\\cos{\\left((n + 1)\\theta\\right)} + \\cos{\\left((n - 1)\\theta\\right)} = 2 \\cos{(\\theta)} \\cos{(n\\theta)},\\tag{4}\n$$\n\nand show that the left side indeed is equal to the right one. We are going to need the following two fundamental formulas of angle addition in trigonometry\n\n$$\n\\cos{(\\alpha + \\beta)} = \\cos{\\alpha} \\cos{\\beta} - \\sin{\\alpha} \\sin{\\beta},\n$$\n\nand\n\n$$\n\\cos{(\\alpha - \\beta)} = \\cos{\\alpha} \\cos{\\beta} + \\sin{\\alpha} \\sin{\\beta}.\n$$\n\nIn our case we have\n\n$$\n\\cos{\\left((n + 1)\\theta\\right)} = \\cos{\\left(n\\theta + \\theta\\right)} = \\cos{(n\\theta)} \\cos{\\theta} - \\sin{(n\\theta)} \\sin{\\theta},\n$$\n\nand\n\n$$\n\\cos{\\left((n - 1)\\theta\\right)} = \\cos{\\left(n\\theta - \\theta\\right)} = \\cos{(n\\theta)} \\cos{\\theta} + \\sin{(n\\theta)} \\sin{\\theta}.\n$$\n\nAdding the above equations leads to the wanted result.\n\nNow, we can see that the terms of \\eqref{eq:4} are exactly in the form of the right side of \\eqref{eq:1}, \\eqref{eq:3}, hence we get\n\n$$\nT_{n + 1}(x) + T_{n - 1}(x) = 2T_{n}(x)T_{1}(x),\n$$\n\nor we get the useful **recurrence relation**\n\n$$\\label{eq:5}\nT_{n + 1}(x) - 2xT_{n}(x) + T_{n - 1}(x) = 0.\\tag{5}\n$$\n\nThis relation along with adding $T_{0}(x) = 1$ and $T_{1}(x) = x$ is another famous way to define the Chebyshev polynomials of the first kind, or\n\n$$\n\\left\\{\\begin{align*}\nT_{0}(x) = 1, \\\\\nT_{1}(x) = x, \\\\\nT_{n + 1}(x) - 2xT_{n}(x) + T_{n - 1}(x) = 0.\n\\end{align*}\\right.\\label{eq:6}\\tag{6}\n$$\n\nLet's write the first $6$ polynomials by using \\eqref{eq:6}:\n\n$$\n\\left\\{\\begin{align*}\nT_{0}(x) = 1, \\quad \\text{(even)}\\\\\nT_{1}(x) = x, \\quad \\text{(odd)}\\\\\nT_{2}(x) = 2x^2 - 1, \\quad \\text{(even)}\\\\\nT_{3}(x) = 4x^3 - 3x, \\quad \\text{(odd)}\\\\\nT_{4}(x) = 8x^4 - 8x^2 + 1, \\quad \\text{(even)}\\\\\nT_{5}(x) = 16x^5 - 20x^3 + 5x. \\quad \\text{(odd)}\n\\end{align*}\\right.\n$$\n\nWe can notice that\n\n$$\nT_{k}(x) = 2^{k-1}x^k + ...,\n$$\n\nand $T_{k}(x)$ is alternating between an even and an odd polynomial depending on whether $k$ is even or odd respectively.\n\nBefore we continue with some visualisations and more facts, let's mention that an interesting way to represent the recurrence relation \\eqref{eq:5} is via the determinant\n\n$$\nT_{k}(x) = \\det \\begin{bmatrix}\nx & 1 & 0 & \\dots & 0 \\\\\n1 & 2x & 1 & \\ddots & \\vdots \\\\\n0 & 1 & 2x & \\ddots & 0 \\\\\n\\vdots & \\ddots & \\ddots & \\ddots & 1 \\\\\n0 & \\dots & 0 & 1 & 2x\n\\end{bmatrix}.\n$$\n\nNow, let's visualise the first $8$ polynomials.\n\n\n\nBut what can we notice if we stack them together?\n\n\n\nIt is quite obvious that at the roots of the $N$-th Chebyshev polynomial there is an **aliasing** effect, meaning higher order polynomials look like lower order ones. We can formally show it by fixing $N$, at the roots $x_k$ of $T_{N}(x) = 0$, and using the Chebyshev identity\n\n$$\n\\cos{\\left((m + N)\\theta\\right)} + \\cos{\\left((m - N)\\theta\\right)} = 2\\cos{(m\\theta)}\\cos{(N\\theta)},\n$$\n\nor equivalently\n\n$$\nT_{m + N}(x) + T_{m - N}(x) = 2T_{m}(x)T_{N}(x).\n$$\n\nNow, having $T_{N}(x) = 0$ leads to\n\n$$\nT_{m + N}(x) = -T_{m - N}(x).\n$$\n\nIf we consecutevly set $m = N$, $m = 2N$, ..., $m = 6N$, etc. we would get\n\n$$\n\\left\\{\\begin{align*}\nT_{2N}(x_k) = -T_{0}(x_k) = -1, \\\\\nT_{3N}(x_k) = 0, \\\\\nT_{4N}(x_k) = 1, \\\\\nT_{5N}(x_k) = 0, \\\\\nT_{6N}(x_k) = -1, \\\\\n\\text{etc}.\n\\end{align*}\\right.\n$$\n\nWe can safely say that any higher-order Chebyshev polynomial $T_{N}(x)$ can be reduced to a lower-order $j, 0 \\leq j \\leq N$ Chebyshev polynomial at the sample points $x_k$ which are the roots of $T_{N}(x)$. In the figure below we attempt to visualise this statement.\n\n\n\nThe horizontal axis represents the order of Chebyshev polynomials, and the blue wavy line represents a \"folded ribbon\". Think of it as taking the sequence of polynomial orders and folding it back and forth. This folding happens at specific points where higher-order polynomials can be reduced to lower-order ones, which are the red **x** marks showing the sample points: the roots of $T_n(x)$. The key insight is that at these special sample points, we don't need to work with the higher-order polynomials because we can use equivalent lower-order ones instead. This is incredibly useful in numerical computations as it can help reduce computational complexity, and makes the Chebyshev polynomials very computationally efficient.\n\nLet's illustarte this with a simple example. Let $N = 2$, then for even $m$ we have\n\n$$\n\\left\\{\\begin{align*}\nT_{4}(x_k) = -T_{0}(x_k) = -1, \\\\\nT_{6}(x_k) = - T_{2}(x_k) = 0, \\\\\nT_{8}(x_k) = - T_{4}(x_k) = 1, \\\\\nT_{10}(x_k) = -T_{6}(x_k) = 0, \\\\\n\\text{etc}.\n\\end{align*}\\right.\n$$\n\nIn the figure below we can see the even polynomials and that indeed $T_{10}(x)$ behaves like $-T_{6}(x)$ which behaves like $T_{2}(x)$ at the roots having value $0$, $T_{8}(x)$ behaves like $-T_{4}(x)$ at the roots with value $1$ as in $T_{0}(x)$, $T_{6}(x)$ behaves like $-T_{2}(x)$ with value $0$, and $T_{4}(x)$ behaves like $-T_{0}(x)$ with value $-1$.\n\n```{python}\n#| code-fold: true\n#| code-summary: \"Click to expand the code\"\n{{< include code/chebyshev_polynomials_aliasing_even.py >}}\n```\n\n\n\nFor odd $m$ we have\n$$\n\\left\\{\\begin{align*}\nT_{3}(x_k) = - T_{1}(x_k) = - x\\\\\nT_{5}(x_k) = - T_{3}(x_k) = x\\\\\nT_{7}(x_k) = - T_{5}(x_k) = -x, \\\\\nT_{9}(x_k) = - T_{7}(x_k) = x, \\\\\n\\text{etc}.\n\\end{align*}\\right.\n$$\n\nIn the figure below we can see the odd polynomials and the aliasing as in the previous example.\n\n```{python}\n#| code-fold: true\n#| code-summary: \"Click to expand the code\"\n{{< include code/chebyshev_polynomials_aliasing_odd.py >}}\n```\n\n\n\n## Radial Plots\n\nAn interesting plot can be observed by plotting $T_n(x)$ radially. This means that instead of evaluating the polynomials over $[-1, 1]$ in a Cartesian plane we are evaluating them at $\\frac{\\theta}{\\pi} - 1$, and plotting $r = n + T_n(\\frac{\\theta}{\\pi} - 1)$ on polar axes. In other words, the input domain has been shifted and extended, and the results are drawn as radial distances $r$ around a circle defined by $\\theta$. This creates a polar visualization where each $n$ produces a distinct spiral-like ornament. We are also filling in the areas between the curves for a visual effect.\n\n```{python}\n#| code-fold: true\n#| code-summary: \"Click to expand the code\"\n{{< include code/polar_plot.py >}}\n```\n\n{ width=50% }{ width=41% }\n\nMore visualusations can be achieved by doing other domain changes. They can be seen below.\n\n{ width=25% }{ width=25% }{ width=25% }{ width=25% }\n\n{ width=25% }{ width=25% }{ width=25% }{ width=25% }\n\n{ width=25% }{ width=25% }{ width=25% }{ width=25% }\n\nIn a separate post, Chebyshev Polynomials, Part 2, we are going to explore the Chebyshev polynomials of the second kind, and their relations to the polynomials of the first kind.\n","srcMarkdownNoYaml":"\n\nChebyshev polynomials are a sequence of orthogonal polynomials that play a central role in numerical analysis, approximation theory, and applied mathematics. They are named after the Russian mathematician Pafnuty Chebyshev and come in two primary types: Chebyshev polynomials of the first kind ($T_n(x)$) and Chebyshev polynomials of the second kind ($U_n(x)$). In this post we are going to focus on the Chebyshev polynomials of the first kind.\n\n# Chebyshev Polynomials of the First Kind\n\nThere are many different ways to define the Chebyshev polynomials of the first kind. The one that seems most logical to me and most useful in terms of outlining various properties of the polynomials is\n\n$$\\label{eq:1}\nT_{n}(x) = \\cos{\\left(n \\arccos{x}\\right)}, \\quad x \\in [-1, 1].\\tag{1}\n$$\n\nLooking at \\eqref{eq:1} it is not obvious why $T_{n}(x)$ would be a polynomial. In order to show it is indeed a polynomial let's recall the de Moivre's formula\n\n$$\n\\cos{(n \\theta)} + i\\sin{(n \\theta)} = (\\cos(\\theta) + i \\sin{\\theta})^n.\n$$\n\nWe can apply binomial expansion and take the real part from it to obatin\n\n$$\\label{eq:2}\n\\cos(n \\theta) = \\sum_{k = 0}^{\\frac{n}{2}} C(n, 2k) (-1)^k \\cos^{n - 2k}\\theta \\sin^{2k}{\\theta}. \\tag{2}\n$$\n\nwhere \n\n$$\nC(n, 2k) = \\frac{n!}{(2k)!(n-2k)!}, \\quad n \\geq 2k, k \\in N, n \\in N\n$$ \n\ndenotes the binomal coefficient. We can also notice that\n\n$$\n\\sin^{2k}\\theta = (\\sin^2{\\theta})^k = (1 - \\cos^2{\\theta})^k,\n$$\n\nshowing that \\eqref{eq:2} is a polynomial of $\\cos{\\theta}$ of degree $n$. Now, let\n\n$$\n\\theta = \\arccos{x},\n$$\n\nand by utilising $\\cos{\\left(\\arccos{x}\\right)} = x$ we get\n\n$$\nx = \\cos{\\theta}.\n$$\n\nThis transforms \\eqref{eq:1} to \n\n$$\\label{eq:3}\nT_{n}(\\cos{\\theta}) = \\cos{\\left(n \\theta\\right)} \\tag{3}\n$$\n\nwhich we already showed is a polynomial of degree $n$. From here, because $\\cos(.)$ is an even function, we can note that\n\n$$\nT_{n}(x) = T_{-n}(x) = T_{|n|}(x.)\n$$\n\nFrom \\eqref{eq:3} it is also obvious that the values of $T_n$ in the interval $[-1, 1]$ are bounded in $[-1, 1]$ because of the cosine.\n\n## Chebyshev Nodes of the First Kind\n\nBefore we continue with exploring the roots of the polynomials, let's recall some trigonometry. \n\n---\n\nThe **unit circle** is a circle with a radius of 1, centered at the origin of the Cartesian coordinate system. Below is shown part of the unit circle corresponding to the region from $0$ to $\\frac{\\pi}{2}$.\n\n\n\nThe cosine of an angle $\\theta$ corresponds to the $x$-coordinate of the point where the terminal side of the angle (measured counterclockwise from the positive $x$-axis) intersects the unit circle. In other words, $\\cos(\\theta)$ gives the horizontal distance from the origin to this intersection point. \n\nThe **arccosine** is the inverse function of cosine, and it maps a cosine value back to its corresponding angle in the range $[0, \\pi]$ radians. For a given $x$-coordinate on the unit circle, the arccosine gives the angle $\\theta$ such that $\\cos(\\theta) = x$, meaning\n\n$$\n\\arccos(x) = \\theta, \\quad \\text{where } \\theta \\in [0, \\pi].\n$$\n\nMoreover, a **radian** is defined as the angle subtended at the center of a circle by an arc whose length is equal to the radius of the circle. For any circle, the length of an arc $s$ is given by\n\n$$\ns = r \\cdot \\theta,\n$$\n\nwhere $r$ is the radius of the circle, $\\theta$ is the angle subtended by the arc at the center. This means that on the unit circle the length of the arc equals the measure of the angle in radians because $r = 1$, and hence\n\n$$\ns = \\theta.\n$$\n\n---\n\nNow, let's find the roots of the polynomial $T_{n}(x)$. If we take the definition in \\eqref{eq:1} we have to solve\n\n$$\n\\cos{\\left(n \\arccos{x}\\right)} = 0, k \\in N.\n$$\n\nThe solutions in the interval $(-1, 1)$ are given by\n\n$$\nx_k = \\cos{\\left(\\frac{2k - 1}{2n}\\pi\\right)}, n \\in N, k = 1, 2, ...n.\n$$\n\nThese roots are known as the **Chebyshev nodes of the first kind**, or the **Chebyshev zeros**. If we are working with an arbitrary interval $(a, b)$ the affine transformation \n\n$$\nx_k = \\frac{a + b}{2} + \\frac{b - a}{2}\\cos{\\left(\\frac{2k - 1}{2n}\\pi\\right)}, n \\in N, k = 1, 2, ...n\n$$\n\nis needed. From the cosine properties we can also note that the nodes are symmetric with respect to the midpoint of the interval, and that the extrema of $T_n(x)$ over the interval $[-1, 1]$ alternate between $-1$ and $1$. Also, a very useful fact is that these nodes are used in polynomial interpolation to minimize the **Runge phenomenon**.\n\nIn the figure below we have shown the roots of $T_{8}(x)$ in blue. We have also built the perpendiculars from the roots to their interesction with the upper half of the unit circle, and marked these points in red.\n\n{ width=45% }{ width=45% }\n\nLooking at the figure we can notice that the arc lengths between the red points seem to be of the same length. Let's show that this is indeed the truth.\n\nWe showed the roots are the cosine functions $\\cos{\\left(\\frac{2k - 1}{2n}\\pi\\right)}, n \\in N, k = 1, 2, ...n$. Thus, in the unit circle we have that the length of the corresponding arcs are equal to $\\left( \\frac{2k - 1}{2n}\\pi \\right), n \\in N, k = 1, 2, ...n$. Let's take two red points which are direct neighbours, or in other words let's take two red points corresponding to the randomly chosen $m$ and $m + 1$ roots, $m \\in k = \\{1, 2, ..., n\\}$. If we subtract them we are going to determine the length of the arc between them. We have\n\n$$\n\\frac{2(m + 1) - 1}{2n}\\pi - \\frac{2m - 1}{2n}\\pi = \\frac{\\pi}{n},\n$$\n\nmeaning that between every two nodes the arc length is equal and has a value of $\\frac{\\pi}{n}$. A polynomial of degree $n$ has $n$ roots, which in our case are in the open interval $(-1, 1)$, meaning the arcs corresponding to every two neighbouring roots are $n - 1$, and the two arcs between the $x$-axis and the first and last roots due to the symmetry of roots have lenghts of\n\n$$\n\\frac{1}{2}\\left(\\pi - \\frac{n-1}{n}\\pi\\right) = \\frac{\\pi}{2n}.\n$$\n\n## Recurrence relation\n\nThis is probably a bit out of nowhere, but let's take a look at the following trigonometric identity\n\n$$\\label{eq:4}\n\\cos{\\left((n + 1)\\theta\\right)} + \\cos{\\left((n - 1)\\theta\\right)} = 2 \\cos{(\\theta)} \\cos{(n\\theta)},\\tag{4}\n$$\n\nand show that the left side indeed is equal to the right one. We are going to need the following two fundamental formulas of angle addition in trigonometry\n\n$$\n\\cos{(\\alpha + \\beta)} = \\cos{\\alpha} \\cos{\\beta} - \\sin{\\alpha} \\sin{\\beta},\n$$\n\nand\n\n$$\n\\cos{(\\alpha - \\beta)} = \\cos{\\alpha} \\cos{\\beta} + \\sin{\\alpha} \\sin{\\beta}.\n$$\n\nIn our case we have\n\n$$\n\\cos{\\left((n + 1)\\theta\\right)} = \\cos{\\left(n\\theta + \\theta\\right)} = \\cos{(n\\theta)} \\cos{\\theta} - \\sin{(n\\theta)} \\sin{\\theta},\n$$\n\nand\n\n$$\n\\cos{\\left((n - 1)\\theta\\right)} = \\cos{\\left(n\\theta - \\theta\\right)} = \\cos{(n\\theta)} \\cos{\\theta} + \\sin{(n\\theta)} \\sin{\\theta}.\n$$\n\nAdding the above equations leads to the wanted result.\n\nNow, we can see that the terms of \\eqref{eq:4} are exactly in the form of the right side of \\eqref{eq:1}, \\eqref{eq:3}, hence we get\n\n$$\nT_{n + 1}(x) + T_{n - 1}(x) = 2T_{n}(x)T_{1}(x),\n$$\n\nor we get the useful **recurrence relation**\n\n$$\\label{eq:5}\nT_{n + 1}(x) - 2xT_{n}(x) + T_{n - 1}(x) = 0.\\tag{5}\n$$\n\nThis relation along with adding $T_{0}(x) = 1$ and $T_{1}(x) = x$ is another famous way to define the Chebyshev polynomials of the first kind, or\n\n$$\n\\left\\{\\begin{align*}\nT_{0}(x) = 1, \\\\\nT_{1}(x) = x, \\\\\nT_{n + 1}(x) - 2xT_{n}(x) + T_{n - 1}(x) = 0.\n\\end{align*}\\right.\\label{eq:6}\\tag{6}\n$$\n\nLet's write the first $6$ polynomials by using \\eqref{eq:6}:\n\n$$\n\\left\\{\\begin{align*}\nT_{0}(x) = 1, \\quad \\text{(even)}\\\\\nT_{1}(x) = x, \\quad \\text{(odd)}\\\\\nT_{2}(x) = 2x^2 - 1, \\quad \\text{(even)}\\\\\nT_{3}(x) = 4x^3 - 3x, \\quad \\text{(odd)}\\\\\nT_{4}(x) = 8x^4 - 8x^2 + 1, \\quad \\text{(even)}\\\\\nT_{5}(x) = 16x^5 - 20x^3 + 5x. \\quad \\text{(odd)}\n\\end{align*}\\right.\n$$\n\nWe can notice that\n\n$$\nT_{k}(x) = 2^{k-1}x^k + ...,\n$$\n\nand $T_{k}(x)$ is alternating between an even and an odd polynomial depending on whether $k$ is even or odd respectively.\n\nBefore we continue with some visualisations and more facts, let's mention that an interesting way to represent the recurrence relation \\eqref{eq:5} is via the determinant\n\n$$\nT_{k}(x) = \\det \\begin{bmatrix}\nx & 1 & 0 & \\dots & 0 \\\\\n1 & 2x & 1 & \\ddots & \\vdots \\\\\n0 & 1 & 2x & \\ddots & 0 \\\\\n\\vdots & \\ddots & \\ddots & \\ddots & 1 \\\\\n0 & \\dots & 0 & 1 & 2x\n\\end{bmatrix}.\n$$\n\nNow, let's visualise the first $8$ polynomials.\n\n\n\nBut what can we notice if we stack them together?\n\n\n\nIt is quite obvious that at the roots of the $N$-th Chebyshev polynomial there is an **aliasing** effect, meaning higher order polynomials look like lower order ones. We can formally show it by fixing $N$, at the roots $x_k$ of $T_{N}(x) = 0$, and using the Chebyshev identity\n\n$$\n\\cos{\\left((m + N)\\theta\\right)} + \\cos{\\left((m - N)\\theta\\right)} = 2\\cos{(m\\theta)}\\cos{(N\\theta)},\n$$\n\nor equivalently\n\n$$\nT_{m + N}(x) + T_{m - N}(x) = 2T_{m}(x)T_{N}(x).\n$$\n\nNow, having $T_{N}(x) = 0$ leads to\n\n$$\nT_{m + N}(x) = -T_{m - N}(x).\n$$\n\nIf we consecutevly set $m = N$, $m = 2N$, ..., $m = 6N$, etc. we would get\n\n$$\n\\left\\{\\begin{align*}\nT_{2N}(x_k) = -T_{0}(x_k) = -1, \\\\\nT_{3N}(x_k) = 0, \\\\\nT_{4N}(x_k) = 1, \\\\\nT_{5N}(x_k) = 0, \\\\\nT_{6N}(x_k) = -1, \\\\\n\\text{etc}.\n\\end{align*}\\right.\n$$\n\nWe can safely say that any higher-order Chebyshev polynomial $T_{N}(x)$ can be reduced to a lower-order $j, 0 \\leq j \\leq N$ Chebyshev polynomial at the sample points $x_k$ which are the roots of $T_{N}(x)$. In the figure below we attempt to visualise this statement.\n\n\n\nThe horizontal axis represents the order of Chebyshev polynomials, and the blue wavy line represents a \"folded ribbon\". Think of it as taking the sequence of polynomial orders and folding it back and forth. This folding happens at specific points where higher-order polynomials can be reduced to lower-order ones, which are the red **x** marks showing the sample points: the roots of $T_n(x)$. The key insight is that at these special sample points, we don't need to work with the higher-order polynomials because we can use equivalent lower-order ones instead. This is incredibly useful in numerical computations as it can help reduce computational complexity, and makes the Chebyshev polynomials very computationally efficient.\n\nLet's illustarte this with a simple example. Let $N = 2$, then for even $m$ we have\n\n$$\n\\left\\{\\begin{align*}\nT_{4}(x_k) = -T_{0}(x_k) = -1, \\\\\nT_{6}(x_k) = - T_{2}(x_k) = 0, \\\\\nT_{8}(x_k) = - T_{4}(x_k) = 1, \\\\\nT_{10}(x_k) = -T_{6}(x_k) = 0, \\\\\n\\text{etc}.\n\\end{align*}\\right.\n$$\n\nIn the figure below we can see the even polynomials and that indeed $T_{10}(x)$ behaves like $-T_{6}(x)$ which behaves like $T_{2}(x)$ at the roots having value $0$, $T_{8}(x)$ behaves like $-T_{4}(x)$ at the roots with value $1$ as in $T_{0}(x)$, $T_{6}(x)$ behaves like $-T_{2}(x)$ with value $0$, and $T_{4}(x)$ behaves like $-T_{0}(x)$ with value $-1$.\n\n```{python}\n#| code-fold: true\n#| code-summary: \"Click to expand the code\"\n{{< include code/chebyshev_polynomials_aliasing_even.py >}}\n```\n\n\n\nFor odd $m$ we have\n$$\n\\left\\{\\begin{align*}\nT_{3}(x_k) = - T_{1}(x_k) = - x\\\\\nT_{5}(x_k) = - T_{3}(x_k) = x\\\\\nT_{7}(x_k) = - T_{5}(x_k) = -x, \\\\\nT_{9}(x_k) = - T_{7}(x_k) = x, \\\\\n\\text{etc}.\n\\end{align*}\\right.\n$$\n\nIn the figure below we can see the odd polynomials and the aliasing as in the previous example.\n\n```{python}\n#| code-fold: true\n#| code-summary: \"Click to expand the code\"\n{{< include code/chebyshev_polynomials_aliasing_odd.py >}}\n```\n\n\n\n## Radial Plots\n\nAn interesting plot can be observed by plotting $T_n(x)$ radially. This means that instead of evaluating the polynomials over $[-1, 1]$ in a Cartesian plane we are evaluating them at $\\frac{\\theta}{\\pi} - 1$, and plotting $r = n + T_n(\\frac{\\theta}{\\pi} - 1)$ on polar axes. In other words, the input domain has been shifted and extended, and the results are drawn as radial distances $r$ around a circle defined by $\\theta$. This creates a polar visualization where each $n$ produces a distinct spiral-like ornament. We are also filling in the areas between the curves for a visual effect.\n\n```{python}\n#| code-fold: true\n#| code-summary: \"Click to expand the code\"\n{{< include code/polar_plot.py >}}\n```\n\n{ width=50% }{ width=41% }\n\nMore visualusations can be achieved by doing other domain changes. They can be seen below.\n\n{ width=25% }{ width=25% }{ width=25% }{ width=25% }\n\n{ width=25% }{ width=25% }{ width=25% }{ width=25% }\n\n{ width=25% }{ width=25% }{ width=25% }{ width=25% }\n\nIn a separate post, Chebyshev Polynomials, Part 2, we are going to explore the Chebyshev polynomials of the second kind, and their relations to the polynomials of the first kind.\n"},"formats":{"html":{"identifier":{"display-name":"HTML","target-format":"html","base-format":"html"},"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":false,"cache":null,"freeze":true,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":null,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"ipynb-shell-interactivity":null,"plotly-connected":true,"engine":"jupyter"},"render":{"keep-tex":false,"keep-typ":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"inline-includes":false,"preserve-yaml":false,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-min-runs":1,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[],"notebook-links":true},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","html-math-method":"mathjax","css":["../../styles.css"],"output-file":"index.html"},"language":{"toc-title-document":"Table of contents","toc-title-website":"On this page","related-formats-title":"Other Formats","related-notebooks-title":"Notebooks","source-notebooks-prefix":"Source","other-links-title":"Other Links","code-links-title":"Code Links","launch-dev-container-title":"Launch Dev Container","launch-binder-title":"Launch Binder","article-notebook-label":"Article Notebook","notebook-preview-download":"Download Notebook","notebook-preview-download-src":"Download Source","notebook-preview-back":"Back to Article","manuscript-meca-bundle":"MECA Bundle","section-title-abstract":"Abstract","section-title-appendices":"Appendices","section-title-footnotes":"Footnotes","section-title-references":"References","section-title-reuse":"Reuse","section-title-copyright":"Copyright","section-title-citation":"Citation","appendix-attribution-cite-as":"For attribution, please cite this work as:","appendix-attribution-bibtex":"BibTeX citation:","appendix-view-license":"View License","title-block-author-single":"Author","title-block-author-plural":"Authors","title-block-affiliation-single":"Affiliation","title-block-affiliation-plural":"Affiliations","title-block-published":"Published","title-block-modified":"Modified","title-block-keywords":"Keywords","callout-tip-title":"Tip","callout-note-title":"Note","callout-warning-title":"Warning","callout-important-title":"Important","callout-caution-title":"Caution","code-summary":"Code","code-tools-menu-caption":"Code","code-tools-show-all-code":"Show All Code","code-tools-hide-all-code":"Hide All Code","code-tools-view-source":"View Source","code-tools-source-code":"Source Code","tools-share":"Share","tools-download":"Download","code-line":"Line","code-lines":"Lines","copy-button-tooltip":"Copy to Clipboard","copy-button-tooltip-success":"Copied!","repo-action-links-edit":"Edit this page","repo-action-links-source":"View source","repo-action-links-issue":"Report an issue","back-to-top":"Back to top","search-no-results-text":"No results","search-matching-documents-text":"matching documents","search-copy-link-title":"Copy link to search","search-hide-matches-text":"Hide additional matches","search-more-match-text":"more match in this document","search-more-matches-text":"more matches in this document","search-clear-button-title":"Clear","search-text-placeholder":"","search-detached-cancel-button-title":"Cancel","search-submit-button-title":"Submit","search-label":"Search","toggle-section":"Toggle section","toggle-sidebar":"Toggle sidebar navigation","toggle-dark-mode":"Toggle dark mode","toggle-reader-mode":"Toggle reader mode","toggle-navigation":"Toggle navigation","crossref-fig-title":"Figure","crossref-tbl-title":"Table","crossref-lst-title":"Listing","crossref-thm-title":"Theorem","crossref-lem-title":"Lemma","crossref-cor-title":"Corollary","crossref-prp-title":"Proposition","crossref-cnj-title":"Conjecture","crossref-def-title":"Definition","crossref-exm-title":"Example","crossref-exr-title":"Exercise","crossref-ch-prefix":"Chapter","crossref-apx-prefix":"Appendix","crossref-sec-prefix":"Section","crossref-eq-prefix":"Equation","crossref-lof-title":"List of Figures","crossref-lot-title":"List of Tables","crossref-lol-title":"List of Listings","environment-proof-title":"Proof","environment-remark-title":"Remark","environment-solution-title":"Solution","listing-page-order-by":"Order By","listing-page-order-by-default":"Default","listing-page-order-by-date-asc":"Oldest","listing-page-order-by-date-desc":"Newest","listing-page-order-by-number-desc":"High to Low","listing-page-order-by-number-asc":"Low to High","listing-page-field-date":"Date","listing-page-field-title":"Title","listing-page-field-description":"Description","listing-page-field-author":"Author","listing-page-field-filename":"File Name","listing-page-field-filemodified":"Modified","listing-page-field-subtitle":"Subtitle","listing-page-field-readingtime":"Reading Time","listing-page-field-wordcount":"Word Count","listing-page-field-categories":"Categories","listing-page-minutes-compact":"{0} min","listing-page-category-all":"All","listing-page-no-matches":"No matching items","listing-page-words":"{0} words","listing-page-filter":"Filter","draft":"Draft"},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.6.39","theme":"flatly","title-block-banner":true,"title":"Chebyshev Polynomials: Part 1","author":"Joana Levtcheva","date":"2025-01-06","categories":["mathematics","polynomials"],"draft":false},"extensions":{"book":{"multiFile":true}}}},"draft":false,"projectFormats":["html"]}
\ No newline at end of file
diff --git a/src/.quarto/idx/posts/fourier/index.qmd.json b/src/.quarto/idx/posts/fourier/index.qmd.json
deleted file mode 100644
index 452e0039d7d86ca6a5736fa0df00fb7a1a3987ec..0000000000000000000000000000000000000000
--- a/src/.quarto/idx/posts/fourier/index.qmd.json
+++ /dev/null
@@ -1 +0,0 @@
-{"title":"Fourier Method for the Wave Equation","markdown":{"yaml":{"title":"Fourier Method for the Wave Equation","author":"JoJo","date":"2024-12-18","categories":["mathematics"],"image":"membrane.png","draft":true},"headingText":"1D Wave Equation","containsRefs":false,"markdown":"\n\nIn this post we are going to explore the Fourier method for solving the 1D and 2D wave equations. The method is more known under the name of the method of separation of variables. For the 1D wave equation we are going to show the application of the method to a fixed string, and for the 2D wave equation we are going to apply the method to a rectangular membrane and a circular membrane. We are also going to attempt to outline the physical interpretations of all scenarios.\n\n\n## Fixed String\n\nFirst, let's take a look at the model of a string with length $l$ which is also fixed at both ends:\n\n\\begin{equation}\n\\left\\{\\begin{aligned}\nu_{tt} = a^2 u_{xx}, \\\\ \nu(x, 0) = \\varphi_1(x),\\\\\nu_t(x, 0) = \\varphi_2(x), \\\\\nu(0, t) = u(l, t) = 0.\n\\end{aligned}\\right.\n\\end{equation}\n\nWe start solving the equation by taking into account only the boundary conditions $u(0, t) = u(l, t) = 0$. The idea is to find solution $u(x, t)$ of the form\n\n$$\nu(x, t) = X(x)T(t).\n$$\n\nWe substitute this form of the solution into the wave equation and get \n\n$$\n\\frac{1}{a^2} T^{\\prime\\prime}(t)X(x) = T(t)X^{\\prime\\prime}(x),\n$$\n\nfurther divding by $X(x)T(t)$ leads to\n\n$$\n\\frac{1}{a^2} \\frac{T^{\\prime\\prime}(t)}{T(t)} = \\frac{X^{\\prime\\prime}(x)}{X(x)}.\n$$\n\nWe have two functions of independent variables which are equal. This is only possible if they are equal to the same constant. Therefore, let\n\n$$\n\\frac{1}{a^2} \\frac{T^{\\prime\\prime}(t)}{T(t)} = \\frac{X^{\\prime\\prime}(x)}{X(x)} = -\\lambda,\n$$\n\nproducing the following two equeations:\n\n$$\nT^{\\prime\\prime}(t) + a^2 \\lambda T(t) = 0\n$$\n\nand\n\n$$\\label{eq:ref}\nX^{\\prime\\prime}(x) + \\lambda X(x) = 0. \\tag{*}\n$$\n\nLet's begin with solving the second equation. The boundary conditions give\n\n$$\nX(0)T(t) = 0 \\quad \\text{and} \\quad X(l)T(t) = 0.\n$$\n\nBecause we are interested only in non-trivial solutions and thus $T \\neq 0$, we have\n\n$$\\label{eq:ref2}\nX(0) = 0 \\quad \\text{and} \\quad X(l) = 0. \\tag{**}\n$$\n\nNow, we have to find the non-trivial solutions for $X(x)$ satisfying\n\n$$\n\\left\\{\\begin{align*}\nX^{\\prime\\prime}(x) + \\lambda X(x) = 0, \\\\\nX(0) = 0, \\quad X(l) = 0.\n\\end{align*}\\right.\n$$\n\nThe above problem is an example of the so called **Sturm-Liouville problem**. In order to find the general solution of the second order linear homogeneous differential equation with constant coefficients $\\eqref{eq:ref}$ we should solve its characteristic equation\n\n$$\nr^2 + \\lambda = 0.\n$$\n\n- If $\\lambda < 0$, then $r_{1, 2} = \\pm \\sqrt{-\\lambda}$, hence the general solution is\n$$\nX(x) = c_1 e^{\\sqrt{-\\lambda}x} + c_2 e^{-\\sqrt{-\\lambda}x}\n$$\nfor some constants $c_1$ and $c_2$. In order to determine the constants we substitute the above solution into the boundary conditions $\\eqref{eq:ref2}$ and get the system\n$$\n\\left\\{\\begin{align*}\nc_1 + c_2 = 0, \\\\\nc_1 e^{\\sqrt{-\\lambda}l} + c_2 e^{-\\sqrt{-\\lambda}l} = 0. \n\\end{align*}\\right.\n$$\nThis results in $c_1 = c_2 = 0$, meaning our Sturm-Liouville problem doesn't have a non-zero solution for $\\lambda < 0$.\n\n- If $\\lambda = 0$, then $r_1 = r_2 = 0$ and the general solution is\n$$\nX(x) = c_1 + c_2 x.\n$$\nSubstituing it into the boundary conditions $\\eqref{eq:ref2}$ again lead to $c_1 = c_2 = 0$, hence no non-zero solutions of our Sturm-Liouville problem for $\\lambda \\leq 0$.\n\n- If $\\lambda > 0$, then $r_{1, 2} = \\pm i \\sqrt{\\lambda}$, and the general solution becomes\n$$\nX(x) = c_1 \\cos{\\left( \\sqrt{\\lambda} x \\right)} + c_2 \\sin{\\left(\\sqrt{\\lambda}x\\right)}.\n$$\nSubstituting into the boundary conditions $\\eqref{eq:ref2}$ results in\n$$\n\\left\\{\\begin{align*}\nc_1 = 0, \\\\\nc_2 \\sin{\\left(\\sqrt{\\lambda}l\\right)} = 0\n\\end{align*}\\right.\n$$\nIf $c_2 = 0$, then $X(x) \\equiv 0$ which is a trivial solution. Therefore, we set $c_2 \\neq 0$ and hence\n$$\n\\sin{\\left(\\sqrt{\\lambda}l\\right)} = 0,\n$$\ngiving $\\sqrt{\\lambda}l = k \\pi$, $k = \\pm 1, \\pm 2, ...$. Theerfore,\n$$\n\\lambda = \\lambda_k = \\left(\\frac{k \\pi}{l}\\right)^2,\n$$\nmeaning eigenvalues exist when $\\lambda > 0$. The eigenfunctions corresponding to the above eigenvalues are\n$$\nX_k(x) = \\sin{\\left(\\frac{k \\pi x}{l}\\right)}, \\quad k > 0, k \\in N.\n$$\n\nGoing back to $T^{\\prime\\prime}(t) + a^2 \\lambda T(t) = 0$, solving in analogical way, when $\\lambda = \\lambda_k$ the solution becomes\n\n$$\nT_k(t) = A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\n$$\n\nfor some constants $A_k$ and $B_k$. Hence,\n\n$$\nu_k(x,t) = X_k(x) T_k(t) = \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi x}{l}\\right)}, \\quad k > 0, k \\in N\n$$\n\nare solutions to our wave equation, also satisfying the boundary conditions. Since our equation is linear, forming a linear system with its conditions, the **principle of superposition** is valid. In other words, if $u_1, u_2, ..., u_n$ are solutions of our system, then\n\n$$\n\\alpha_1 u_1 + \\alpha_2 u_2 + ... + \\alpha_n u_n\n$$\n\nfor some constants $\\alpha_1, \\alpha_2, ..., \\alpha_n$ is also a solution of the system. But in our case we have an infinite number of functions $u_1, u_2, ...$ which satisfy the linear system. Therefore, we need the **generalised superposition principle** stating that in such case\n\n$$\nu = \\sum_n^{\\infty} \\alpha_n u_n\n$$\n\nfor some arbitrary constants $\\alpha_n$ is a solution to the system if the series converges uniformly and is twice differentiable termwise. This generalisation is a Lemma and should be prooved. The proof can be found in ...\n\nAssuming we have prooved the said Lemma, we can state that our system has a solution of the form\n\n$$\nu(x, t) = \\sum_{k=1}\n^{\\infty} u_k(x, t) = \\sum_{k=1}^{\\infty} \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi x}{l}\\right)}.\n$$\n\nThe next task we have to tackle is to determine the coefficients $A_k$ and $B_k$. We can achieve this by using the initial conditions \n\n$$\nu(x, 0) = \\varphi_1(x), \\quad \\text{and} \\quad u_t(x, 0) = \\varphi_2(x).\n$$\n\nWe get\n\n$$\nu(x, 0) = \\sum_{k=1}\n^{\\infty} A_k \\sin{\\left(\\frac{k \\pi x}{l}\\right)} = \\varphi_1(x)\n$$\n\nand\n\n$$\nu_t(x, 0) = \\sum_{k=1}^{\\infty} \\frac{ak\\pi}{l} B_k \\sin{\\left(\\frac{k \\pi x}{l}\\right)} = \\varphi_2(x).\n$$\n\nNow, we have to expand both $\\varphi_1(x)$ and $\\varphi_2(x)$ into series in terms of sines only (why?). We have\n\n$$\n\\varphi_1(x) = \\sum_{k=1}^{\\infty} \\varphi_k^{(1)} \\sin{\\left(\\frac{k \\pi}{l}x\\right)}\n$$\n\nand\n\n$$\n\\varphi_2(x) = \\sum_{k=1}^{\\infty} \\varphi_k^{(2)} \\sin{\\left(\\frac{k \\pi}{l}x\\right)}.\n$$\n\nBy the Fourier series theroem of uniqueness, we get\n\n$$\nA_k = \\varphi_k^{(1)} \\quad \\text{and} \\quad B_k = \\frac{l}{ak\\pi} \\varphi_k^{(2)},\n$$\n\nor (why?)\n\n$$\nA_k = \\frac{2}{l} \\int_{0}^{l} \\varphi_1(x) \\sin{\\left(\\frac{k \\pi}{l}x\\right)} \\mathrm{d}x\n$$\n\nand\n\n$$\nB_k = \\frac{2}{ak\\pi} \\int_{0}^{l} \\varphi_2(x) \\sin{\\left(\\frac{k \\pi}{l}x\\right)} \\mathrm{d}x.\n$$\n\nWe are left with the task of the covergence of the infinite series. We have to explore the following series\n\n$$\n|u(x, t)| \\leq \\sum_{k=1}^{\\infty}(|A_k| + |B_k|),\n$$\n\n$$\n|u_t(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{ak\\pi}{l}(|A_k| + |B_k|),\n$$\n\n$$\n|u_x(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{k\\pi}{l}(|A_k| + |B_k|),\n$$\n\n$$\n|u_{tt}(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{a^2 k^2 \\pi^2}{l^2}(|A_k| + |B_k|),\n$$\n\n$$\n|u_{xx}(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{k^2 \\pi^2}{l^2}(|A_k| + |B_k|).\n$$\n\nIf the series on the right side (majorizing series) converge then the series on the left would also converge and the needed differentiation would exist. It is enough (why?) for the following series to converge\n\n$$\n\\sum_{k=1}^{\\infty} k^j \\left(|\\varphi_k^{(1)}| + \\frac{2}{ak\\pi}|\\varphi_k^{(2)}|\\right), j = 0, 1, 2.\n$$\n\nThis is possible only if \n\n$$\n\\left\\{\\begin{align*}\n\\sum_{k=1}^{\\infty} k^j |\\varphi_k^{(1)}|, \\\\\n\\sum_{k=1}^{\\infty} k^{j-1} |\\varphi_k^{(2)}|,\n\\end{align*}\\right. \\quad j = 0, 1, 2.\n$$\n\nconverge. From Calculus we know (theorem) that if $\\varphi(x)$ is $m$-times differentiable then\n\n$$\n\\sum_{k=1}^{\\infty} k^{m-1} |\\varphi_k|\n$$\n\nconvergres. Therefore, in order for all the majorzing series to converge it is enough $\\varphi_1(x)$ to be $3$-times differentiable, and $\\varphi_2(x)$ to be $2$-times differentiable.\n\nFinally, we should note a few things about the expansion of $\\varphi_1(x)$ and $\\varphi_2(x)$ into sine series. We have to note that in order to do that the function needs to be continued as an odd function which my lead to loss of the regularity of the lower derivatives. Let $\\tilde{\\varphi}_1(x)$ be the continuation of $\\varphi_1(x)$ as an odd function (see the Figure below) defined as\n\n\n{width=50%}\n \n\n$$\n\\tilde{\\varphi}_1(x) = \\left\\{\\begin{align*}\n\\varphi_1(x), \\quad 0 \\leq x \\leq l, \\\\\n-\\varphi_1(-x), \\quad -l \\leq x \\leq 0.\n\\end{align*}\\right.\n$$\n\nHence, in order for it to be continous and continously differentibale we need to enforce the following condition\n\n$$\n\\varphi_1(0) = \\varphi_1(l) = 0.\n$$\n\nTo summarise, in order for $\\sum_{k=1}^{\\infty} \\varphi_k^{(1)} \\sin{\\left( \\frac{k\\pi}{l}x\\right)}$ to converge in $[0, l]$ it is necessary to enforce the above conditions to have zero values at both ends of the interval. As for the second derivative, if it exists it would be continuous as well. Similarly, for the third derivative to exist we enforce\n\n$$\n\\varphi_1^{\\prime\\prime}(0) = \\varphi_1^{\\prime\\prime}(l) = 0\n$$\n\nand obtain the corresponding necessary condition\n\n$$\n\\varphi_2(0) = \\varphi_2(l) = 0.\n$$\n\nFinally, after these enforced conditions we can conclude that (tehorem)\n\n$$\nu(x, t) = \\sum_{k=1}^{\\infty} \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi x}{l}\\right)}\n$$\n\nis a regular solution of the problem.\n\n**Physical interpretation:** TBD\n\n# 2D Wave Equation\n\n## Rectangular Membrane\n\nTBD\n\n## Circular Membrane\n\nTBD\n","srcMarkdownNoYaml":"\n\nIn this post we are going to explore the Fourier method for solving the 1D and 2D wave equations. The method is more known under the name of the method of separation of variables. For the 1D wave equation we are going to show the application of the method to a fixed string, and for the 2D wave equation we are going to apply the method to a rectangular membrane and a circular membrane. We are also going to attempt to outline the physical interpretations of all scenarios.\n\n# 1D Wave Equation\n\n## Fixed String\n\nFirst, let's take a look at the model of a string with length $l$ which is also fixed at both ends:\n\n\\begin{equation}\n\\left\\{\\begin{aligned}\nu_{tt} = a^2 u_{xx}, \\\\ \nu(x, 0) = \\varphi_1(x),\\\\\nu_t(x, 0) = \\varphi_2(x), \\\\\nu(0, t) = u(l, t) = 0.\n\\end{aligned}\\right.\n\\end{equation}\n\nWe start solving the equation by taking into account only the boundary conditions $u(0, t) = u(l, t) = 0$. The idea is to find solution $u(x, t)$ of the form\n\n$$\nu(x, t) = X(x)T(t).\n$$\n\nWe substitute this form of the solution into the wave equation and get \n\n$$\n\\frac{1}{a^2} T^{\\prime\\prime}(t)X(x) = T(t)X^{\\prime\\prime}(x),\n$$\n\nfurther divding by $X(x)T(t)$ leads to\n\n$$\n\\frac{1}{a^2} \\frac{T^{\\prime\\prime}(t)}{T(t)} = \\frac{X^{\\prime\\prime}(x)}{X(x)}.\n$$\n\nWe have two functions of independent variables which are equal. This is only possible if they are equal to the same constant. Therefore, let\n\n$$\n\\frac{1}{a^2} \\frac{T^{\\prime\\prime}(t)}{T(t)} = \\frac{X^{\\prime\\prime}(x)}{X(x)} = -\\lambda,\n$$\n\nproducing the following two equeations:\n\n$$\nT^{\\prime\\prime}(t) + a^2 \\lambda T(t) = 0\n$$\n\nand\n\n$$\\label{eq:ref}\nX^{\\prime\\prime}(x) + \\lambda X(x) = 0. \\tag{*}\n$$\n\nLet's begin with solving the second equation. The boundary conditions give\n\n$$\nX(0)T(t) = 0 \\quad \\text{and} \\quad X(l)T(t) = 0.\n$$\n\nBecause we are interested only in non-trivial solutions and thus $T \\neq 0$, we have\n\n$$\\label{eq:ref2}\nX(0) = 0 \\quad \\text{and} \\quad X(l) = 0. \\tag{**}\n$$\n\nNow, we have to find the non-trivial solutions for $X(x)$ satisfying\n\n$$\n\\left\\{\\begin{align*}\nX^{\\prime\\prime}(x) + \\lambda X(x) = 0, \\\\\nX(0) = 0, \\quad X(l) = 0.\n\\end{align*}\\right.\n$$\n\nThe above problem is an example of the so called **Sturm-Liouville problem**. In order to find the general solution of the second order linear homogeneous differential equation with constant coefficients $\\eqref{eq:ref}$ we should solve its characteristic equation\n\n$$\nr^2 + \\lambda = 0.\n$$\n\n- If $\\lambda < 0$, then $r_{1, 2} = \\pm \\sqrt{-\\lambda}$, hence the general solution is\n$$\nX(x) = c_1 e^{\\sqrt{-\\lambda}x} + c_2 e^{-\\sqrt{-\\lambda}x}\n$$\nfor some constants $c_1$ and $c_2$. In order to determine the constants we substitute the above solution into the boundary conditions $\\eqref{eq:ref2}$ and get the system\n$$\n\\left\\{\\begin{align*}\nc_1 + c_2 = 0, \\\\\nc_1 e^{\\sqrt{-\\lambda}l} + c_2 e^{-\\sqrt{-\\lambda}l} = 0. \n\\end{align*}\\right.\n$$\nThis results in $c_1 = c_2 = 0$, meaning our Sturm-Liouville problem doesn't have a non-zero solution for $\\lambda < 0$.\n\n- If $\\lambda = 0$, then $r_1 = r_2 = 0$ and the general solution is\n$$\nX(x) = c_1 + c_2 x.\n$$\nSubstituing it into the boundary conditions $\\eqref{eq:ref2}$ again lead to $c_1 = c_2 = 0$, hence no non-zero solutions of our Sturm-Liouville problem for $\\lambda \\leq 0$.\n\n- If $\\lambda > 0$, then $r_{1, 2} = \\pm i \\sqrt{\\lambda}$, and the general solution becomes\n$$\nX(x) = c_1 \\cos{\\left( \\sqrt{\\lambda} x \\right)} + c_2 \\sin{\\left(\\sqrt{\\lambda}x\\right)}.\n$$\nSubstituting into the boundary conditions $\\eqref{eq:ref2}$ results in\n$$\n\\left\\{\\begin{align*}\nc_1 = 0, \\\\\nc_2 \\sin{\\left(\\sqrt{\\lambda}l\\right)} = 0\n\\end{align*}\\right.\n$$\nIf $c_2 = 0$, then $X(x) \\equiv 0$ which is a trivial solution. Therefore, we set $c_2 \\neq 0$ and hence\n$$\n\\sin{\\left(\\sqrt{\\lambda}l\\right)} = 0,\n$$\ngiving $\\sqrt{\\lambda}l = k \\pi$, $k = \\pm 1, \\pm 2, ...$. Theerfore,\n$$\n\\lambda = \\lambda_k = \\left(\\frac{k \\pi}{l}\\right)^2,\n$$\nmeaning eigenvalues exist when $\\lambda > 0$. The eigenfunctions corresponding to the above eigenvalues are\n$$\nX_k(x) = \\sin{\\left(\\frac{k \\pi x}{l}\\right)}, \\quad k > 0, k \\in N.\n$$\n\nGoing back to $T^{\\prime\\prime}(t) + a^2 \\lambda T(t) = 0$, solving in analogical way, when $\\lambda = \\lambda_k$ the solution becomes\n\n$$\nT_k(t) = A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\n$$\n\nfor some constants $A_k$ and $B_k$. Hence,\n\n$$\nu_k(x,t) = X_k(x) T_k(t) = \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi x}{l}\\right)}, \\quad k > 0, k \\in N\n$$\n\nare solutions to our wave equation, also satisfying the boundary conditions. Since our equation is linear, forming a linear system with its conditions, the **principle of superposition** is valid. In other words, if $u_1, u_2, ..., u_n$ are solutions of our system, then\n\n$$\n\\alpha_1 u_1 + \\alpha_2 u_2 + ... + \\alpha_n u_n\n$$\n\nfor some constants $\\alpha_1, \\alpha_2, ..., \\alpha_n$ is also a solution of the system. But in our case we have an infinite number of functions $u_1, u_2, ...$ which satisfy the linear system. Therefore, we need the **generalised superposition principle** stating that in such case\n\n$$\nu = \\sum_n^{\\infty} \\alpha_n u_n\n$$\n\nfor some arbitrary constants $\\alpha_n$ is a solution to the system if the series converges uniformly and is twice differentiable termwise. This generalisation is a Lemma and should be prooved. The proof can be found in ...\n\nAssuming we have prooved the said Lemma, we can state that our system has a solution of the form\n\n$$\nu(x, t) = \\sum_{k=1}\n^{\\infty} u_k(x, t) = \\sum_{k=1}^{\\infty} \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi x}{l}\\right)}.\n$$\n\nThe next task we have to tackle is to determine the coefficients $A_k$ and $B_k$. We can achieve this by using the initial conditions \n\n$$\nu(x, 0) = \\varphi_1(x), \\quad \\text{and} \\quad u_t(x, 0) = \\varphi_2(x).\n$$\n\nWe get\n\n$$\nu(x, 0) = \\sum_{k=1}\n^{\\infty} A_k \\sin{\\left(\\frac{k \\pi x}{l}\\right)} = \\varphi_1(x)\n$$\n\nand\n\n$$\nu_t(x, 0) = \\sum_{k=1}^{\\infty} \\frac{ak\\pi}{l} B_k \\sin{\\left(\\frac{k \\pi x}{l}\\right)} = \\varphi_2(x).\n$$\n\nNow, we have to expand both $\\varphi_1(x)$ and $\\varphi_2(x)$ into series in terms of sines only (why?). We have\n\n$$\n\\varphi_1(x) = \\sum_{k=1}^{\\infty} \\varphi_k^{(1)} \\sin{\\left(\\frac{k \\pi}{l}x\\right)}\n$$\n\nand\n\n$$\n\\varphi_2(x) = \\sum_{k=1}^{\\infty} \\varphi_k^{(2)} \\sin{\\left(\\frac{k \\pi}{l}x\\right)}.\n$$\n\nBy the Fourier series theroem of uniqueness, we get\n\n$$\nA_k = \\varphi_k^{(1)} \\quad \\text{and} \\quad B_k = \\frac{l}{ak\\pi} \\varphi_k^{(2)},\n$$\n\nor (why?)\n\n$$\nA_k = \\frac{2}{l} \\int_{0}^{l} \\varphi_1(x) \\sin{\\left(\\frac{k \\pi}{l}x\\right)} \\mathrm{d}x\n$$\n\nand\n\n$$\nB_k = \\frac{2}{ak\\pi} \\int_{0}^{l} \\varphi_2(x) \\sin{\\left(\\frac{k \\pi}{l}x\\right)} \\mathrm{d}x.\n$$\n\nWe are left with the task of the covergence of the infinite series. We have to explore the following series\n\n$$\n|u(x, t)| \\leq \\sum_{k=1}^{\\infty}(|A_k| + |B_k|),\n$$\n\n$$\n|u_t(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{ak\\pi}{l}(|A_k| + |B_k|),\n$$\n\n$$\n|u_x(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{k\\pi}{l}(|A_k| + |B_k|),\n$$\n\n$$\n|u_{tt}(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{a^2 k^2 \\pi^2}{l^2}(|A_k| + |B_k|),\n$$\n\n$$\n|u_{xx}(x, t)| \\leq \\sum_{k=1}^{\\infty}\\frac{k^2 \\pi^2}{l^2}(|A_k| + |B_k|).\n$$\n\nIf the series on the right side (majorizing series) converge then the series on the left would also converge and the needed differentiation would exist. It is enough (why?) for the following series to converge\n\n$$\n\\sum_{k=1}^{\\infty} k^j \\left(|\\varphi_k^{(1)}| + \\frac{2}{ak\\pi}|\\varphi_k^{(2)}|\\right), j = 0, 1, 2.\n$$\n\nThis is possible only if \n\n$$\n\\left\\{\\begin{align*}\n\\sum_{k=1}^{\\infty} k^j |\\varphi_k^{(1)}|, \\\\\n\\sum_{k=1}^{\\infty} k^{j-1} |\\varphi_k^{(2)}|,\n\\end{align*}\\right. \\quad j = 0, 1, 2.\n$$\n\nconverge. From Calculus we know (theorem) that if $\\varphi(x)$ is $m$-times differentiable then\n\n$$\n\\sum_{k=1}^{\\infty} k^{m-1} |\\varphi_k|\n$$\n\nconvergres. Therefore, in order for all the majorzing series to converge it is enough $\\varphi_1(x)$ to be $3$-times differentiable, and $\\varphi_2(x)$ to be $2$-times differentiable.\n\nFinally, we should note a few things about the expansion of $\\varphi_1(x)$ and $\\varphi_2(x)$ into sine series. We have to note that in order to do that the function needs to be continued as an odd function which my lead to loss of the regularity of the lower derivatives. Let $\\tilde{\\varphi}_1(x)$ be the continuation of $\\varphi_1(x)$ as an odd function (see the Figure below) defined as\n\n\n{width=50%}\n \n\n$$\n\\tilde{\\varphi}_1(x) = \\left\\{\\begin{align*}\n\\varphi_1(x), \\quad 0 \\leq x \\leq l, \\\\\n-\\varphi_1(-x), \\quad -l \\leq x \\leq 0.\n\\end{align*}\\right.\n$$\n\nHence, in order for it to be continous and continously differentibale we need to enforce the following condition\n\n$$\n\\varphi_1(0) = \\varphi_1(l) = 0.\n$$\n\nTo summarise, in order for $\\sum_{k=1}^{\\infty} \\varphi_k^{(1)} \\sin{\\left( \\frac{k\\pi}{l}x\\right)}$ to converge in $[0, l]$ it is necessary to enforce the above conditions to have zero values at both ends of the interval. As for the second derivative, if it exists it would be continuous as well. Similarly, for the third derivative to exist we enforce\n\n$$\n\\varphi_1^{\\prime\\prime}(0) = \\varphi_1^{\\prime\\prime}(l) = 0\n$$\n\nand obtain the corresponding necessary condition\n\n$$\n\\varphi_2(0) = \\varphi_2(l) = 0.\n$$\n\nFinally, after these enforced conditions we can conclude that (tehorem)\n\n$$\nu(x, t) = \\sum_{k=1}^{\\infty} \\left(A_k \\cos{\\left(\\frac{ak\\pi}{l}t\\right)} + B_k \\sin{\\left(\\frac{ak\\pi}{l}t\\right)}\\right) \\sin{\\left(\\frac{k \\pi x}{l}\\right)}\n$$\n\nis a regular solution of the problem.\n\n**Physical interpretation:** TBD\n\n# 2D Wave Equation\n\n## Rectangular Membrane\n\nTBD\n\n## Circular Membrane\n\nTBD\n"},"formats":{"html":{"identifier":{"display-name":"HTML","target-format":"html","base-format":"html"},"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":false,"cache":null,"freeze":true,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":null,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"ipynb-shell-interactivity":null,"plotly-connected":true,"engine":"markdown"},"render":{"keep-tex":false,"keep-typ":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"inline-includes":false,"preserve-yaml":false,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-min-runs":1,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[],"notebook-links":true},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","html-math-method":"mathjax","css":["../../styles.css"],"output-file":"index.html"},"language":{"toc-title-document":"Table of contents","toc-title-website":"On this page","related-formats-title":"Other Formats","related-notebooks-title":"Notebooks","source-notebooks-prefix":"Source","other-links-title":"Other Links","code-links-title":"Code Links","launch-dev-container-title":"Launch Dev Container","launch-binder-title":"Launch Binder","article-notebook-label":"Article Notebook","notebook-preview-download":"Download Notebook","notebook-preview-download-src":"Download Source","notebook-preview-back":"Back to Article","manuscript-meca-bundle":"MECA Bundle","section-title-abstract":"Abstract","section-title-appendices":"Appendices","section-title-footnotes":"Footnotes","section-title-references":"References","section-title-reuse":"Reuse","section-title-copyright":"Copyright","section-title-citation":"Citation","appendix-attribution-cite-as":"For attribution, please cite this work as:","appendix-attribution-bibtex":"BibTeX citation:","appendix-view-license":"View License","title-block-author-single":"Author","title-block-author-plural":"Authors","title-block-affiliation-single":"Affiliation","title-block-affiliation-plural":"Affiliations","title-block-published":"Published","title-block-modified":"Modified","title-block-keywords":"Keywords","callout-tip-title":"Tip","callout-note-title":"Note","callout-warning-title":"Warning","callout-important-title":"Important","callout-caution-title":"Caution","code-summary":"Code","code-tools-menu-caption":"Code","code-tools-show-all-code":"Show All Code","code-tools-hide-all-code":"Hide All Code","code-tools-view-source":"View Source","code-tools-source-code":"Source Code","tools-share":"Share","tools-download":"Download","code-line":"Line","code-lines":"Lines","copy-button-tooltip":"Copy to Clipboard","copy-button-tooltip-success":"Copied!","repo-action-links-edit":"Edit this page","repo-action-links-source":"View source","repo-action-links-issue":"Report an issue","back-to-top":"Back to top","search-no-results-text":"No results","search-matching-documents-text":"matching documents","search-copy-link-title":"Copy link to search","search-hide-matches-text":"Hide additional matches","search-more-match-text":"more match in this document","search-more-matches-text":"more matches in this document","search-clear-button-title":"Clear","search-text-placeholder":"","search-detached-cancel-button-title":"Cancel","search-submit-button-title":"Submit","search-label":"Search","toggle-section":"Toggle section","toggle-sidebar":"Toggle sidebar navigation","toggle-dark-mode":"Toggle dark mode","toggle-reader-mode":"Toggle reader mode","toggle-navigation":"Toggle navigation","crossref-fig-title":"Figure","crossref-tbl-title":"Table","crossref-lst-title":"Listing","crossref-thm-title":"Theorem","crossref-lem-title":"Lemma","crossref-cor-title":"Corollary","crossref-prp-title":"Proposition","crossref-cnj-title":"Conjecture","crossref-def-title":"Definition","crossref-exm-title":"Example","crossref-exr-title":"Exercise","crossref-ch-prefix":"Chapter","crossref-apx-prefix":"Appendix","crossref-sec-prefix":"Section","crossref-eq-prefix":"Equation","crossref-lof-title":"List of Figures","crossref-lot-title":"List of Tables","crossref-lol-title":"List of Listings","environment-proof-title":"Proof","environment-remark-title":"Remark","environment-solution-title":"Solution","listing-page-order-by":"Order By","listing-page-order-by-default":"Default","listing-page-order-by-date-asc":"Oldest","listing-page-order-by-date-desc":"Newest","listing-page-order-by-number-desc":"High to Low","listing-page-order-by-number-asc":"Low to High","listing-page-field-date":"Date","listing-page-field-title":"Title","listing-page-field-description":"Description","listing-page-field-author":"Author","listing-page-field-filename":"File Name","listing-page-field-filemodified":"Modified","listing-page-field-subtitle":"Subtitle","listing-page-field-readingtime":"Reading Time","listing-page-field-wordcount":"Word Count","listing-page-field-categories":"Categories","listing-page-minutes-compact":"{0} min","listing-page-category-all":"All","listing-page-no-matches":"No matching items","listing-page-words":"{0} words","listing-page-filter":"Filter","draft":"Draft"},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.6.39","theme":"flatly","title-block-banner":true,"title":"Fourier Method for the Wave Equation","author":"JoJo","date":"2024-12-18","categories":["mathematics"],"image":"membrane.png","draft":true},"extensions":{"book":{"multiFile":true}}}},"draft":true,"projectFormats":["html"]}
\ No newline at end of file
diff --git a/src/.quarto/idx/posts/post-with-code/index.qmd.json b/src/.quarto/idx/posts/post-with-code/index.qmd.json
deleted file mode 100644
index cfffc402bbdf4c6229717e7d6ea4ca3ab2af595e..0000000000000000000000000000000000000000
--- a/src/.quarto/idx/posts/post-with-code/index.qmd.json
+++ /dev/null
@@ -1 +0,0 @@
-{"title":"Post With Code","markdown":{"yaml":{"title":"Post With Code","author":"Harlow Malloc","date":"2024-12-17","categories":["news","code","analysis"],"image":"image.jpg","draft":true},"containsRefs":false,"markdown":"\n\nThis is a post with executable code.\n","srcMarkdownNoYaml":"\n\nThis is a post with executable code.\n"},"formats":{"html":{"identifier":{"display-name":"HTML","target-format":"html","base-format":"html"},"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":false,"cache":null,"freeze":true,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":null,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"ipynb-shell-interactivity":null,"plotly-connected":true,"engine":"markdown"},"render":{"keep-tex":false,"keep-typ":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"inline-includes":false,"preserve-yaml":false,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-min-runs":1,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[],"notebook-links":true},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","html-math-method":"mathjax","css":["../../styles.css"],"output-file":"index.html"},"language":{"toc-title-document":"Table of contents","toc-title-website":"On this page","related-formats-title":"Other Formats","related-notebooks-title":"Notebooks","source-notebooks-prefix":"Source","other-links-title":"Other Links","code-links-title":"Code Links","launch-dev-container-title":"Launch Dev Container","launch-binder-title":"Launch Binder","article-notebook-label":"Article Notebook","notebook-preview-download":"Download Notebook","notebook-preview-download-src":"Download Source","notebook-preview-back":"Back to Article","manuscript-meca-bundle":"MECA Bundle","section-title-abstract":"Abstract","section-title-appendices":"Appendices","section-title-footnotes":"Footnotes","section-title-references":"References","section-title-reuse":"Reuse","section-title-copyright":"Copyright","section-title-citation":"Citation","appendix-attribution-cite-as":"For attribution, please cite this work as:","appendix-attribution-bibtex":"BibTeX citation:","appendix-view-license":"View License","title-block-author-single":"Author","title-block-author-plural":"Authors","title-block-affiliation-single":"Affiliation","title-block-affiliation-plural":"Affiliations","title-block-published":"Published","title-block-modified":"Modified","title-block-keywords":"Keywords","callout-tip-title":"Tip","callout-note-title":"Note","callout-warning-title":"Warning","callout-important-title":"Important","callout-caution-title":"Caution","code-summary":"Code","code-tools-menu-caption":"Code","code-tools-show-all-code":"Show All Code","code-tools-hide-all-code":"Hide All Code","code-tools-view-source":"View Source","code-tools-source-code":"Source Code","tools-share":"Share","tools-download":"Download","code-line":"Line","code-lines":"Lines","copy-button-tooltip":"Copy to Clipboard","copy-button-tooltip-success":"Copied!","repo-action-links-edit":"Edit this page","repo-action-links-source":"View source","repo-action-links-issue":"Report an issue","back-to-top":"Back to top","search-no-results-text":"No results","search-matching-documents-text":"matching documents","search-copy-link-title":"Copy link to search","search-hide-matches-text":"Hide additional matches","search-more-match-text":"more match in this document","search-more-matches-text":"more matches in this document","search-clear-button-title":"Clear","search-text-placeholder":"","search-detached-cancel-button-title":"Cancel","search-submit-button-title":"Submit","search-label":"Search","toggle-section":"Toggle section","toggle-sidebar":"Toggle sidebar navigation","toggle-dark-mode":"Toggle dark mode","toggle-reader-mode":"Toggle reader mode","toggle-navigation":"Toggle navigation","crossref-fig-title":"Figure","crossref-tbl-title":"Table","crossref-lst-title":"Listing","crossref-thm-title":"Theorem","crossref-lem-title":"Lemma","crossref-cor-title":"Corollary","crossref-prp-title":"Proposition","crossref-cnj-title":"Conjecture","crossref-def-title":"Definition","crossref-exm-title":"Example","crossref-exr-title":"Exercise","crossref-ch-prefix":"Chapter","crossref-apx-prefix":"Appendix","crossref-sec-prefix":"Section","crossref-eq-prefix":"Equation","crossref-lof-title":"List of Figures","crossref-lot-title":"List of Tables","crossref-lol-title":"List of Listings","environment-proof-title":"Proof","environment-remark-title":"Remark","environment-solution-title":"Solution","listing-page-order-by":"Order By","listing-page-order-by-default":"Default","listing-page-order-by-date-asc":"Oldest","listing-page-order-by-date-desc":"Newest","listing-page-order-by-number-desc":"High to Low","listing-page-order-by-number-asc":"Low to High","listing-page-field-date":"Date","listing-page-field-title":"Title","listing-page-field-description":"Description","listing-page-field-author":"Author","listing-page-field-filename":"File Name","listing-page-field-filemodified":"Modified","listing-page-field-subtitle":"Subtitle","listing-page-field-readingtime":"Reading Time","listing-page-field-wordcount":"Word Count","listing-page-field-categories":"Categories","listing-page-minutes-compact":"{0} min","listing-page-category-all":"All","listing-page-no-matches":"No matching items","listing-page-words":"{0} words","listing-page-filter":"Filter","draft":"Draft"},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.6.39","theme":"flatly","title-block-banner":true,"title":"Post With Code","author":"Harlow Malloc","date":"2024-12-17","categories":["news","code","analysis"],"image":"image.jpg","draft":true},"extensions":{"book":{"multiFile":true}}}},"draft":true,"projectFormats":["html"]}
\ No newline at end of file
diff --git a/src/.quarto/idx/posts/wave-equation/index.qmd.json b/src/.quarto/idx/posts/wave-equation/index.qmd.json
deleted file mode 100644
index 792d838b8f179b8d2cb32f460774a04fd8acdc8f..0000000000000000000000000000000000000000
--- a/src/.quarto/idx/posts/wave-equation/index.qmd.json
+++ /dev/null
@@ -1 +0,0 @@
-{"title":"Wave Equation","markdown":{"yaml":{"title":"Wave Equation","author":"JoJo","date":"2024-12-19","categories":["mathematics","python"],"image":"./images/rectangular_membrane_1_animation.gif","draft":true},"headingText":"Introduction","containsRefs":false,"markdown":"\n\nPartial differential equations...\n\n\nLet $u(x, y, t)$ be ...\n \nThe homogenous wave equation is given by\n\n$$\n\\frac{\\partial^2 u}{\\partial t^2} - c^2 (\\frac{\\partial^2 u}{\\partial x^2} + \\frac{\\partial^2 u}{\\partial y^2}) = 0\n$$\n\nor\n\n\\begin{equation}\nu_{tt} - c^2 (u_{xx} + u_{yy}) = 0.\n\\end{equation}\n\n# Physical interpretation\n\nThe wave equation is a simplified model for a vibrating\nstring (𝑛 = 1), membrane (𝑛 = 2), or elastic solid (𝑛 = 3). In these\nphysical interpretations 𝑢(𝑥, 𝑡) represents the displacement in some direction\nof the point 𝑥 at time 𝑡 ≥ 0.\n\n1D and 2D Equations\n\n# Rectangular Membrane\n\nPass\n\n$$\nD := \\{0 < x < a, 0 < y < b\\}\n$$\n\n...\n\n$$\n\\left\\{\\begin{align*}\nu_{tt} - c^2 (u_{xx} + u_{yy}) = 0, (x,y,t) \\in G = D \\times (0, +\\infty), \\\\ \nu|_{t=0} = \\varphi(x, y), u_t |_{t=0} = \\psi(x, y), (x, y) \\in \\bar{D}, \\\\\nu|_{\\partial D} = 0, t \\geq 0.\n\\end{align*}\\right.\n$$\n\n...\n\n$$\n\\varphi(x, y) \\in C^3 (\\bar{D}), \\psi(x, y) \\in C^2 (\\bar{D})\n$$\n\nand ...\n\n$$\n\\varphi |_{\\partial D} = \\varphi_{xx} |_{x = 0} = \\varphi_{xx} |_{x = a} = \\varphi_{yy} |_{y =0} = \\varphi_{yy} |_{y = b} = \\psi |_{\\partial D} = 0.\n$$\n\nSolution... :\n\n$$\nu(x, y, t) = \\sum_{n, m = 1}^{\\infty} \\left(A_{n, m} \\cos{\\sqrt{\\lambda_{n, m}} ct} + B_{n, m} \\sin{\\sqrt{\\lambda_{n, m}} ct} \\right) \\sin{\\frac{\\pi n}{a}} x \\sin{\\frac{\\pi m}{b}} y,\n$$\n\nwhere\n\n$$\n\\lambda_{n, m} = \\left(\\frac{\\pi n}{a} \\right)^2 + \\left(\\frac{\\pi m}{b} \\right)^2.\n$$\n\nFrom the initial conditions it follows\n\n$$\nA_{n, m} = \\frac{4}{ab} \\int_D \\varphi(x, y) \\sin{\\frac{\\pi n}{a}} x \\sin{\\frac{\\pi m}{b}} y \\mathrm{d}x \\mathrm{d}y,\n$$\n\nand\n\n$$\nB_{n, m} = \\frac{4}{abc\\sqrt{\\lambda_{n, m}}} \\int_D \\psi(x, y) \\sin{\\frac{\\pi n}{a}} x \\sin{\\frac{\\pi m}{b}} y \\mathrm{d}x \\mathrm{d}y.\n$$\n\n## Example 1\n\n...\n\n$$\n\\left\\{\\begin{align*}\nu_{tt} - u_{xx} - u_{yy} = 0, 0 < x < \\pi, 0 < y < \\pi, t > 0, \\\\\nu|_{t=0} = \\sin{x} \\sin{y}, u_t |_{t=0} = \\sin{4x} \\sin{3y}, x, y \\in (0, \\pi), \\\\\nu|_{x = 0} = 0, u|_{x = \\pi} = 0, 0 < y < \\pi, t > 0, \\\\\nu|_{y = 0} = 0, u|_{y = \\pi} = 0, 0 < x < \\pi, t > 0.\n\\end{align*}\\right.\n$$\n\nSolution:\n\n$$\nu(x, y, t) = \\sum_{n, m = 1}^{\\infty} \\left(A_{n, m} \\cos{\\sqrt{\\lambda_{n, m}} t} + B_{n, m} \\sin{\\sqrt{\\lambda_{n, m}} t} \\right) \\sin{n} x \\sin{m} y,\n$$\n\nwhere\n\n$$\n\\lambda_{n, m} = n^2 + m^2,\n$$\n\n$$\nA_{n, m} = \\frac{4}{\\pi^2} \\int_0^\\pi \\sin{x} \\sin{nx} \\mathrm{d}x \\int_0^\\pi \\sin{y} \\sin{my} \\mathrm{d}y,\n$$\n\n$$\nB_{n, m} = \\frac{4}{\\pi^2\\sqrt{\\lambda_{n, m}}} \\int_0^\\pi \\sin{4x} \\sin{nx} \\mathrm{d}x \\int_0^\\pi \\sin{3y} \\sin{my} \\mathrm{d}y.\n$$\n\nTherefore, $A_{1, 1} = 1$, $B_{4, 3} = \\frac{1}{5}$, and every other coefficients is equal to $0$. Finally, \n\n$$\nu(x, y, t) = \\cos{\\sqrt{2}t} \\sin{x} \\sin{y} + \\frac{1}{5} \\sin{5t} \\sin{4x} \\sin{3y}.\n$$\n\nFor $t \\in [0, 6]$:\n\nAnimation:\n\n\n\n```{python}\n#| code-fold: true\n#| code-summary: \"Click to expand the code\"\n{{< include ./code/rectangular_membrane_1.py >}}\n```\n\nSnapshots:\n\n{width=33%}{width=33%}{width=33%}\n\n## Example 2\n\n...\n\n$$\n\\left\\{\\begin{align*}\nu_{tt} - \\pi^2 (u_{xx} + u_{yy}) = 0, 0 < x < 1, 0 < y < 2, t > 0, \\\\\nu|_{t=0} = \\cos{\\left(\\left(x + \\frac{1}{2}\\right)\\pi\\right)} \\cos{\\left(\\frac{\\pi}{2}\\left(y + 1\\right)\\right)}, u_t |_{t=0} = 0, 0 \\leq x \\leq 1, 0 \\leq y \\leq 2, \\\\\nu|_{x = 0} = 0, u|_{x = 1} = 0, 0 \\leq y < 2, t \\geq 0, \\\\\nu|_{y = 0} = 0, u|_{y = 2} = 0, 0 \\leq x \\leq 1, t \\geq 0.\n\\end{align*}\\right.\n$$\n\nSolution with Fourier method:\n\n$$\nu(x, y, t) = \\sum_{n, m = 1}^{\\infty} \\left(A_{n, m} \\cos{\\sqrt{\\lambda_{n, m}} t} + B_{n, m} \\sin{\\sqrt{\\lambda_{n, m}} t} \\right) \\sin{\\pi n} x \\sin{\\pi m} y,\n$$\n\nwhere\n\n$$\n\\lambda_{n, m} = \\pi^2 (n^2 + m^2)\n$$\n\nand\n\n$$\nB_{n, m} = 0.\n$$\n\n$$\nA_{n, m} = 2 \\int_{0}^{1} \\cos{\\left(\\left(x + \\frac{1}{2}\\right)\\pi\\right)} \\sin{\\pi nx} \\mathrm{d}x \\int_0^2 \\cos{\\left(\\frac{\\pi}{2}\\left(y + 1\\right)\\right)} \\sin{\\pi my} \\mathrm{d}y.\n$$\n\nVisualising the solution for $t \\in [0, 6]$ with the partial sum\n\n$$\n\\tilde{u}(x, y, t) = \\sum_{n, m = 1}^{30} A_{n, m} \\cos{\\sqrt{\\lambda_{n, m}} t} \\sin{\\pi n} x \\sin{\\pi m} y.\n$$\n\nAnimation:\n\n\n\n```{python}\n#| code-fold: true\n#| code-summary: \"Click to expand the code\"\n{{< include ./code/rectangular_membrane_2.py >}}\n```\n\nSnapshots:\n\n{width=33%}{width=33%}{width=33%}\n\n# Circular Membrane\n\nPass\n\n$$\n\\left\\{\\begin{align*}\nu_{tt} - \\frac{1}{4} (u_{xx} + u_{yy}) = 0, x^2 + y^2 < 9, t > 0, \\\\ \nu|_{t=0} = (x^2 + y^2) \\sin^3(\\pi \\sqrt{x^2 + y^2}), u_t |_{t=0} = 0, x^2 + y^2 \\leq 9, \\\\\nu|_{x^2 + y^2 = 9} = 0, t \\geq 0.\n\\end{align*}\\right.\n$$\n\nFourier method: Change to polar coordinates\n\n$$\n\\left\\{\\begin{align*}\nx = \\rho \\cos(\\varphi), \\\\\ny = \\rho \\sin(\\varphi)\n\\end{align*}\\right.\n$$\n\n...\n\nThen the function in the first initial condition $u |_{t=0}$ becomes\n\n$$\n\\tau(\\rho) = \\rho^2 \\sin^3(\\pi \\rho)\n$$\n\nwhich is radially symmetric and hence the solution will be also radially symmetric. It is given by\n\n$$\nu(\\rho, t) = \\sum_{m=1}^{\\infty} A_m \\cos{\\frac{a \\mu_m^{(0)}t}{r}} J_0\\left(\\frac{\\mu_m^{(0)}}{r}\\rho\\right),\n$$\n\nwhere\n\n$$\nA_m = \\frac{4}{r^2 J_1^2(\\mu_m^{(0)})} \\int_0^r \\rho^3 \\sin^3(\\pi \\rho) J_0\\left(\\frac{\\mu_m^{(0)}}{r}\\rho\\right) d\\rho,\n$$\n\nand $\\mu_m^{(0)}$ are the positive solutions to $J_0(\\mu) = 0$.\n\n...\n\n\n\n...\n\nAnimation:\n\n\n\n```{python}\n#| code-fold: true\n#| code-summary: \"Click to expand the code\"\n{{< include ./code/circular_membrane.py >}}\n```\n\nSnapshots:\n\n{width=33%}{width=33%}{width=33%}\n\n# References\n\n- [1](https://www.amazon.co.uk/Partial-Differential-Equations-Graduate-Mathematics/dp/1470469421/ref=sr_1_3?crid=2BINQDJ5R7XUB&dib=eyJ2IjoiMSJ9.GgU4uQBUKYO960lL6EjVJjksjFysLhCJKEHP436_saFGnfKf4uvgqyl_3WBjV779K4AwonOY5XnkRxVFCIqqGZCCE3I8YEjIC7mzvLwUa2lBPvByBCoFxTvGhrSKGLiAKlAvTVFSlbwklqyWEj4o852csy80_D3G2Gk9pedHKz22vqyc8UI8HAxWZ1wfu5bNoaqOOEDhy0W2XLaSijLCENnzVXjxTLS5xZkMCXr72G0.NeT6LdhY-WV9xVA26fbGHp37FbAKGo7mLwpV9m_2Rdk&dib_tag=se&keywords=partial+differential+equations&nsdOptOutParam=true&qid=1734133658&sprefix=partial+diff%2Caps%2C129&sr=8-3)\n- [2](https://mathworld.wolfram.com/BesselFunctionoftheFirstKind.html)\n","srcMarkdownNoYaml":"\n\nPartial differential equations...\n\n# Introduction\n\nLet $u(x, y, t)$ be ...\n \nThe homogenous wave equation is given by\n\n$$\n\\frac{\\partial^2 u}{\\partial t^2} - c^2 (\\frac{\\partial^2 u}{\\partial x^2} + \\frac{\\partial^2 u}{\\partial y^2}) = 0\n$$\n\nor\n\n\\begin{equation}\nu_{tt} - c^2 (u_{xx} + u_{yy}) = 0.\n\\end{equation}\n\n# Physical interpretation\n\nThe wave equation is a simplified model for a vibrating\nstring (𝑛 = 1), membrane (𝑛 = 2), or elastic solid (𝑛 = 3). In these\nphysical interpretations 𝑢(𝑥, 𝑡) represents the displacement in some direction\nof the point 𝑥 at time 𝑡 ≥ 0.\n\n1D and 2D Equations\n\n# Rectangular Membrane\n\nPass\n\n$$\nD := \\{0 < x < a, 0 < y < b\\}\n$$\n\n...\n\n$$\n\\left\\{\\begin{align*}\nu_{tt} - c^2 (u_{xx} + u_{yy}) = 0, (x,y,t) \\in G = D \\times (0, +\\infty), \\\\ \nu|_{t=0} = \\varphi(x, y), u_t |_{t=0} = \\psi(x, y), (x, y) \\in \\bar{D}, \\\\\nu|_{\\partial D} = 0, t \\geq 0.\n\\end{align*}\\right.\n$$\n\n...\n\n$$\n\\varphi(x, y) \\in C^3 (\\bar{D}), \\psi(x, y) \\in C^2 (\\bar{D})\n$$\n\nand ...\n\n$$\n\\varphi |_{\\partial D} = \\varphi_{xx} |_{x = 0} = \\varphi_{xx} |_{x = a} = \\varphi_{yy} |_{y =0} = \\varphi_{yy} |_{y = b} = \\psi |_{\\partial D} = 0.\n$$\n\nSolution... :\n\n$$\nu(x, y, t) = \\sum_{n, m = 1}^{\\infty} \\left(A_{n, m} \\cos{\\sqrt{\\lambda_{n, m}} ct} + B_{n, m} \\sin{\\sqrt{\\lambda_{n, m}} ct} \\right) \\sin{\\frac{\\pi n}{a}} x \\sin{\\frac{\\pi m}{b}} y,\n$$\n\nwhere\n\n$$\n\\lambda_{n, m} = \\left(\\frac{\\pi n}{a} \\right)^2 + \\left(\\frac{\\pi m}{b} \\right)^2.\n$$\n\nFrom the initial conditions it follows\n\n$$\nA_{n, m} = \\frac{4}{ab} \\int_D \\varphi(x, y) \\sin{\\frac{\\pi n}{a}} x \\sin{\\frac{\\pi m}{b}} y \\mathrm{d}x \\mathrm{d}y,\n$$\n\nand\n\n$$\nB_{n, m} = \\frac{4}{abc\\sqrt{\\lambda_{n, m}}} \\int_D \\psi(x, y) \\sin{\\frac{\\pi n}{a}} x \\sin{\\frac{\\pi m}{b}} y \\mathrm{d}x \\mathrm{d}y.\n$$\n\n## Example 1\n\n...\n\n$$\n\\left\\{\\begin{align*}\nu_{tt} - u_{xx} - u_{yy} = 0, 0 < x < \\pi, 0 < y < \\pi, t > 0, \\\\\nu|_{t=0} = \\sin{x} \\sin{y}, u_t |_{t=0} = \\sin{4x} \\sin{3y}, x, y \\in (0, \\pi), \\\\\nu|_{x = 0} = 0, u|_{x = \\pi} = 0, 0 < y < \\pi, t > 0, \\\\\nu|_{y = 0} = 0, u|_{y = \\pi} = 0, 0 < x < \\pi, t > 0.\n\\end{align*}\\right.\n$$\n\nSolution:\n\n$$\nu(x, y, t) = \\sum_{n, m = 1}^{\\infty} \\left(A_{n, m} \\cos{\\sqrt{\\lambda_{n, m}} t} + B_{n, m} \\sin{\\sqrt{\\lambda_{n, m}} t} \\right) \\sin{n} x \\sin{m} y,\n$$\n\nwhere\n\n$$\n\\lambda_{n, m} = n^2 + m^2,\n$$\n\n$$\nA_{n, m} = \\frac{4}{\\pi^2} \\int_0^\\pi \\sin{x} \\sin{nx} \\mathrm{d}x \\int_0^\\pi \\sin{y} \\sin{my} \\mathrm{d}y,\n$$\n\n$$\nB_{n, m} = \\frac{4}{\\pi^2\\sqrt{\\lambda_{n, m}}} \\int_0^\\pi \\sin{4x} \\sin{nx} \\mathrm{d}x \\int_0^\\pi \\sin{3y} \\sin{my} \\mathrm{d}y.\n$$\n\nTherefore, $A_{1, 1} = 1$, $B_{4, 3} = \\frac{1}{5}$, and every other coefficients is equal to $0$. Finally, \n\n$$\nu(x, y, t) = \\cos{\\sqrt{2}t} \\sin{x} \\sin{y} + \\frac{1}{5} \\sin{5t} \\sin{4x} \\sin{3y}.\n$$\n\nFor $t \\in [0, 6]$:\n\nAnimation:\n\n\n\n```{python}\n#| code-fold: true\n#| code-summary: \"Click to expand the code\"\n{{< include ./code/rectangular_membrane_1.py >}}\n```\n\nSnapshots:\n\n{width=33%}{width=33%}{width=33%}\n\n## Example 2\n\n...\n\n$$\n\\left\\{\\begin{align*}\nu_{tt} - \\pi^2 (u_{xx} + u_{yy}) = 0, 0 < x < 1, 0 < y < 2, t > 0, \\\\\nu|_{t=0} = \\cos{\\left(\\left(x + \\frac{1}{2}\\right)\\pi\\right)} \\cos{\\left(\\frac{\\pi}{2}\\left(y + 1\\right)\\right)}, u_t |_{t=0} = 0, 0 \\leq x \\leq 1, 0 \\leq y \\leq 2, \\\\\nu|_{x = 0} = 0, u|_{x = 1} = 0, 0 \\leq y < 2, t \\geq 0, \\\\\nu|_{y = 0} = 0, u|_{y = 2} = 0, 0 \\leq x \\leq 1, t \\geq 0.\n\\end{align*}\\right.\n$$\n\nSolution with Fourier method:\n\n$$\nu(x, y, t) = \\sum_{n, m = 1}^{\\infty} \\left(A_{n, m} \\cos{\\sqrt{\\lambda_{n, m}} t} + B_{n, m} \\sin{\\sqrt{\\lambda_{n, m}} t} \\right) \\sin{\\pi n} x \\sin{\\pi m} y,\n$$\n\nwhere\n\n$$\n\\lambda_{n, m} = \\pi^2 (n^2 + m^2)\n$$\n\nand\n\n$$\nB_{n, m} = 0.\n$$\n\n$$\nA_{n, m} = 2 \\int_{0}^{1} \\cos{\\left(\\left(x + \\frac{1}{2}\\right)\\pi\\right)} \\sin{\\pi nx} \\mathrm{d}x \\int_0^2 \\cos{\\left(\\frac{\\pi}{2}\\left(y + 1\\right)\\right)} \\sin{\\pi my} \\mathrm{d}y.\n$$\n\nVisualising the solution for $t \\in [0, 6]$ with the partial sum\n\n$$\n\\tilde{u}(x, y, t) = \\sum_{n, m = 1}^{30} A_{n, m} \\cos{\\sqrt{\\lambda_{n, m}} t} \\sin{\\pi n} x \\sin{\\pi m} y.\n$$\n\nAnimation:\n\n\n\n```{python}\n#| code-fold: true\n#| code-summary: \"Click to expand the code\"\n{{< include ./code/rectangular_membrane_2.py >}}\n```\n\nSnapshots:\n\n{width=33%}{width=33%}{width=33%}\n\n# Circular Membrane\n\nPass\n\n$$\n\\left\\{\\begin{align*}\nu_{tt} - \\frac{1}{4} (u_{xx} + u_{yy}) = 0, x^2 + y^2 < 9, t > 0, \\\\ \nu|_{t=0} = (x^2 + y^2) \\sin^3(\\pi \\sqrt{x^2 + y^2}), u_t |_{t=0} = 0, x^2 + y^2 \\leq 9, \\\\\nu|_{x^2 + y^2 = 9} = 0, t \\geq 0.\n\\end{align*}\\right.\n$$\n\nFourier method: Change to polar coordinates\n\n$$\n\\left\\{\\begin{align*}\nx = \\rho \\cos(\\varphi), \\\\\ny = \\rho \\sin(\\varphi)\n\\end{align*}\\right.\n$$\n\n...\n\nThen the function in the first initial condition $u |_{t=0}$ becomes\n\n$$\n\\tau(\\rho) = \\rho^2 \\sin^3(\\pi \\rho)\n$$\n\nwhich is radially symmetric and hence the solution will be also radially symmetric. It is given by\n\n$$\nu(\\rho, t) = \\sum_{m=1}^{\\infty} A_m \\cos{\\frac{a \\mu_m^{(0)}t}{r}} J_0\\left(\\frac{\\mu_m^{(0)}}{r}\\rho\\right),\n$$\n\nwhere\n\n$$\nA_m = \\frac{4}{r^2 J_1^2(\\mu_m^{(0)})} \\int_0^r \\rho^3 \\sin^3(\\pi \\rho) J_0\\left(\\frac{\\mu_m^{(0)}}{r}\\rho\\right) d\\rho,\n$$\n\nand $\\mu_m^{(0)}$ are the positive solutions to $J_0(\\mu) = 0$.\n\n...\n\n\n\n...\n\nAnimation:\n\n\n\n```{python}\n#| code-fold: true\n#| code-summary: \"Click to expand the code\"\n{{< include ./code/circular_membrane.py >}}\n```\n\nSnapshots:\n\n{width=33%}{width=33%}{width=33%}\n\n# References\n\n- [1](https://www.amazon.co.uk/Partial-Differential-Equations-Graduate-Mathematics/dp/1470469421/ref=sr_1_3?crid=2BINQDJ5R7XUB&dib=eyJ2IjoiMSJ9.GgU4uQBUKYO960lL6EjVJjksjFysLhCJKEHP436_saFGnfKf4uvgqyl_3WBjV779K4AwonOY5XnkRxVFCIqqGZCCE3I8YEjIC7mzvLwUa2lBPvByBCoFxTvGhrSKGLiAKlAvTVFSlbwklqyWEj4o852csy80_D3G2Gk9pedHKz22vqyc8UI8HAxWZ1wfu5bNoaqOOEDhy0W2XLaSijLCENnzVXjxTLS5xZkMCXr72G0.NeT6LdhY-WV9xVA26fbGHp37FbAKGo7mLwpV9m_2Rdk&dib_tag=se&keywords=partial+differential+equations&nsdOptOutParam=true&qid=1734133658&sprefix=partial+diff%2Caps%2C129&sr=8-3)\n- [2](https://mathworld.wolfram.com/BesselFunctionoftheFirstKind.html)\n"},"formats":{"html":{"identifier":{"display-name":"HTML","target-format":"html","base-format":"html"},"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":false,"cache":null,"freeze":true,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":null,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"ipynb-shell-interactivity":null,"plotly-connected":true,"engine":"jupyter"},"render":{"keep-tex":false,"keep-typ":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"inline-includes":false,"preserve-yaml":false,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-min-runs":1,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[],"notebook-links":true},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","html-math-method":"mathjax","css":["../../styles.css"],"output-file":"index.html"},"language":{"toc-title-document":"Table of contents","toc-title-website":"On this page","related-formats-title":"Other Formats","related-notebooks-title":"Notebooks","source-notebooks-prefix":"Source","other-links-title":"Other Links","code-links-title":"Code Links","launch-dev-container-title":"Launch Dev Container","launch-binder-title":"Launch Binder","article-notebook-label":"Article Notebook","notebook-preview-download":"Download Notebook","notebook-preview-download-src":"Download Source","notebook-preview-back":"Back to Article","manuscript-meca-bundle":"MECA Bundle","section-title-abstract":"Abstract","section-title-appendices":"Appendices","section-title-footnotes":"Footnotes","section-title-references":"References","section-title-reuse":"Reuse","section-title-copyright":"Copyright","section-title-citation":"Citation","appendix-attribution-cite-as":"For attribution, please cite this work as:","appendix-attribution-bibtex":"BibTeX citation:","appendix-view-license":"View License","title-block-author-single":"Author","title-block-author-plural":"Authors","title-block-affiliation-single":"Affiliation","title-block-affiliation-plural":"Affiliations","title-block-published":"Published","title-block-modified":"Modified","title-block-keywords":"Keywords","callout-tip-title":"Tip","callout-note-title":"Note","callout-warning-title":"Warning","callout-important-title":"Important","callout-caution-title":"Caution","code-summary":"Code","code-tools-menu-caption":"Code","code-tools-show-all-code":"Show All Code","code-tools-hide-all-code":"Hide All Code","code-tools-view-source":"View Source","code-tools-source-code":"Source Code","tools-share":"Share","tools-download":"Download","code-line":"Line","code-lines":"Lines","copy-button-tooltip":"Copy to Clipboard","copy-button-tooltip-success":"Copied!","repo-action-links-edit":"Edit this page","repo-action-links-source":"View source","repo-action-links-issue":"Report an issue","back-to-top":"Back to top","search-no-results-text":"No results","search-matching-documents-text":"matching documents","search-copy-link-title":"Copy link to search","search-hide-matches-text":"Hide additional matches","search-more-match-text":"more match in this document","search-more-matches-text":"more matches in this document","search-clear-button-title":"Clear","search-text-placeholder":"","search-detached-cancel-button-title":"Cancel","search-submit-button-title":"Submit","search-label":"Search","toggle-section":"Toggle section","toggle-sidebar":"Toggle sidebar navigation","toggle-dark-mode":"Toggle dark mode","toggle-reader-mode":"Toggle reader mode","toggle-navigation":"Toggle navigation","crossref-fig-title":"Figure","crossref-tbl-title":"Table","crossref-lst-title":"Listing","crossref-thm-title":"Theorem","crossref-lem-title":"Lemma","crossref-cor-title":"Corollary","crossref-prp-title":"Proposition","crossref-cnj-title":"Conjecture","crossref-def-title":"Definition","crossref-exm-title":"Example","crossref-exr-title":"Exercise","crossref-ch-prefix":"Chapter","crossref-apx-prefix":"Appendix","crossref-sec-prefix":"Section","crossref-eq-prefix":"Equation","crossref-lof-title":"List of Figures","crossref-lot-title":"List of Tables","crossref-lol-title":"List of Listings","environment-proof-title":"Proof","environment-remark-title":"Remark","environment-solution-title":"Solution","listing-page-order-by":"Order By","listing-page-order-by-default":"Default","listing-page-order-by-date-asc":"Oldest","listing-page-order-by-date-desc":"Newest","listing-page-order-by-number-desc":"High to Low","listing-page-order-by-number-asc":"Low to High","listing-page-field-date":"Date","listing-page-field-title":"Title","listing-page-field-description":"Description","listing-page-field-author":"Author","listing-page-field-filename":"File Name","listing-page-field-filemodified":"Modified","listing-page-field-subtitle":"Subtitle","listing-page-field-readingtime":"Reading Time","listing-page-field-wordcount":"Word Count","listing-page-field-categories":"Categories","listing-page-minutes-compact":"{0} min","listing-page-category-all":"All","listing-page-no-matches":"No matching items","listing-page-words":"{0} words","listing-page-filter":"Filter","draft":"Draft"},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.6.39","theme":"flatly","title-block-banner":true,"title":"Wave Equation","author":"JoJo","date":"2024-12-19","categories":["mathematics","python"],"image":"./images/rectangular_membrane_1_animation.gif","draft":true},"extensions":{"book":{"multiFile":true}}}},"draft":true,"projectFormats":["html"]}
\ No newline at end of file
diff --git a/src/.quarto/idx/posts/welcome/index.qmd.json b/src/.quarto/idx/posts/welcome/index.qmd.json
deleted file mode 100644
index e52421171fe1ca3a4767efc58f5a6630f232c8fe..0000000000000000000000000000000000000000
--- a/src/.quarto/idx/posts/welcome/index.qmd.json
+++ /dev/null
@@ -1 +0,0 @@
-{"title":"Welcome To My Blog","markdown":{"yaml":{"title":"Welcome To My Blog","author":"Tristan O'Malley","date":"2024-12-16","categories":["news"],"draft":true},"containsRefs":false,"markdown":"\n\nThis is the first post in a Quarto blog. Welcome!\n\n\n\nSince this post doesn't specify an explicit `image`, the first image in the post will be used in the listing page of posts.\n","srcMarkdownNoYaml":"\n\nThis is the first post in a Quarto blog. Welcome!\n\n\n\nSince this post doesn't specify an explicit `image`, the first image in the post will be used in the listing page of posts.\n"},"formats":{"html":{"identifier":{"display-name":"HTML","target-format":"html","base-format":"html"},"execute":{"fig-width":7,"fig-height":5,"fig-format":"retina","fig-dpi":96,"df-print":"default","error":false,"eval":false,"cache":null,"freeze":true,"echo":true,"output":true,"warning":true,"include":true,"keep-md":false,"keep-ipynb":false,"ipynb":null,"enabled":null,"daemon":null,"daemon-restart":false,"debug":false,"ipynb-filters":[],"ipynb-shell-interactivity":null,"plotly-connected":true,"engine":"markdown"},"render":{"keep-tex":false,"keep-typ":false,"keep-source":false,"keep-hidden":false,"prefer-html":false,"output-divs":true,"output-ext":"html","fig-align":"default","fig-pos":null,"fig-env":null,"code-fold":"none","code-overflow":"scroll","code-link":false,"code-line-numbers":false,"code-tools":false,"tbl-colwidths":"auto","merge-includes":true,"inline-includes":false,"preserve-yaml":false,"latex-auto-mk":true,"latex-auto-install":true,"latex-clean":true,"latex-min-runs":1,"latex-max-runs":10,"latex-makeindex":"makeindex","latex-makeindex-opts":[],"latex-tlmgr-opts":[],"latex-input-paths":[],"latex-output-dir":null,"link-external-icon":false,"link-external-newwindow":false,"self-contained-math":false,"format-resources":[],"notebook-links":true},"pandoc":{"standalone":true,"wrap":"none","default-image-extension":"png","to":"html","html-math-method":"mathjax","css":["../../styles.css"],"output-file":"index.html"},"language":{"toc-title-document":"Table of contents","toc-title-website":"On this page","related-formats-title":"Other Formats","related-notebooks-title":"Notebooks","source-notebooks-prefix":"Source","other-links-title":"Other Links","code-links-title":"Code Links","launch-dev-container-title":"Launch Dev Container","launch-binder-title":"Launch Binder","article-notebook-label":"Article Notebook","notebook-preview-download":"Download Notebook","notebook-preview-download-src":"Download Source","notebook-preview-back":"Back to Article","manuscript-meca-bundle":"MECA Bundle","section-title-abstract":"Abstract","section-title-appendices":"Appendices","section-title-footnotes":"Footnotes","section-title-references":"References","section-title-reuse":"Reuse","section-title-copyright":"Copyright","section-title-citation":"Citation","appendix-attribution-cite-as":"For attribution, please cite this work as:","appendix-attribution-bibtex":"BibTeX citation:","appendix-view-license":"View License","title-block-author-single":"Author","title-block-author-plural":"Authors","title-block-affiliation-single":"Affiliation","title-block-affiliation-plural":"Affiliations","title-block-published":"Published","title-block-modified":"Modified","title-block-keywords":"Keywords","callout-tip-title":"Tip","callout-note-title":"Note","callout-warning-title":"Warning","callout-important-title":"Important","callout-caution-title":"Caution","code-summary":"Code","code-tools-menu-caption":"Code","code-tools-show-all-code":"Show All Code","code-tools-hide-all-code":"Hide All Code","code-tools-view-source":"View Source","code-tools-source-code":"Source Code","tools-share":"Share","tools-download":"Download","code-line":"Line","code-lines":"Lines","copy-button-tooltip":"Copy to Clipboard","copy-button-tooltip-success":"Copied!","repo-action-links-edit":"Edit this page","repo-action-links-source":"View source","repo-action-links-issue":"Report an issue","back-to-top":"Back to top","search-no-results-text":"No results","search-matching-documents-text":"matching documents","search-copy-link-title":"Copy link to search","search-hide-matches-text":"Hide additional matches","search-more-match-text":"more match in this document","search-more-matches-text":"more matches in this document","search-clear-button-title":"Clear","search-text-placeholder":"","search-detached-cancel-button-title":"Cancel","search-submit-button-title":"Submit","search-label":"Search","toggle-section":"Toggle section","toggle-sidebar":"Toggle sidebar navigation","toggle-dark-mode":"Toggle dark mode","toggle-reader-mode":"Toggle reader mode","toggle-navigation":"Toggle navigation","crossref-fig-title":"Figure","crossref-tbl-title":"Table","crossref-lst-title":"Listing","crossref-thm-title":"Theorem","crossref-lem-title":"Lemma","crossref-cor-title":"Corollary","crossref-prp-title":"Proposition","crossref-cnj-title":"Conjecture","crossref-def-title":"Definition","crossref-exm-title":"Example","crossref-exr-title":"Exercise","crossref-ch-prefix":"Chapter","crossref-apx-prefix":"Appendix","crossref-sec-prefix":"Section","crossref-eq-prefix":"Equation","crossref-lof-title":"List of Figures","crossref-lot-title":"List of Tables","crossref-lol-title":"List of Listings","environment-proof-title":"Proof","environment-remark-title":"Remark","environment-solution-title":"Solution","listing-page-order-by":"Order By","listing-page-order-by-default":"Default","listing-page-order-by-date-asc":"Oldest","listing-page-order-by-date-desc":"Newest","listing-page-order-by-number-desc":"High to Low","listing-page-order-by-number-asc":"Low to High","listing-page-field-date":"Date","listing-page-field-title":"Title","listing-page-field-description":"Description","listing-page-field-author":"Author","listing-page-field-filename":"File Name","listing-page-field-filemodified":"Modified","listing-page-field-subtitle":"Subtitle","listing-page-field-readingtime":"Reading Time","listing-page-field-wordcount":"Word Count","listing-page-field-categories":"Categories","listing-page-minutes-compact":"{0} min","listing-page-category-all":"All","listing-page-no-matches":"No matching items","listing-page-words":"{0} words","listing-page-filter":"Filter","draft":"Draft"},"metadata":{"lang":"en","fig-responsive":true,"quarto-version":"1.6.39","theme":"flatly","title-block-banner":true,"title":"Welcome To My Blog","author":"Tristan O'Malley","date":"2024-12-16","categories":["news"],"draft":true},"extensions":{"book":{"multiFile":true}}}},"draft":true,"projectFormats":["html"]}
\ No newline at end of file
diff --git a/src/.quarto/listing/listing-cache.json b/src/.quarto/listing/listing-cache.json
deleted file mode 100644
index 225bb3c5d71c591ea567b14fb19d38ef056247b7..0000000000000000000000000000000000000000
--- a/src/.quarto/listing/listing-cache.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "listingMap": {
- "index.qmd": [
- "posts"
- ]
- }
-}
\ No newline at end of file
diff --git a/src/.quarto/xref/0dea6315 b/src/.quarto/xref/0dea6315
deleted file mode 100644
index b87ed097b48451d3121129b75b82ee056b835e22..0000000000000000000000000000000000000000
--- a/src/.quarto/xref/0dea6315
+++ /dev/null
@@ -1 +0,0 @@
-{"entries":[],"headings":["d-wave-equation","fixed-string","example"]}
\ No newline at end of file
diff --git a/src/.quarto/xref/3c315252 b/src/.quarto/xref/3c315252
deleted file mode 100644
index 208374ba72de8724ff6a1523d362f26cdfde279a..0000000000000000000000000000000000000000
--- a/src/.quarto/xref/3c315252
+++ /dev/null
@@ -1 +0,0 @@
-{"entries":[],"headings":[]}
\ No newline at end of file
diff --git a/src/.quarto/xref/72c2ebbf b/src/.quarto/xref/72c2ebbf
deleted file mode 100644
index 208374ba72de8724ff6a1523d362f26cdfde279a..0000000000000000000000000000000000000000
--- a/src/.quarto/xref/72c2ebbf
+++ /dev/null
@@ -1 +0,0 @@
-{"entries":[],"headings":[]}
\ No newline at end of file
diff --git a/src/.quarto/xref/866fbff8 b/src/.quarto/xref/866fbff8
deleted file mode 100644
index 208374ba72de8724ff6a1523d362f26cdfde279a..0000000000000000000000000000000000000000
--- a/src/.quarto/xref/866fbff8
+++ /dev/null
@@ -1 +0,0 @@
-{"entries":[],"headings":[]}
\ No newline at end of file
diff --git a/src/.quarto/xref/INDEX b/src/.quarto/xref/INDEX
deleted file mode 100644
index 2b8f5d8f5d0f47f8722b93def446255ec832347f..0000000000000000000000000000000000000000
--- a/src/.quarto/xref/INDEX
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "posts/post-with-code/index.qmd": {
- "index.html": "ecb70ff4"
- },
- "posts/2025-01-06-chebyshev-polynomials/index.qmd": {
- "index.html": "a841ef91"
- },
- "posts/2025-01-04-fourier-method-fixed-string/index.qmd": {
- "index.html": "0dea6315"
- },
- "posts/fourier/index.qmd": {
- "index.html": "3c315252"
- },
- "posts/welcome/index.qmd": {
- "index.html": "866fbff8"
- },
- "posts/wave-equation/index.qmd": {
- "index.html": "a1690d98"
- },
- "index.qmd": {
- "index.html": "a98cc6c9"
- },
- "about.qmd": {
- "about.html": "72c2ebbf"
- }
-}
\ No newline at end of file
diff --git a/src/.quarto/xref/a1690d98 b/src/.quarto/xref/a1690d98
deleted file mode 100644
index 208374ba72de8724ff6a1523d362f26cdfde279a..0000000000000000000000000000000000000000
--- a/src/.quarto/xref/a1690d98
+++ /dev/null
@@ -1 +0,0 @@
-{"entries":[],"headings":[]}
\ No newline at end of file
diff --git a/src/.quarto/xref/a841ef91 b/src/.quarto/xref/a841ef91
deleted file mode 100644
index d4be1fe6bb11dec1b1a275ed71c7ea9e563321f5..0000000000000000000000000000000000000000
--- a/src/.quarto/xref/a841ef91
+++ /dev/null
@@ -1 +0,0 @@
-{"entries":[],"headings":["chebyshev-polynomials-of-the-first-kind","chebyshev-nodes-of-the-first-kind","recurrence-relation","radial-plots"]}
\ No newline at end of file
diff --git a/src/.quarto/xref/a98cc6c9 b/src/.quarto/xref/a98cc6c9
deleted file mode 100644
index 208374ba72de8724ff6a1523d362f26cdfde279a..0000000000000000000000000000000000000000
--- a/src/.quarto/xref/a98cc6c9
+++ /dev/null
@@ -1 +0,0 @@
-{"entries":[],"headings":[]}
\ No newline at end of file
diff --git a/src/.quarto/xref/ecb70ff4 b/src/.quarto/xref/ecb70ff4
deleted file mode 100644
index 208374ba72de8724ff6a1523d362f26cdfde279a..0000000000000000000000000000000000000000
--- a/src/.quarto/xref/ecb70ff4
+++ /dev/null
@@ -1 +0,0 @@
-{"entries":[],"headings":[]}
\ No newline at end of file
diff --git a/src/_quarto.yml b/src/_quarto.yml
index 62bea81bf12fbab019b722179ecfa51fdb31aa74..a41821aec2d32fddee699764c4f28b07399069d1 100644
--- a/src/_quarto.yml
+++ b/src/_quarto.yml
@@ -2,7 +2,7 @@ project:
type: website
website:
- title: "quarto-blog"
+ title: "jojo-blog"
navbar:
right:
- about.qmd
diff --git a/src/posts/_metadata.yml b/src/posts/_metadata.yml
deleted file mode 100644
index 3e9dd01bc3de145a64472a950a828dd41dd167f0..0000000000000000000000000000000000000000
--- a/src/posts/_metadata.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-# options specified here will apply to all posts in this folder
-
-# freeze computational output
-# (see https://quarto.org/docs/projects/code-execution.html#freeze)
-freeze: true
-
-# Enable banner style title blocks
-title-block-banner: true
diff --git a/src/posts/fourier/images/odd_continuation.png b/src/posts/fourier/images/odd_continuation.png
deleted file mode 100644
index 9f22e4dee236d39201ec1a5672f903341e341767..0000000000000000000000000000000000000000
--- a/src/posts/fourier/images/odd_continuation.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9d765e2b941c2e72ed8273ebd9e6ec52f02b9520957fc38d570b1dace71226dd
-size 93224
diff --git a/src/posts/fourier/index.qmd b/src/posts/fourier/index.qmd
deleted file mode 100644
index 1630bad2bf01f6e58e94dc3000f151be553e4670..0000000000000000000000000000000000000000
--- a/src/posts/fourier/index.qmd
+++ /dev/null
@@ -1,309 +0,0 @@
----
-title: "Fourier Method for the Wave Equation"
-author: "JoJo"
-date: "2024-12-18"
-categories: [mathematics]
-image: "membrane.png"
-draft: true
----
-
-In this post we are going to explore the Fourier method for solving the 1D and 2D wave equations. The method is more known under the name of the method of separation of variables. For the 1D wave equation we are going to show the application of the method to a fixed string, and for the 2D wave equation we are going to apply the method to a rectangular membrane and a circular membrane. We are also going to attempt to outline the physical interpretations of all scenarios.
-
-# 1D Wave Equation
-
-## Fixed String
-
-First, let's take a look at the model of a string with length $l$ which is also fixed at both ends:
-
-\begin{equation}
-\left\{\begin{aligned}
-u_{tt} = a^2 u_{xx}, \\
-u(x, 0) = \varphi_1(x),\\
-u_t(x, 0) = \varphi_2(x), \\
-u(0, t) = u(l, t) = 0.
-\end{aligned}\right.
-\end{equation}
-
-We start solving the equation by taking into account only the boundary conditions $u(0, t) = u(l, t) = 0$. The idea is to find solution $u(x, t)$ of the form
-
-$$
-u(x, t) = X(x)T(t).
-$$
-
-We substitute this form of the solution into the wave equation and get
-
-$$
-\frac{1}{a^2} T^{\prime\prime}(t)X(x) = T(t)X^{\prime\prime}(x),
-$$
-
-further divding by $X(x)T(t)$ leads to
-
-$$
-\frac{1}{a^2} \frac{T^{\prime\prime}(t)}{T(t)} = \frac{X^{\prime\prime}(x)}{X(x)}.
-$$
-
-We have two functions of independent variables which are equal. This is only possible if they are equal to the same constant. Therefore, let
-
-$$
-\frac{1}{a^2} \frac{T^{\prime\prime}(t)}{T(t)} = \frac{X^{\prime\prime}(x)}{X(x)} = -\lambda,
-$$
-
-producing the following two equeations:
-
-$$
-T^{\prime\prime}(t) + a^2 \lambda T(t) = 0
-$$
-
-and
-
-$$\label{eq:ref}
-X^{\prime\prime}(x) + \lambda X(x) = 0. \tag{*}
-$$
-
-Let's begin with solving the second equation. The boundary conditions give
-
-$$
-X(0)T(t) = 0 \quad \text{and} \quad X(l)T(t) = 0.
-$$
-
-Because we are interested only in non-trivial solutions and thus $T \neq 0$, we have
-
-$$\label{eq:ref2}
-X(0) = 0 \quad \text{and} \quad X(l) = 0. \tag{**}
-$$
-
-Now, we have to find the non-trivial solutions for $X(x)$ satisfying
-
-$$
-\left\{\begin{align*}
-X^{\prime\prime}(x) + \lambda X(x) = 0, \\
-X(0) = 0, \quad X(l) = 0.
-\end{align*}\right.
-$$
-
-The above problem is an example of the so called **Sturm-Liouville problem**. In order to find the general solution of the second order linear homogeneous differential equation with constant coefficients $\eqref{eq:ref}$ we should solve its characteristic equation
-
-$$
-r^2 + \lambda = 0.
-$$
-
-- If $\lambda < 0$, then $r_{1, 2} = \pm \sqrt{-\lambda}$, hence the general solution is
-$$
-X(x) = c_1 e^{\sqrt{-\lambda}x} + c_2 e^{-\sqrt{-\lambda}x}
-$$
-for some constants $c_1$ and $c_2$. In order to determine the constants we substitute the above solution into the boundary conditions $\eqref{eq:ref2}$ and get the system
-$$
-\left\{\begin{align*}
-c_1 + c_2 = 0, \\
-c_1 e^{\sqrt{-\lambda}l} + c_2 e^{-\sqrt{-\lambda}l} = 0.
-\end{align*}\right.
-$$
-This results in $c_1 = c_2 = 0$, meaning our Sturm-Liouville problem doesn't have a non-zero solution for $\lambda < 0$.
-
-- If $\lambda = 0$, then $r_1 = r_2 = 0$ and the general solution is
-$$
-X(x) = c_1 + c_2 x.
-$$
-Substituing it into the boundary conditions $\eqref{eq:ref2}$ again lead to $c_1 = c_2 = 0$, hence no non-zero solutions of our Sturm-Liouville problem for $\lambda \leq 0$.
-
-- If $\lambda > 0$, then $r_{1, 2} = \pm i \sqrt{\lambda}$, and the general solution becomes
-$$
-X(x) = c_1 \cos{\left( \sqrt{\lambda} x \right)} + c_2 \sin{\left(\sqrt{\lambda}x\right)}.
-$$
-Substituting into the boundary conditions $\eqref{eq:ref2}$ results in
-$$
-\left\{\begin{align*}
-c_1 = 0, \\
-c_2 \sin{\left(\sqrt{\lambda}l\right)} = 0
-\end{align*}\right.
-$$
-If $c_2 = 0$, then $X(x) \equiv 0$ which is a trivial solution. Therefore, we set $c_2 \neq 0$ and hence
-$$
-\sin{\left(\sqrt{\lambda}l\right)} = 0,
-$$
-giving $\sqrt{\lambda}l = k \pi$, $k = \pm 1, \pm 2, ...$. Theerfore,
-$$
-\lambda = \lambda_k = \left(\frac{k \pi}{l}\right)^2,
-$$
-meaning eigenvalues exist when $\lambda > 0$. The eigenfunctions corresponding to the above eigenvalues are
-$$
-X_k(x) = \sin{\left(\frac{k \pi x}{l}\right)}, \quad k > 0, k \in N.
-$$
-
-Going back to $T^{\prime\prime}(t) + a^2 \lambda T(t) = 0$, solving in analogical way, when $\lambda = \lambda_k$ the solution becomes
-
-$$
-T_k(t) = A_k \cos{\left(\frac{ak\pi}{l}t\right)} + B_k \sin{\left(\frac{ak\pi}{l}t\right)}
-$$
-
-for some constants $A_k$ and $B_k$. Hence,
-
-$$
-u_k(x,t) = X_k(x) T_k(t) = \left(A_k \cos{\left(\frac{ak\pi}{l}t\right)} + B_k \sin{\left(\frac{ak\pi}{l}t\right)}\right) \sin{\left(\frac{k \pi x}{l}\right)}, \quad k > 0, k \in N
-$$
-
-are solutions to our wave equation, also satisfying the boundary conditions. Since our equation is linear, forming a linear system with its conditions, the **principle of superposition** is valid. In other words, if $u_1, u_2, ..., u_n$ are solutions of our system, then
-
-$$
-\alpha_1 u_1 + \alpha_2 u_2 + ... + \alpha_n u_n
-$$
-
-for some constants $\alpha_1, \alpha_2, ..., \alpha_n$ is also a solution of the system. But in our case we have an infinite number of functions $u_1, u_2, ...$ which satisfy the linear system. Therefore, we need the **generalised superposition principle** stating that in such case
-
-$$
-u = \sum_n^{\infty} \alpha_n u_n
-$$
-
-for some arbitrary constants $\alpha_n$ is a solution to the system if the series converges uniformly and is twice differentiable termwise. This generalisation is a Lemma and should be prooved. The proof can be found in ...
-
-Assuming we have prooved the said Lemma, we can state that our system has a solution of the form
-
-$$
-u(x, t) = \sum_{k=1}
-^{\infty} u_k(x, t) = \sum_{k=1}^{\infty} \left(A_k \cos{\left(\frac{ak\pi}{l}t\right)} + B_k \sin{\left(\frac{ak\pi}{l}t\right)}\right) \sin{\left(\frac{k \pi x}{l}\right)}.
-$$
-
-The next task we have to tackle is to determine the coefficients $A_k$ and $B_k$. We can achieve this by using the initial conditions
-
-$$
-u(x, 0) = \varphi_1(x), \quad \text{and} \quad u_t(x, 0) = \varphi_2(x).
-$$
-
-We get
-
-$$
-u(x, 0) = \sum_{k=1}
-^{\infty} A_k \sin{\left(\frac{k \pi x}{l}\right)} = \varphi_1(x)
-$$
-
-and
-
-$$
-u_t(x, 0) = \sum_{k=1}^{\infty} \frac{ak\pi}{l} B_k \sin{\left(\frac{k \pi x}{l}\right)} = \varphi_2(x).
-$$
-
-Now, we have to expand both $\varphi_1(x)$ and $\varphi_2(x)$ into series in terms of sines only (why?). We have
-
-$$
-\varphi_1(x) = \sum_{k=1}^{\infty} \varphi_k^{(1)} \sin{\left(\frac{k \pi}{l}x\right)}
-$$
-
-and
-
-$$
-\varphi_2(x) = \sum_{k=1}^{\infty} \varphi_k^{(2)} \sin{\left(\frac{k \pi}{l}x\right)}.
-$$
-
-By the Fourier series theroem of uniqueness, we get
-
-$$
-A_k = \varphi_k^{(1)} \quad \text{and} \quad B_k = \frac{l}{ak\pi} \varphi_k^{(2)},
-$$
-
-or (why?)
-
-$$
-A_k = \frac{2}{l} \int_{0}^{l} \varphi_1(x) \sin{\left(\frac{k \pi}{l}x\right)} \mathrm{d}x
-$$
-
-and
-
-$$
-B_k = \frac{2}{ak\pi} \int_{0}^{l} \varphi_2(x) \sin{\left(\frac{k \pi}{l}x\right)} \mathrm{d}x.
-$$
-
-We are left with the task of the covergence of the infinite series. We have to explore the following series
-
-$$
-|u(x, t)| \leq \sum_{k=1}^{\infty}(|A_k| + |B_k|),
-$$
-
-$$
-|u_t(x, t)| \leq \sum_{k=1}^{\infty}\frac{ak\pi}{l}(|A_k| + |B_k|),
-$$
-
-$$
-|u_x(x, t)| \leq \sum_{k=1}^{\infty}\frac{k\pi}{l}(|A_k| + |B_k|),
-$$
-
-$$
-|u_{tt}(x, t)| \leq \sum_{k=1}^{\infty}\frac{a^2 k^2 \pi^2}{l^2}(|A_k| + |B_k|),
-$$
-
-$$
-|u_{xx}(x, t)| \leq \sum_{k=1}^{\infty}\frac{k^2 \pi^2}{l^2}(|A_k| + |B_k|).
-$$
-
-If the series on the right side (majorizing series) converge then the series on the left would also converge and the needed differentiation would exist. It is enough (why?) for the following series to converge
-
-$$
-\sum_{k=1}^{\infty} k^j \left(|\varphi_k^{(1)}| + \frac{2}{ak\pi}|\varphi_k^{(2)}|\right), j = 0, 1, 2.
-$$
-
-This is possible only if
-
-$$
-\left\{\begin{align*}
-\sum_{k=1}^{\infty} k^j |\varphi_k^{(1)}|, \\
-\sum_{k=1}^{\infty} k^{j-1} |\varphi_k^{(2)}|,
-\end{align*}\right. \quad j = 0, 1, 2.
-$$
-
-converge. From Calculus we know (theorem) that if $\varphi(x)$ is $m$-times differentiable then
-
-$$
-\sum_{k=1}^{\infty} k^{m-1} |\varphi_k|
-$$
-
-convergres. Therefore, in order for all the majorzing series to converge it is enough $\varphi_1(x)$ to be $3$-times differentiable, and $\varphi_2(x)$ to be $2$-times differentiable.
-
-Finally, we should note a few things about the expansion of $\varphi_1(x)$ and $\varphi_2(x)$ into sine series. We have to note that in order to do that the function needs to be continued as an odd function which my lead to loss of the regularity of the lower derivatives. Let $\tilde{\varphi}_1(x)$ be the continuation of $\varphi_1(x)$ as an odd function (see the Figure below) defined as
-
-
-{width=50%}
-
-
-$$
-\tilde{\varphi}_1(x) = \left\{\begin{align*}
-\varphi_1(x), \quad 0 \leq x \leq l, \\
--\varphi_1(-x), \quad -l \leq x \leq 0.
-\end{align*}\right.
-$$
-
-Hence, in order for it to be continous and continously differentibale we need to enforce the following condition
-
-$$
-\varphi_1(0) = \varphi_1(l) = 0.
-$$
-
-To summarise, in order for $\sum_{k=1}^{\infty} \varphi_k^{(1)} \sin{\left( \frac{k\pi}{l}x\right)}$ to converge in $[0, l]$ it is necessary to enforce the above conditions to have zero values at both ends of the interval. As for the second derivative, if it exists it would be continuous as well. Similarly, for the third derivative to exist we enforce
-
-$$
-\varphi_1^{\prime\prime}(0) = \varphi_1^{\prime\prime}(l) = 0
-$$
-
-and obtain the corresponding necessary condition
-
-$$
-\varphi_2(0) = \varphi_2(l) = 0.
-$$
-
-Finally, after these enforced conditions we can conclude that (tehorem)
-
-$$
-u(x, t) = \sum_{k=1}^{\infty} \left(A_k \cos{\left(\frac{ak\pi}{l}t\right)} + B_k \sin{\left(\frac{ak\pi}{l}t\right)}\right) \sin{\left(\frac{k \pi x}{l}\right)}
-$$
-
-is a regular solution of the problem.
-
-**Physical interpretation:** TBD
-
-# 2D Wave Equation
-
-## Rectangular Membrane
-
-TBD
-
-## Circular Membrane
-
-TBD
diff --git a/src/posts/fourier/membrane.png b/src/posts/fourier/membrane.png
deleted file mode 100644
index 6dd387360392ebeabfe7ea0f73a2f36ba4de5fb5..0000000000000000000000000000000000000000
--- a/src/posts/fourier/membrane.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:a27452b4d93f732489b522160b6cc995a8c7e908af210db720d175961af9697f
-size 104578
diff --git a/src/posts/post-with-code/image.jpg b/src/posts/post-with-code/image.jpg
deleted file mode 100644
index 3ec04c8c4e169aa7cfbd882821eb0d436b62c93a..0000000000000000000000000000000000000000
Binary files a/src/posts/post-with-code/image.jpg and /dev/null differ
diff --git a/src/posts/post-with-code/index.qmd b/src/posts/post-with-code/index.qmd
deleted file mode 100644
index f66cf982a286511c672fc058f7bd6ef5f58d88fa..0000000000000000000000000000000000000000
--- a/src/posts/post-with-code/index.qmd
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: "Post With Code"
-author: "Harlow Malloc"
-date: "2024-12-17"
-categories: [news, code, analysis]
-image: "image.jpg"
-draft: true
----
-
-This is a post with executable code.
diff --git a/src/posts/wave-equation/circular_membrane.png b/src/posts/wave-equation/circular_membrane.png
deleted file mode 100644
index cf0a1d90228184976daaf76f864de64c55f68be3..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/circular_membrane.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:3d38f0e80f4ae2222393466e96eee29891ff787cb3bffec302b3ce8d578c073b
-size 87722
diff --git a/src/posts/wave-equation/code/circular_membrane.py b/src/posts/wave-equation/code/circular_membrane.py
deleted file mode 100644
index cfba7bd88a238ee8611f9640863d55ce68cde162..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/code/circular_membrane.py
+++ /dev/null
@@ -1,68 +0,0 @@
-import matplotlib.pyplot as plt
-import numpy as np
-from matplotlib.animation import FuncAnimation
-from scipy.optimize import root_scalar
-from scipy.special import jv as besselj
-
-
-def CircularMembrane(a=0.5, r=3, tmax=30, N=40):
- rho = np.linspace(0, r, 51) # Radial grid points
- phi = np.linspace(0, 2 * np.pi, 51) # Angular grid points
- t = np.linspace(0, tmax, 100) # Time steps
-
- # Find the first 40 positive zeros of the Bessel function J0
- mju = []
- for n in range(1, N + 1):
- zero = root_scalar(
- lambda x: besselj(0, x), bracket=[(n - 1) * np.pi, n * np.pi]
- )
- mju.append(zero.root)
- mju = np.array(mju)
-
- # Define the initial position function
- def tau(rho):
- return rho**2 * np.sin(np.pi * rho) ** 3
-
- # Compute the solution for given R and t
- def solution(R, t):
- y = np.zeros_like(R)
- for m in range(N):
- s = tau(R[0, :]) * R[0, :] * besselj(0, mju[m] * R[0, :] / r)
- A0m = 4 * np.trapezoid(s, R[0, :]) / ((r**2) * (besselj(1, mju[m]) ** 2))
- y += A0m * np.cos(a * mju[m] * t / r) * besselj(0, mju[m] * R / r)
- return y
-
- # Create a grid of points
- R, p = np.meshgrid(rho, phi)
- X = R * np.cos(p)
- Y = R * np.sin(p)
-
- # Set up the figure and axis for animation
- fig = plt.figure()
- ax = fig.add_subplot(111, projection="3d")
- ax.set_xlim(-r, r)
- ax.set_ylim(-r, r)
- ax.set_zlim(-30, 30)
- ax.set_xlabel("x")
- ax.set_ylabel("y")
- ax.set_zlabel("u(x,y,t)")
- ax.set_title("Circular Membrane")
-
- # Update function for animation
- def update(frame):
- ax.clear()
- Z = solution(R, frame)
- ax.plot_surface(X, Y, Z, cmap="viridis", vmin=-30, vmax=30)
- ax.set_xlim(-r, r)
- ax.set_ylim(-r, r)
- ax.set_zlim(-30, 30)
- ax.set_title("Circular Membrane")
- ax.set_xlabel("x")
- ax.set_ylabel("y")
- ax.set_zlabel("u(x,y,t)")
-
- # Create and save the animation
- anim = FuncAnimation(fig, update, frames=t, interval=50)
- anim.save("circular_membrane_animation.gif", writer="imagemagick", fps=20)
-
- plt.show()
diff --git a/src/posts/wave-equation/code/rectangular_membrane_1.py b/src/posts/wave-equation/code/rectangular_membrane_1.py
deleted file mode 100644
index 702c99e5613a494ca1f6b2efdc1e6ebca32cadb6..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/code/rectangular_membrane_1.py
+++ /dev/null
@@ -1,47 +0,0 @@
-import matplotlib.pyplot as plt
-import numpy as np
-from matplotlib.animation import FuncAnimation
-
-
-def rectangular_membrane_1(t_max: int = 6):
- t = np.linspace(0, t_max, 100) # Time points for animation
- x = np.linspace(0, np.pi, 51) # x grid
- y = np.linspace(0, np.pi, 51) # y grid
- X, Y = np.meshgrid(x, y)
-
- # Define the solution function
- def solution(x, y, t):
- return (
- np.cos(np.sqrt(2) * t) * np.sin(x) * np.sin(y)
- + np.sin(5 * t) * np.sin(4 * x) * np.sin(3 * y) / 5
- )
-
- # Set up the figure and axis for animation
- fig = plt.figure()
- ax = fig.add_subplot(111, projection="3d")
- ax.set_xlim(0, np.pi)
- ax.set_ylim(0, np.pi)
- ax.set_zlim(-1, 1)
- ax.set_xlabel("x")
- ax.set_ylabel("y")
- ax.set_zlabel("u(x,y,t)")
- ax.set_title("Rectangular Membrane")
-
- # Update function for FuncAnimation
- def update(frame):
- ax.clear() # Clear the previous frame
- Z = solution(X, Y, frame) # Compute the new Z values
- _ = ax.plot_surface(X, Y, Z, cmap="viridis", vmin=-1, vmax=1)
- ax.set_xlim(0, np.pi)
- ax.set_ylim(0, np.pi)
- ax.set_zlim(-1, 1)
- ax.set_xlabel("x")
- ax.set_ylabel("y")
- ax.set_zlabel("u(x,y,t)")
- ax.set_title("Rectangular Membrane")
-
- # Create and save the animation
- anim = FuncAnimation(fig, update, frames=t, interval=50)
- anim.save("rectangular_membrane_1_animation.gif", writer="imagemagick", fps=20)
-
- plt.show()
diff --git a/src/posts/wave-equation/code/rectangular_membrane_2.py b/src/posts/wave-equation/code/rectangular_membrane_2.py
deleted file mode 100644
index 3e96a5dcb1df3cbc40eee48c0cd0dbbc5ea0b158..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/code/rectangular_membrane_2.py
+++ /dev/null
@@ -1,69 +0,0 @@
-import matplotlib.pyplot as plt
-import numpy as np
-from matplotlib.animation import FuncAnimation
-
-
-def rectangular_membrane_2(a: float = 1, b: float = 2, c: float = np.pi, tmax: int = 6):
- t = np.linspace(0, tmax, 100) # Time points for animation
- x = np.linspace(0, a, 50) # x grid
- y = np.linspace(0, b, 50) # y grid
- X, Y = np.meshgrid(x, y)
-
- # Define the solution function
- def solution(x, y, t):
- z = 0
- for n in range(1, 31):
- for m in range(1, 31):
- lambda_nm = np.pi**2 * (n**2 / a**2 + m**2 / b**2)
- # Compute the coefficient Anm
- xx = np.linspace(0, a, 100)
- yy = np.linspace(0, b, 100)
- Anm = (
- 4
- * np.trapezoid(
- np.cos(np.pi / 2 + np.pi * xx / a) * np.sin(n * np.pi * xx / a),
- xx,
- )
- * np.trapezoid(
- np.cos(np.pi / 2 + np.pi * yy / b) * np.sin(m * np.pi * yy / b),
- yy,
- )
- / (a * b)
- )
- z += (
- Anm
- * np.cos(c * np.sqrt(lambda_nm) * t)
- * np.sin(n * np.pi * x / a)
- * np.sin(m * np.pi * y / b)
- )
- return z
-
- # Set up the figure and axis for animation
- fig = plt.figure()
- ax = fig.add_subplot(111, projection="3d")
- ax.set_xlim(0, a)
- ax.set_ylim(0, b)
- ax.set_zlim(-1, 1)
- ax.set_xlabel("x")
- ax.set_ylabel("y")
- ax.set_zlabel("u(x,y,t)")
- ax.set_title("Rectangular Membrane")
-
- # Update function for FuncAnimation
- def update(frame):
- ax.clear()
- Z = solution(X, Y, frame) # Compute the new Z values
- ax.plot_surface(X, Y, Z, cmap="viridis", vmin=-1, vmax=1)
- ax.set_xlim(0, a)
- ax.set_ylim(0, b)
- ax.set_zlim(-1, 1)
- ax.set_xlabel("x")
- ax.set_ylabel("y")
- ax.set_zlabel("u(x,y,t)")
- ax.set_title("Rectangular Membrane")
-
- # Create and save the animation
- anim = FuncAnimation(fig, update, frames=t, interval=50)
- anim.save("rectangular_membrane_2_animation.gif", writer="imagemagick", fps=20)
-
- plt.show()
diff --git a/src/posts/wave-equation/images/BesselJ_800.svg b/src/posts/wave-equation/images/BesselJ_800.svg
deleted file mode 100644
index c684d75b10be9dda2371daa2de1d57860c6fc12c..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/images/BesselJ_800.svg
+++ /dev/null
@@ -1,328 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/posts/wave-equation/images/circular_membrane_animation.gif b/src/posts/wave-equation/images/circular_membrane_animation.gif
deleted file mode 100644
index 3db06d20c13f3988f623072760795cc7e49d0b8b..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/images/circular_membrane_animation.gif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:8e1e20df4de44d7e6ebfe04cb9703defc1bb502f357ab9c97520966d8f7b2078
-size 2328205
diff --git a/src/posts/wave-equation/images/circular_membrane_t0.png b/src/posts/wave-equation/images/circular_membrane_t0.png
deleted file mode 100644
index dc25ee452bff36dd6df9a5dd0658e4996b165c1b..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/images/circular_membrane_t0.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:907f19c3f26e373f984f5a285ce9448cfd2df56150f53e51ac852fe3206a6005
-size 78215
diff --git a/src/posts/wave-equation/images/circular_membrane_t10.png b/src/posts/wave-equation/images/circular_membrane_t10.png
deleted file mode 100644
index e175b444b102d9749b0d16e1746de85469cfc639..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/images/circular_membrane_t10.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:4c88e20e07d69e4eedff327401c8bd09730ee80356f1ecc3bf6f7b53527cf128
-size 81757
diff --git a/src/posts/wave-equation/images/circular_membrane_t30.png b/src/posts/wave-equation/images/circular_membrane_t30.png
deleted file mode 100644
index cf0a1d90228184976daaf76f864de64c55f68be3..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/images/circular_membrane_t30.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:3d38f0e80f4ae2222393466e96eee29891ff787cb3bffec302b3ce8d578c073b
-size 87722
diff --git a/src/posts/wave-equation/images/rectangular_membrane_1_animation.gif b/src/posts/wave-equation/images/rectangular_membrane_1_animation.gif
deleted file mode 100644
index 959d9ae1d0e127bdf2431b7c4a2486ec18d099e0..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/images/rectangular_membrane_1_animation.gif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:faf6a0aa3a198a0df2661eab66b9a33addbd9a9567ca8197ba18bf15463b0b49
-size 3137947
diff --git a/src/posts/wave-equation/images/rectangular_membrane_1_t0.png b/src/posts/wave-equation/images/rectangular_membrane_1_t0.png
deleted file mode 100644
index eac53a9b0045855b38ab786dc804f2b8dcd7c48c..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/images/rectangular_membrane_1_t0.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7e2b1632c8aec922c1413a1e200a5240aa8dc447a0a6b5e02a3607801b17b925
-size 102210
diff --git a/src/posts/wave-equation/images/rectangular_membrane_1_t1.png b/src/posts/wave-equation/images/rectangular_membrane_1_t1.png
deleted file mode 100644
index 6dd387360392ebeabfe7ea0f73a2f36ba4de5fb5..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/images/rectangular_membrane_1_t1.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:a27452b4d93f732489b522160b6cc995a8c7e908af210db720d175961af9697f
-size 104578
diff --git a/src/posts/wave-equation/images/rectangular_membrane_1_t6.png b/src/posts/wave-equation/images/rectangular_membrane_1_t6.png
deleted file mode 100644
index 4216b30ecb6bd58eedc72b0e276bcc1685a7526c..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/images/rectangular_membrane_1_t6.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:c83a114bad66fc3fbf8f953884e37e2fa61fbfd56bed647c04d99a5b90cc2400
-size 103525
diff --git a/src/posts/wave-equation/images/rectangular_membrane_2_animation.gif b/src/posts/wave-equation/images/rectangular_membrane_2_animation.gif
deleted file mode 100644
index 86c2220d1dd7f45ea592f31fbee04b064bb7a61e..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/images/rectangular_membrane_2_animation.gif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:63fdb91146a8fad3593befeb4434d35293fa8e593b4d524a597f32b054c4261e
-size 3630400
diff --git a/src/posts/wave-equation/images/rectangular_membrane_2_t0.0.png b/src/posts/wave-equation/images/rectangular_membrane_2_t0.0.png
deleted file mode 100644
index 62af6346e8ec12e0e7765d90adf3cf1b873f3fcb..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/images/rectangular_membrane_2_t0.0.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d471ba6a54bad2c8b2b9001ce736cc65fcda579cd86ac681e84797c928060e50
-size 126130
diff --git a/src/posts/wave-equation/images/rectangular_membrane_2_t2.0.png b/src/posts/wave-equation/images/rectangular_membrane_2_t2.0.png
deleted file mode 100644
index 96fec3ac94c61c7b63fde986a4ce2537996512cc..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/images/rectangular_membrane_2_t2.0.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:172e1d9f845b723d0ed9dff020b178c5552c1f30b2bf55ae82a9ba76799b70f2
-size 127316
diff --git a/src/posts/wave-equation/images/rectangular_membrane_2_t4.5.png b/src/posts/wave-equation/images/rectangular_membrane_2_t4.5.png
deleted file mode 100644
index fc7f98b29549f36f3ecb8567c4c5323d85de9661..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/images/rectangular_membrane_2_t4.5.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:f466ede691cf644a4999833ca64dc434b12994cb41c6c92643a19c348a5470c7
-size 125926
diff --git a/src/posts/wave-equation/index.qmd b/src/posts/wave-equation/index.qmd
deleted file mode 100644
index 5d40fb1e7a8f1584d5caaff393e8b42cc5d63aec..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/index.qmd
+++ /dev/null
@@ -1,267 +0,0 @@
----
-title: "Wave Equation"
-author: "JoJo"
-date: "2024-12-19"
-categories: [mathematics, python]
-image: "./images/rectangular_membrane_1_animation.gif"
-draft: true
----
-
-Partial differential equations...
-
-# Introduction
-
-Let $u(x, y, t)$ be ...
-
-The homogenous wave equation is given by
-
-$$
-\frac{\partial^2 u}{\partial t^2} - c^2 (\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}) = 0
-$$
-
-or
-
-\begin{equation}
-u_{tt} - c^2 (u_{xx} + u_{yy}) = 0.
-\end{equation}
-
-# Physical interpretation
-
-The wave equation is a simplified model for a vibrating
-string (𝑛 = 1), membrane (𝑛 = 2), or elastic solid (𝑛 = 3). In these
-physical interpretations 𝑢(𝑥, 𝑡) represents the displacement in some direction
-of the point 𝑥 at time 𝑡 ≥ 0.
-
-1D and 2D Equations
-
-# Rectangular Membrane
-
-Pass
-
-$$
-D := \{0 < x < a, 0 < y < b\}
-$$
-
-...
-
-$$
-\left\{\begin{align*}
-u_{tt} - c^2 (u_{xx} + u_{yy}) = 0, (x,y,t) \in G = D \times (0, +\infty), \\
-u|_{t=0} = \varphi(x, y), u_t |_{t=0} = \psi(x, y), (x, y) \in \bar{D}, \\
-u|_{\partial D} = 0, t \geq 0.
-\end{align*}\right.
-$$
-
-...
-
-$$
-\varphi(x, y) \in C^3 (\bar{D}), \psi(x, y) \in C^2 (\bar{D})
-$$
-
-and ...
-
-$$
-\varphi |_{\partial D} = \varphi_{xx} |_{x = 0} = \varphi_{xx} |_{x = a} = \varphi_{yy} |_{y =0} = \varphi_{yy} |_{y = b} = \psi |_{\partial D} = 0.
-$$
-
-Solution... :
-
-$$
-u(x, y, t) = \sum_{n, m = 1}^{\infty} \left(A_{n, m} \cos{\sqrt{\lambda_{n, m}} ct} + B_{n, m} \sin{\sqrt{\lambda_{n, m}} ct} \right) \sin{\frac{\pi n}{a}} x \sin{\frac{\pi m}{b}} y,
-$$
-
-where
-
-$$
-\lambda_{n, m} = \left(\frac{\pi n}{a} \right)^2 + \left(\frac{\pi m}{b} \right)^2.
-$$
-
-From the initial conditions it follows
-
-$$
-A_{n, m} = \frac{4}{ab} \int_D \varphi(x, y) \sin{\frac{\pi n}{a}} x \sin{\frac{\pi m}{b}} y \mathrm{d}x \mathrm{d}y,
-$$
-
-and
-
-$$
-B_{n, m} = \frac{4}{abc\sqrt{\lambda_{n, m}}} \int_D \psi(x, y) \sin{\frac{\pi n}{a}} x \sin{\frac{\pi m}{b}} y \mathrm{d}x \mathrm{d}y.
-$$
-
-## Example 1
-
-...
-
-$$
-\left\{\begin{align*}
-u_{tt} - u_{xx} - u_{yy} = 0, 0 < x < \pi, 0 < y < \pi, t > 0, \\
-u|_{t=0} = \sin{x} \sin{y}, u_t |_{t=0} = \sin{4x} \sin{3y}, x, y \in (0, \pi), \\
-u|_{x = 0} = 0, u|_{x = \pi} = 0, 0 < y < \pi, t > 0, \\
-u|_{y = 0} = 0, u|_{y = \pi} = 0, 0 < x < \pi, t > 0.
-\end{align*}\right.
-$$
-
-Solution:
-
-$$
-u(x, y, t) = \sum_{n, m = 1}^{\infty} \left(A_{n, m} \cos{\sqrt{\lambda_{n, m}} t} + B_{n, m} \sin{\sqrt{\lambda_{n, m}} t} \right) \sin{n} x \sin{m} y,
-$$
-
-where
-
-$$
-\lambda_{n, m} = n^2 + m^2,
-$$
-
-$$
-A_{n, m} = \frac{4}{\pi^2} \int_0^\pi \sin{x} \sin{nx} \mathrm{d}x \int_0^\pi \sin{y} \sin{my} \mathrm{d}y,
-$$
-
-$$
-B_{n, m} = \frac{4}{\pi^2\sqrt{\lambda_{n, m}}} \int_0^\pi \sin{4x} \sin{nx} \mathrm{d}x \int_0^\pi \sin{3y} \sin{my} \mathrm{d}y.
-$$
-
-Therefore, $A_{1, 1} = 1$, $B_{4, 3} = \frac{1}{5}$, and every other coefficients is equal to $0$. Finally,
-
-$$
-u(x, y, t) = \cos{\sqrt{2}t} \sin{x} \sin{y} + \frac{1}{5} \sin{5t} \sin{4x} \sin{3y}.
-$$
-
-For $t \in [0, 6]$:
-
-Animation:
-
-
-
-```{python}
-#| code-fold: true
-#| code-summary: "Click to expand the code"
-{{< include ./code/rectangular_membrane_1.py >}}
-```
-
-Snapshots:
-
-{width=33%}{width=33%}{width=33%}
-
-## Example 2
-
-...
-
-$$
-\left\{\begin{align*}
-u_{tt} - \pi^2 (u_{xx} + u_{yy}) = 0, 0 < x < 1, 0 < y < 2, t > 0, \\
-u|_{t=0} = \cos{\left(\left(x + \frac{1}{2}\right)\pi\right)} \cos{\left(\frac{\pi}{2}\left(y + 1\right)\right)}, u_t |_{t=0} = 0, 0 \leq x \leq 1, 0 \leq y \leq 2, \\
-u|_{x = 0} = 0, u|_{x = 1} = 0, 0 \leq y < 2, t \geq 0, \\
-u|_{y = 0} = 0, u|_{y = 2} = 0, 0 \leq x \leq 1, t \geq 0.
-\end{align*}\right.
-$$
-
-Solution with Fourier method:
-
-$$
-u(x, y, t) = \sum_{n, m = 1}^{\infty} \left(A_{n, m} \cos{\sqrt{\lambda_{n, m}} t} + B_{n, m} \sin{\sqrt{\lambda_{n, m}} t} \right) \sin{\pi n} x \sin{\pi m} y,
-$$
-
-where
-
-$$
-\lambda_{n, m} = \pi^2 (n^2 + m^2)
-$$
-
-and
-
-$$
-B_{n, m} = 0.
-$$
-
-$$
-A_{n, m} = 2 \int_{0}^{1} \cos{\left(\left(x + \frac{1}{2}\right)\pi\right)} \sin{\pi nx} \mathrm{d}x \int_0^2 \cos{\left(\frac{\pi}{2}\left(y + 1\right)\right)} \sin{\pi my} \mathrm{d}y.
-$$
-
-Visualising the solution for $t \in [0, 6]$ with the partial sum
-
-$$
-\tilde{u}(x, y, t) = \sum_{n, m = 1}^{30} A_{n, m} \cos{\sqrt{\lambda_{n, m}} t} \sin{\pi n} x \sin{\pi m} y.
-$$
-
-Animation:
-
-
-
-```{python}
-#| code-fold: true
-#| code-summary: "Click to expand the code"
-{{< include ./code/rectangular_membrane_2.py >}}
-```
-
-Snapshots:
-
-{width=33%}{width=33%}{width=33%}
-
-# Circular Membrane
-
-Pass
-
-$$
-\left\{\begin{align*}
-u_{tt} - \frac{1}{4} (u_{xx} + u_{yy}) = 0, x^2 + y^2 < 9, t > 0, \\
-u|_{t=0} = (x^2 + y^2) \sin^3(\pi \sqrt{x^2 + y^2}), u_t |_{t=0} = 0, x^2 + y^2 \leq 9, \\
-u|_{x^2 + y^2 = 9} = 0, t \geq 0.
-\end{align*}\right.
-$$
-
-Fourier method: Change to polar coordinates
-
-$$
-\left\{\begin{align*}
-x = \rho \cos(\varphi), \\
-y = \rho \sin(\varphi)
-\end{align*}\right.
-$$
-
-...
-
-Then the function in the first initial condition $u |_{t=0}$ becomes
-
-$$
-\tau(\rho) = \rho^2 \sin^3(\pi \rho)
-$$
-
-which is radially symmetric and hence the solution will be also radially symmetric. It is given by
-
-$$
-u(\rho, t) = \sum_{m=1}^{\infty} A_m \cos{\frac{a \mu_m^{(0)}t}{r}} J_0\left(\frac{\mu_m^{(0)}}{r}\rho\right),
-$$
-
-where
-
-$$
-A_m = \frac{4}{r^2 J_1^2(\mu_m^{(0)})} \int_0^r \rho^3 \sin^3(\pi \rho) J_0\left(\frac{\mu_m^{(0)}}{r}\rho\right) d\rho,
-$$
-
-and $\mu_m^{(0)}$ are the positive solutions to $J_0(\mu) = 0$.
-
-...
-
-
-
-...
-
-Animation:
-
-
-
-```{python}
-#| code-fold: true
-#| code-summary: "Click to expand the code"
-{{< include ./code/circular_membrane.py >}}
-```
-
-Snapshots:
-
-{width=33%}{width=33%}{width=33%}
-
-# References
-
-- [1](https://www.amazon.co.uk/Partial-Differential-Equations-Graduate-Mathematics/dp/1470469421/ref=sr_1_3?crid=2BINQDJ5R7XUB&dib=eyJ2IjoiMSJ9.GgU4uQBUKYO960lL6EjVJjksjFysLhCJKEHP436_saFGnfKf4uvgqyl_3WBjV779K4AwonOY5XnkRxVFCIqqGZCCE3I8YEjIC7mzvLwUa2lBPvByBCoFxTvGhrSKGLiAKlAvTVFSlbwklqyWEj4o852csy80_D3G2Gk9pedHKz22vqyc8UI8HAxWZ1wfu5bNoaqOOEDhy0W2XLaSijLCENnzVXjxTLS5xZkMCXr72G0.NeT6LdhY-WV9xVA26fbGHp37FbAKGo7mLwpV9m_2Rdk&dib_tag=se&keywords=partial+differential+equations&nsdOptOutParam=true&qid=1734133658&sprefix=partial+diff%2Caps%2C129&sr=8-3)
-- [2](https://mathworld.wolfram.com/BesselFunctionoftheFirstKind.html)
diff --git a/src/posts/wave-equation/rectangular_membrane_1_animation.gif b/src/posts/wave-equation/rectangular_membrane_1_animation.gif
deleted file mode 100644
index 8188605dedda846b20f848580c73d0a37661bd4b..0000000000000000000000000000000000000000
--- a/src/posts/wave-equation/rectangular_membrane_1_animation.gif
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:f206376af446df6a0ccedf4e1c357d4dada2f5b1449bfd7a992a0969ff2c3e34
-size 1255522
diff --git a/src/posts/welcome/index.qmd b/src/posts/welcome/index.qmd
deleted file mode 100644
index 9f0868081bab5472f31bb3c41061918b4647b413..0000000000000000000000000000000000000000
--- a/src/posts/welcome/index.qmd
+++ /dev/null
@@ -1,13 +0,0 @@
----
-title: "Welcome To My Blog"
-author: "Tristan O'Malley"
-date: "2024-12-16"
-categories: [news]
-draft: true
----
-
-This is the first post in a Quarto blog. Welcome!
-
-
-
-Since this post doesn't specify an explicit `image`, the first image in the post will be used in the listing page of posts.
diff --git a/src/posts/welcome/thumbnail.jpg b/src/posts/welcome/thumbnail.jpg
deleted file mode 100644
index 8e3107c9e0a0b43b424bcad3e04f6ece0f8ddb14..0000000000000000000000000000000000000000
Binary files a/src/posts/welcome/thumbnail.jpg and /dev/null differ