API Reference¶
PhasePlaneWidget¶
PhasePlaneWidget ¶
Bases: AnyWidget
Interactive phase plane widget.
In Jupyter / VS Code the widget is backed by anywidget. All numerical work (ODE integration, fixed-point search, nullclines, sweeps) is done in the browser by the JS front-end, so interactivity is instantaneous.
For static sites use :meth:to_standalone_html to obtain a self-contained
.html file that can be dropped into mkdocs, GitHub Pages, etc.
Source code in src/phase_plane_widget/widget.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | |
Functions¶
__init__ ¶
to_standalone_html ¶
Export the widget to a self-contained HTML file.
The resulting .html file contains the full JS computation engine,
all model definitions, the CSS, and the current widget state. It works
in any modern browser with no Python runtime and no Jupyter kernel.
Parameters¶
filename : str or pathlib.Path
Output path (e.g. "widget.html").
title : str
Page <title>.
Source code in src/phase_plane_widget/widget.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | |
run_sweep ¶
Run a parameter sweep from Python (delegates to JS in the widget).
Parameters¶
param_name : str Parameter to vary. values : list of float Values to evaluate.
Source code in src/phase_plane_widget/widget.py
Model Base Class¶
BaseModel ¶
Base class for neural mass models.
Source code in src/phase_plane_widget/models.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
Functions¶
f ¶
compute_trajectory ¶
Compute trajectory using solve_ivp.
Source code in src/phase_plane_widget/models.py
detect_regime ¶
Detect dynamical regime: fixed_point, limit_cycle, or other.
Source code in src/phase_plane_widget/models.py
Wilson-Cowan¶
WilsonCowan ¶
Bases: BaseModel
Wilson-Cowan model of excitatory and inhibitory neural populations.
Source code in src/phase_plane_widget/models.py
FitzHugh-Nagumo¶
FitzHughNagumo ¶
Bases: BaseModel
FitzHugh-Nagumo model of excitable neuron dynamics.
Source code in src/phase_plane_widget/models.py
MPR (Quadratic Integrate-and-Fire)¶
MPRModel ¶
Bases: BaseModel
Montbrió-Pazó-Roxin exact firing-rate equations for QIF neurons.
The macroscopic variables are firing rate (r) and mean membrane potential (v). See: Phys. Rev. X 5, 021028 (2015).