Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc] Add Navier Stokes inverse problem and Update Dimensional Analysis #16

Merged
merged 5 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 93 additions & 1 deletion docs/unit-examples-forward/Burgers_RAR.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,99 @@
"$$\n",
"u(-1,t)=u(1,t)=0, \\quad u(x,0) = - \\sin(\\pi x).\n",
"$$\n",
"\n"
"\n",
"## Dimensional Analysis\n",
"\n",
"### Step 1: Assign Dimensions to Variables\n",
"\n",
"1. **Spatial Coordinate $x$:**\n",
" - The dimension of $x$ is length:\n",
" $$\n",
" [x] = L.\n",
" $$\n",
"\n",
"2. **Time $t$:**\n",
" - The dimension of time is:\n",
" $$\n",
" [t] = T.\n",
" $$\n",
"\n",
"3. **Velocity $u$:**\n",
" - Velocity has dimensions of length per unit time:\n",
" $$\n",
" [u] = L / T.\n",
" $$\n",
"\n",
"4. **Viscosity $\\nu$:**\n",
" - The term $\\nu \\frac{\\partial^2 u}{\\partial x^2}$ involves the second spatial derivative of velocity, which must have the same dimensions as the time derivative $\\frac{\\partial u}{\\partial t}$.\n",
"\n",
"---\n",
"\n",
"### Step 2: Analyze the Dimensions of Each Term\n",
"\n",
"1. **Time Derivative Term:**\n",
" - The time derivative $\\frac{\\partial u}{\\partial t}$ has dimensions:\n",
" $$\n",
" \\left[\\frac{\\partial u}{\\partial t}\\right] = \\frac{[u]}{[t]} = \\frac{L / T}{T} = \\frac{L}{T^2}.\n",
" $$\n",
"\n",
"2. **Advection Term:**\n",
" - The advection term $u \\frac{\\partial u}{\\partial x}$ involves the spatial derivative of velocity:\n",
" $$\n",
" \\left[u \\frac{\\partial u}{\\partial x}\\right] = [u] \\cdot \\frac{[u]}{[x]} = \\frac{L}{T} \\cdot \\frac{L / T}{L} = \\frac{L}{T^2}.\n",
" $$\n",
"\n",
"3. **Diffusion Term:**\n",
" - The diffusion term $\\nu \\frac{\\partial^2 u}{\\partial x^2}$ involves the second spatial derivative of velocity:\n",
" $$\n",
" \\left[\\frac{\\partial^2 u}{\\partial x^2}\\right] = \\frac{[u]}{[x]^2} = \\frac{L / T}{L^2} = \\frac{1}{L T}.\n",
" \n",
" $$\n",
" - Therefore, the diffusion term has dimensions:\n",
" $$\n",
" \\left[\\nu \\frac{\\partial^2 u}{\\partial x^2}\\right] = [\\nu] \\cdot \\frac{1}{L T} = \\frac{L}{T^2}.\n",
" $$\n",
"\n",
"---\n",
"\n",
"### Step 3: Determine the Dimensions of $\\nu$\n",
"\n",
"- The diffusion term $\\nu \\frac{\\partial^2 u}{\\partial x^2}$ must have the same dimensions as the time derivative $\\frac{\\partial u}{\\partial t}$:\n",
" $$\n",
" [\\nu] \\cdot \\frac{1}{L T} = \\frac{L}{T^2} \\implies [\\nu] = \\frac{L^2}{T}.\n",
" $$\n",
"- Therefore, the viscosity $\\nu$ has dimensions of kinematic viscosity:\n",
" $$\n",
" [\\nu] = \\frac{L^2}{T}.\n",
" $$\n",
"\n",
"---\n",
"\n",
"### Step 4: Summary of Dimensions\n",
"\n",
"| Variable/Parameter | Physical Meaning | Dimensions |\n",
"|------------------------|-----------------------------------|-----------------------|\n",
"| $x$ | Spatial coordinate | $L$ |\n",
"| $t$ | Time | $T$ |\n",
"| $u$ | Velocity | $L / T$ |\n",
"| $\\nu$ | Kinematic viscosity | $L^2 / T$ |\n",
"\n",
"---\n",
"\n",
"### Step 5: Initial and Boundary Conditions\n",
"\n",
"1. **Boundary Conditions:**\n",
" - The boundary conditions $u(-1,t) = u(1,t) = 0$ are given in meters per second:\n",
" $$\n",
" [u(-1,t)] = [u(1,t)] = L / T.\n",
" $$\n",
"\n",
"2. **Initial Condition:**\n",
" - The initial condition $u(x,0) = -\\sin(\\pi x)$ is given in meters per second:\n",
" $$\n",
" [u(x,0)] = L / T.\n",
" $$\n",
" - The term $\\sin(\\pi x)$ is dimensionless because $x$ is in meters, and $\\pi$ is a dimensionless constant."
]
},
{
Expand Down
127 changes: 126 additions & 1 deletion docs/unit-examples-forward/Laplace_disk.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,132 @@
"y(r, \\theta +2\\pi) = y(r, \\theta).\n",
"$$\n",
"\n",
"The reference solution is $y=r\\cos(\\theta)$."
"The reference solution is $y=r\\cos(\\theta)$.\n",
"\n",
"# Dimensional Analysis for the Laplace Equation on a Disk\n",
"\n",
"## Problem Setup\n",
"\n",
"We will solve the Laplace equation in a polar coordinate system:\n",
"\n",
"$$\n",
"r\\frac{dy}{dr} + r^2\\frac{d^2y}{dr^2} + \\frac{d^2y}{d\\theta^2} = 0, \\qquad r \\in [0, 1], \\quad \\theta \\in [0, 2\\pi]\n",
"$$\n",
"\n",
"with the Dirichlet boundary condition:\n",
"\n",
"$$\n",
"y(1,\\theta) = \\cos(\\theta)\n",
"$$\n",
"\n",
"and the periodic boundary condition:\n",
"\n",
"$$\n",
"y(r, \\theta + 2\\pi) = y(r, \\theta).\n",
"$$\n",
"\n",
"The reference solution is:\n",
"\n",
"$$\n",
"y = r\\cos(\\theta).\n",
"$$\n",
"\n",
"---\n",
"\n",
"## Dimensional Analysis\n",
"\n",
"### Step 1: Assign Dimensions to Variables\n",
"\n",
"1. **Radial Coordinate $r$:**\n",
" - The dimension of $r$ is length:\n",
" $$\n",
" [r] = L.\n",
" $$\n",
"\n",
"2. **Angular Coordinate $\\theta$:**\n",
" - The dimension of $\\theta$ is dimensionless:\n",
" $$\n",
" [\\theta] = 1.\n",
" $$\n",
"\n",
"3. **Solution $y$:**\n",
" - The solution $y$ represents a physical quantity, which we assume to be in volts (V):\n",
" $$\n",
" [y] = V.\n",
" $$\n",
"\n",
"---\n",
"\n",
"### Step 2: Analyze the Dimensions of Each Term\n",
"\n",
"1. **First Derivative Term $r\\frac{dy}{dr}$:**\n",
" - The first derivative $\\frac{dy}{dr}$ has dimensions:\n",
" $$\n",
" \\left[\\frac{dy}{dr}\\right] = \\frac{[y]}{[r]} = \\frac{V}{L}.\n",
" $$\n",
" - Therefore, the term $r\\frac{dy}{dr}$ has dimensions:\n",
" $$\n",
" \\left[r\\frac{dy}{dr}\\right] = [r] \\cdot \\frac{V}{L} = L \\cdot \\frac{V}{L} = V.\n",
" $$\n",
"\n",
"2. **Second Derivative Term $r^2\\frac{d^2y}{dr^2}$:**\n",
" - The second derivative $\\frac{d^2y}{dr^2}$ has dimensions:\n",
" $$\n",
" \\left[\\frac{d^2y}{dr^2}\\right] = \\frac{[y]}{[r]^2} = \\frac{V}{L^2}.\n",
" $$\n",
" - Therefore, the term $r^2\\frac{d^2y}{dr^2}$ has dimensions:\n",
" $$\n",
" \\left[r^2\\frac{d^2y}{dr^2}\\right] = [r]^2 \\cdot \\frac{V}{L^2} = L^2 \\cdot \\frac{V}{L^2} = V.\n",
" $$\n",
"\n",
"3. **Second Derivative Term $\\frac{d^2y}{d\\theta^2}$:**\n",
" - The second derivative $\\frac{d^2y}{d\\theta^2}$ has dimensions:\n",
" $$\n",
" \\left[\\frac{d^2y}{d\\theta^2}\\right] = \\frac{[y]}{[\\theta]^2} = \\frac{V}{1^2} = V.\n",
" $$\n",
"\n",
"---\n",
"\n",
"### Step 3: Verify Dimensional Consistency\n",
"\n",
"The Laplace equation in polar coordinates is:\n",
"\n",
"$$\n",
"r\\frac{dy}{dr} + r^2\\frac{d^2y}{dr^2} + \\frac{d^2y}{d\\theta^2} = 0.\n",
"$$\n",
"\n",
"Each term in the equation has dimensions of $V$:\n",
"\n",
"- $r\\frac{dy}{dr}$: $V$\n",
"- $r^2\\frac{d^2y}{dr^2}$: $V$\n",
"- $\\frac{d^2y}{d\\theta^2}$: $V$\n",
"\n",
"Since all terms have the same dimensions, the equation is dimensionally consistent.\n",
"\n",
"---\n",
"\n",
"### Step 4: Summary of Dimensions\n",
"\n",
"| Variable/Parameter | Physical Meaning | Dimensions |\n",
"|------------------------|-----------------------------------|-----------------------|\n",
"| $r$ | Radial coordinate | $L$ |\n",
"| $\\theta$ | Angular coordinate | $1$ (dimensionless) |\n",
"| $y$ | Solution (e.g., voltage) | $V$ |\n",
"\n",
"---\n",
"\n",
"### Step 5: Initial and Boundary Conditions\n",
"\n",
"1. **Boundary Condition $y(1,\\theta) = \\cos(\\theta)$:**\n",
" - The boundary condition $y(1,\\theta) = \\cos(\\theta)$ is given in volts:\n",
" $$\n",
" [y(1,\\theta)] = V.\n",
" $$\n",
" - The term $\\cos(\\theta)$ is dimensionless because $\\theta$ is dimensionless.\n",
"\n",
"2. **Periodic Boundary Condition $y(r, \\theta + 2\\pi) = y(r, \\theta)$:**\n",
" - The periodic boundary condition ensures that the solution is periodic in $\\theta$ with period $2\\pi$.\n",
" - Since $\\theta$ is dimensionless, the condition is dimensionally consistent.\n"
]
},
{
Expand Down
Loading
Loading