|
1 | 1 | """ |
2 | | -Watanabe Spinal Network Simulation with Optimized DC Offset |
| 2 | +Spinal Network Simulation with Optimized DC Offset |
3 | 3 | ============================================================ |
4 | 4 |
|
5 | | -This example runs the Watanabe et al. (2015) spinal network simulation using: |
| 5 | +This example runs the Watanabe and Kohn (2015) spinal network simulation using: |
6 | 6 | - Constant drive (Phase 1) - baseline from script 01 |
7 | 7 | - Constant + oscillation (Phase 2) - oscillation added to baseline |
8 | 8 | - Optimized DC + oscillation (Phase 3) - DC offset matches Phase 1 force |
9 | 9 |
|
10 | 10 | .. note:: |
11 | 11 | **Simulation Phases** (5 seconds each): |
12 | 12 |
|
13 | | - - **Phase 1**: Constant drive (Watanabe baseline, e.g., 40-65 Hz) |
| 13 | + - **Phase 1**: Constant drive (baseline, e.g., 40-65 Hz) |
14 | 14 | - **Phase 2**: Constant + 20*sin(20Hz) (oscillation added to baseline) |
15 | 15 | - **Phase 3**: Optimized DC + 20*sin(20Hz) (DC offset matches Phase 1 force) |
16 | 16 |
|
|
22 | 22 |
|
23 | 23 | **Scientific Context**: Demonstrates how shared descending drive creates motor unit |
24 | 24 | synchronization, while independent noise reduces it. Phase 3 uses lower DC offset than |
25 | | -Phase 1 (like Watanabe's 58 < 65) because oscillation contributes additional activation. |
| 25 | +Phase 1 (e.g., 58 < 65) because oscillation contributes additional activation. |
26 | 26 |
|
27 | 27 | **MyoGen Components Used**: |
28 | 28 |
|
|
54 | 54 | Essential for 15-second simulations with 800+ neurons. |
55 | 55 |
|
56 | 56 | **Key Concept**: The ratio of shared vs independent input determines motor unit |
57 | | -synchronization. Watanabe showed that 20 Hz cortical oscillations are transmitted |
58 | | -through the spinal network and can be detected in EMG coherence spectra. |
| 57 | +synchronization. Watanabe and Kohn (2015) showed that 20 Hz cortical oscillations are |
| 58 | +transmitted through the spinal network and can be detected in EMG coherence spectra. |
59 | 59 |
|
60 | 60 | **Workflow Position**: Step 3 of 6 |
61 | 61 |
|
|
113 | 113 |
|
114 | 114 | if not dc_offset_file.exists(): |
115 | 115 | raise FileNotFoundError( |
116 | | - f"Optimized DC offset not found: {dc_offset_file}\n" |
117 | | - f"Run 02_optimize_oscillating_dc.py first!" |
| 116 | + f"Optimized DC offset not found: {dc_offset_file}\nRun 02_optimize_oscillating_dc.py first!" |
118 | 117 | ) |
119 | 118 |
|
120 | 119 | with open(dc_offset_file) as f: |
|
134 | 133 | print(" Phase 1: 65 pps") |
135 | 134 | print(" Phase 2: 65 + 20*sin(20Hz) pps") |
136 | 135 | print(" Phase 3: 58 + 20*sin(20Hz) pps") |
137 | | -print(f"\nOptimization ratio: {DC_OFFSET_OPTIMIZED/DD_DRIVE_CONSTANT:.3f} (Watanabe: {58/65:.3f})") |
| 136 | +print( |
| 137 | + f"\nOptimization ratio: {DC_OFFSET_OPTIMIZED / DD_DRIVE_CONSTANT:.3f} (Watanabe: {58 / 65:.3f})" |
| 138 | +) |
138 | 139 | print(f"Current setup uses {DD_DRIVE_CONSTANT:.1f} Hz baseline (configurable in script 11)") |
139 | 140 | print("=" * 70 + "\n") |
140 | 141 |
|
|
211 | 212 | plt.xlabel("Time (s)") |
212 | 213 | plt.ylabel("DD Drive (Hz)") |
213 | 214 | plt.title("Descending Drive Pattern (Optimized)") |
214 | | -plt.axvline(segment_duration__s, color='r', linestyle='--', alpha=0.5, label='Phase boundary') |
215 | | -plt.axvline(2*segment_duration__s, color='r', linestyle='--', alpha=0.5) |
| 215 | +plt.axvline(segment_duration__s, color="r", linestyle="--", alpha=0.5, label="Phase boundary") |
| 216 | +plt.axvline(2 * segment_duration__s, color="r", linestyle="--", alpha=0.5) |
216 | 217 | plt.legend() |
217 | 218 | plt.grid() |
218 | 219 |
|
@@ -352,9 +353,9 @@ def eachStep( |
352 | 353 | # Creates NetCon objects for external event delivery (e.g., commands). |
353 | 354 | # |
354 | 355 | # The ratio of shared (DD) to private (IN) input determines the degree of |
355 | | -# motor unit synchronization - a key parameter in Watanabe's analysis. |
| 356 | +# motor unit synchronization - a key parameter in the original analysis. |
356 | 357 |
|
357 | | -# DD connectivity: 30% probability (Watanabe specification) |
| 358 | +# DD connectivity: 30% probability (original specification) |
358 | 359 | # This means each motor neuron receives input from ~30% of DD neurons |
359 | 360 | DD_connectivity = 0.3 |
360 | 361 | expected_DD_per_MN = int(DD_connectivity * nDD) # ~120 connections per MN |
@@ -514,4 +515,4 @@ def step_callback(step_counter): |
514 | 515 | print(f" Spikes: {save_path / 'watanabe_spikes.pkl'}") |
515 | 516 | print(f"\nPhase 1 constant drive: {DD_DRIVE_CONSTANT:.2f} Hz") |
516 | 517 | print(f"Phase 3 DC offset: {DC_OFFSET_OPTIMIZED:.2f} Hz (optimized to match Phase 1 force)") |
517 | | -print(f"Ratio: {DC_OFFSET_OPTIMIZED/DD_DRIVE_CONSTANT:.3f} (Watanabe: {58/65:.3f})") |
| 518 | +print(f"Ratio: {DC_OFFSET_OPTIMIZED / DD_DRIVE_CONSTANT:.3f} (Watanabe: {58 / 65:.3f})") |
0 commit comments