Skip to content

Commit 82ec267

Browse files
committed
Restructured entire project to be a quarto website to put on github
pages
1 parent fe7ad01 commit 82ec267

File tree

104 files changed

+43837
-95385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+43837
-95385
lines changed

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
branches: main
5+
6+
name: Quarto Publish
7+
8+
jobs:
9+
build-deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Check out repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Quarto
18+
uses: quarto-dev/quarto-actions/setup@v2
19+
20+
- name: Render and Publish
21+
uses: quarto-dev/quarto-actions/publish@v2
22+
with:
23+
target: gh-pages
24+
render: false
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
**.quarto/
1+
/.quarto/
2+
/_site/

_freeze/experiments/schrodingers/index/execute-results/html.json

Lines changed: 16 additions & 0 deletions
Large diffs are not rendered by default.
62.2 KB

schrodingers/schrodingers_files/figure-html/cell-12-output-1.png renamed to _freeze/experiments/schrodingers/index/figure-html/cell-12-output-1.png

File renamed without changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"hash": "08c5215eee86187430c771eb0be34bc2",
3+
"result": {
4+
"engine": "jupyter",
5+
"markdown": "---\ntitle: Poisson's Equation (Voltage)\nimage: voltage.png\n---\n\nImport required libraries\n\n::: {#23089e97 .cell execution_count=2}\n``` {.python .cell-code}\nimport matplotlib.pyplot as plt\nfrom matplotlib.animation import FuncAnimation\nimport numpy as np\nfrom IPython.display import HTML\n```\n:::\n\n\nSet up the data required\n\n::: {#1d3c9a20 .cell execution_count=3}\n``` {.python .cell-code}\nsize = 50\nvoltages = np.zeros((size, size))\nV0 = 50\ncond = -0.5\nvoltages[10, 10] = V0\n```\n:::\n\n\nThe partial differential equation we are solving is \n$$\n \\nabla V = -\\frac{1}{\\epsilon_0}\\rho\n$$\n\nthe right hand side is `cond`. Then we can solve this with the boundaries of a 50x50 having a voltage of 0.\nTo solve this we can use the following formula for $u_{i,j}$\n$$\nu_{i,j} = \\frac{1}{4}(u_{i,j+1}+u_{i+1,j}+u_{i,j-1}+u_{i-1,j}-cond)\n$$\n\n::: {#d183702c .cell execution_count=4}\n``` {.python .cell-code}\nfor _ in range(500):\n for i in range(size):\n for j in range(size):\n u1 = voltages[i, j + 1] if j + 1 < size else 0\n u2 = voltages[i, j - 1] if j - 1 > -1 else 0\n u3 = voltages[i + 1, j] if i + 1 < size else 0\n u4 = voltages[i - 1, j] if i - 1 > -1 else 0\n voltages[i, j] = (u1 + u2 + u3 + u4 - cond) / 4\n```\n:::\n\n\nThen we get the gradient of this to find the electric field\n\n::: {#56e4bf15 .cell execution_count=5}\n``` {.python .cell-code}\npos = np.array(range(size))\n\ndy, dx = np.gradient(-voltages, pos, pos)\n```\n:::\n\n\nThen we graph it \n\n::: {#1a828a65 .cell execution_count=6}\n``` {.python .cell-code}\nskip = 5 # Number of points to skip\nplt.figure()\nplt.imshow(\n np.abs(voltages),\n extent=(0, size, 0, size),\n origin=\"lower\",\n cmap=\"viridis\",\n)\nplt.colorbar(label=\"Voltage\")\nplt.quiver(\n pos[::skip],\n pos[::skip],\n dx[::skip, ::skip],\n dy[::skip, ::skip],\n color=\"r\",\n headlength=3,\n)\nplt.title(\"Scalar Field using contour\")\nplt.xlabel(\"X-axis\")\nplt.ylabel(\"Y-axis\")\n\nplt.show()\n```\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-6-output-1.png){}\n:::\n:::\n\n\n",
6+
"supporting": [
7+
"index_files/figure-html"
8+
],
9+
"filters": [],
10+
"includes": {}
11+
}
12+
}
47.4 KB

_freeze/experiments/wave_equation/index/execute-results/html.json

Lines changed: 16 additions & 0 deletions
Large diffs are not rendered by default.

wave_equation/wave_files/figure-html/cell-5-output-2.png renamed to _freeze/experiments/wave_equation/index/figure-html/cell-5-output-2.png

File renamed without changes.

schrodingers/schrodingers_files/libs/clipboard/clipboard.min.js renamed to _freeze/site_libs/clipboard/clipboard.min.js

File renamed without changes.

0 commit comments

Comments
 (0)