Skip to content

Commit 99a4149

Browse files
author
Daniel Precioso, PhD
committed
Refine section titles: remove enumerations and enhance clarity across multiple PDE modules
1 parent e348c88 commit 99a4149

7 files changed

Lines changed: 31 additions & 30 deletions

File tree

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ FOLLOW these rules:
2626
* Speak directly to the reader using "you" and "your."
2727
* The output should read clean, concise, and natural—like something a human wrote.
2828
* Before finalizing, review and ensure there are no em dashes.
29+
* Never use enumerations in section titles or headings. Use descriptive headings without prefixes like "Step 1", "1)", or "Track 2".
2930

3031
DO NOT:
3132
* Use em dashes (only commas, periods, or semicolons are allowed).

modules/networks/index.qmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ By the end of this session, you should be able to:
8383

8484
## Flow of this Session
8585

86-
### 1) Fundamentals: graphs in `networkx`
86+
### Fundamentals: graphs in `networkx`
8787

8888
NetworkX is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks [@hagberg2008networkx].
8989

@@ -104,7 +104,7 @@ You will practice:
104104

105105
These concepts follow the formal definitions of nodes, links, directed and weighted graphs introduced in the lecture notes.
106106

107-
### 2) Connectivity + centrality
107+
### Connectivity + centrality
108108

109109
Next we measure structure:
110110

@@ -113,7 +113,7 @@ Next we measure structure:
113113
* clustering coefficient,
114114
* centrality measures (degree/closeness/betweenness/PageRank) and what they mean.
115115

116-
### 3) Graph models (synthetic networks)
116+
### Graph models (synthetic networks)
117117

118118
We generate synthetic networks to compare structure:
119119

@@ -130,7 +130,7 @@ You will measure:
130130
* Clustering coefficient.
131131
* Degree distribution.
132132

133-
### 4) Spreading: SIS and SIR
133+
### Spreading: SIS and SIR
134134

135135
This is the core computational part of the lab.
136136

modules/pde/gierer-meinhardt-1d.qmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ plt.show()
5757
plt.close()
5858
```
5959
60-
## Step 1: Discretize the Laplacian
60+
## Discretize the Laplacian
6161
6262
In one dimension, the Laplacian is the second derivative:
6363
@@ -94,7 +94,7 @@ def laplacian_1d(values, dx):
9494
```
9595
:::
9696
97-
## Step 2: Choose Boundary Conditions
97+
## Choose Boundary Conditions
9898
9999
We need one more ingredient before we time step the PDE: what happens at the edges of the domain?
100100
@@ -118,7 +118,7 @@ You prescribe fixed values at the endpoints.
118118
119119
In this page we will use **Neumann** boundary conditions because they are easy to interpret in a chemical setting.
120120
121-
## Step 3: Initialize the Fields
121+
## Initialize the Fields
122122
123123
Start from the homogeneous state and add a small perturbation.
124124
@@ -149,7 +149,7 @@ uv += uv * np.random.randn(2, num_points) / 100
149149
150150
Why do we add noise? A perfectly uniform initial condition can hide an instability. Small perturbations reveal whether the system amplifies spatial differences.
151151
152-
## Step 4: Build the PDE Right-Hand Side
152+
## Build the PDE Right-Hand Side
153153
154154
Use your Laplacian helper for both $u$ and $v$, then add the reaction terms.
155155
@@ -186,7 +186,7 @@ def gierer_meinhardt_pde(t, uv, gamma=1, a=0.40, b=1.00, d=20, dx=0.5):
186186
```
187187
:::
188188
189-
## Step 5: Advance in Time
189+
## Advance in Time
190190
191191
We will use explicit Euler:
192192
@@ -222,7 +222,7 @@ for _ in range(num_iter):
222222
```
223223
:::
224224
225-
## Step 6: Plot the Pattern
225+
## Plot the Pattern
226226
227227
```python
228228
import matplotlib.pyplot as plt

modules/pde/gierer-meinhardt-2d.qmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ plt.show()
6060
plt.close()
6161
```
6262
63-
## Step 1: Discretize the 2D Laplacian
63+
## Discretize the 2D Laplacian
6464
6565
This is the real jump from the previous page. In 1D, every point had two nearest neighbors. In 2D, every point in the interior has four cardinal neighbors, so the Laplacian becomes a stencil on a grid.
6666
@@ -105,7 +105,7 @@ def laplacian_2d(field, dx):
105105
This stencil assumes periodic wrapping through `np.roll()`. If you want Neumann boundaries, you still need to overwrite the edges after every Euler step.
106106
:::
107107
108-
## Step 2: Initialize the Grid
108+
## Initialize the Grid
109109
110110
```python
111111
import numpy as np
@@ -134,7 +134,7 @@ uv += uv * np.random.randn(2, num_x, num_y) / 100
134134
```
135135
:::
136136
137-
## Step 3: Build the PDE Right-Hand Side
137+
## Build the PDE Right-Hand Side
138138
139139
```python
140140
def gierer_meinhardt_pde_2d(t, uv, gamma=1, a=0.40, b=1.00, d=20, dx=1):
@@ -169,7 +169,7 @@ def gierer_meinhardt_pde_2d(t, uv, gamma=1, a=0.40, b=1.00, d=20, dx=1):
169169
```
170170
:::
171171
172-
## Step 4: Time Step with Euler's Method
172+
## Time Step with Euler's Method
173173
174174
Before you animate anything, validate the numerical update with a long loop and one static snapshot. That is the same workflow we used in earlier sessions: get the update rule right first, then wrap it in animation logic.
175175
@@ -201,7 +201,7 @@ for _ in range(num_iter):
201201
```
202202
:::
203203
204-
## Step 5: Plot a Snapshot
204+
## Plot a Snapshot
205205
206206
```python
207207
import matplotlib.pyplot as plt
@@ -219,7 +219,7 @@ plt.colorbar(im, ax=ax, label="v(x, y)")
219219
plt.show()
220220
```
221221
222-
## Step 6: Animate the Simulation
222+
## Animate the Simulation
223223
224224
```python
225225
import matplotlib.animation as animation

modules/pde/gray-scott-art.qmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Start from the animation on the previous page. Now we will turn it into a small
88

99
This is the same pattern you already saw in the interactive pages from earlier sessions: keep the model update fixed, then wrap it with event handlers and controls.
1010

11-
## Step 1: Draw on the Field
11+
## Draw on the Field
1212

1313
Left click should add a local perturbation and right click should reset a small patch to the base state.
1414

@@ -53,7 +53,7 @@ def update_uv(event: MouseEvent, r: int = 3):
5353
```
5454
:::
5555

56-
## Step 2: Allow Continuous Drawing
56+
## Allow Continuous Drawing
5757

5858
Use three event handlers so the perturbation follows the mouse while the button is pressed.
5959

@@ -97,7 +97,7 @@ def on_motion(event: MouseEvent):
9797
```
9898
:::
9999

100-
## Step 3: Pause and Resume with the Keyboard
100+
## Pause and Resume with the Keyboard
101101

102102
```python
103103
from matplotlib.backend_bases import KeyEvent
@@ -121,7 +121,7 @@ def on_keypress(event: KeyEvent):
121121
```
122122
:::
123123

124-
## Step 4: Add Sliders for the Parameters
124+
## Add Sliders for the Parameters
125125

126126
```python
127127
from matplotlib.widgets import Slider
@@ -160,7 +160,7 @@ def update_sliders(_):
160160
```
161161
:::
162162

163-
## Step 5: Put It Together
163+
## Put It Together
164164

165165
Inside your animation callback, respect the `pause` flag before advancing the PDE.
166166

modules/pde/gray-scott.qmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ plt.show()
5151
plt.close()
5252
```
5353
54-
## Step 1: Start from the Homogeneous State
54+
## Start from the Homogeneous State
5555
5656
Gray-Scott is usually initialized near the steady state $(u, v) = (1, 0)$, then a small patch is perturbed.
5757
@@ -84,7 +84,7 @@ uv[:, c - r : c + r, c - r : c + r] *= 1 + noise
8484
```
8585
:::
8686
87-
## Step 2: Reuse the 2D Laplacian
87+
## Reuse the 2D Laplacian
8888
8989
We will start with the 5-point stencil. If you implemented the previous page cleanly, you can reuse that helper almost unchanged.
9090
@@ -110,7 +110,7 @@ def laplacian(field):
110110
```
111111
:::
112112
113-
## Step 3: Implement the Gray-Scott PDE
113+
## Implement the Gray-Scott PDE
114114
115115
```python
116116
import numpy as np
@@ -145,7 +145,7 @@ def gray_scott_pde(t, uv, d1=0.1, d2=0.05, f=0.040, k=0.060):
145145
```
146146
:::
147147
148-
## Step 4: Time Step and Animate
148+
## Time Step and Animate
149149
150150
Because `np.roll()` wraps around the array, this implementation already uses **periodic boundary conditions**.
151151

modules/pde/turing-instability.qmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ plt.show()
3434
plt.close()
3535
```
3636

37-
## Step 1: Write the Jacobian at the Fixed Point
37+
## Write the Jacobian at the Fixed Point
3838

3939
Let
4040

@@ -67,7 +67,7 @@ def gierer_meinhardt_jacobian(a=0.40, b=1.00):
6767
```
6868
:::
6969
70-
## Step 2: Implement the Turing Test
70+
## Implement the Turing Test
7171
7272
A common set of conditions for Turing instability is
7373
@@ -113,7 +113,7 @@ If your implementation is vectorized, it should work with scalars and with array
113113
114114
Validate these functions carefully. You will reuse them when you move from 1D to 2D, so this is the theory page that supports the rest of the session.
115115
116-
## Step 3: Plot the Turing Space
116+
## Plot the Turing Space
117117
118118
Complete the code below to recreate the diagram.
119119
@@ -136,7 +136,7 @@ plt.show()
136136
137137
Mark the point $(a, d) = (0.40, 20)$ on your plot. Is it inside the instability region?
138138
139-
## Step 4: Scan Spatial Modes in 1D
139+
## Scan Spatial Modes in 1D
140140
141141
The Turing conditions say that some spatial mode should grow, but they do not tell you which one. For Neumann boundary conditions on $[0, L]$, the admissible wavenumbers are
142142
@@ -187,7 +187,7 @@ def find_unstable_modes_1d(a=0.40, b=1.00, d=30.0, length=40.0, num_modes=10):
187187
```
188188
:::
189189
190-
## Step 5: Extend the Scan to 2D
190+
## Extend the Scan to 2D
191191
192192
In two dimensions, the modes are pairs $(n_x, n_y)$. On a rectangle with side lengths $L_x$ and $L_y$,
193193

0 commit comments

Comments
 (0)