# Closed-Loop Current Stimulation Feedback Control of a Neural Mass Model Using Reservoir Computing
## 2 Methods  
### [PERSON] and [PERSON] Neural Mass Model  
The single-column JRNMM treats a column of cortex as a combination of interconnected excitatory interneurons, pyramidal cells (PCs) and inhibitory interneurons [25]. Each subpopulation has a single state parameter that models the membrane potential of a given subpopulation. A sigmoidal function maps the membrane potential of a subpopulation to a mean firing rate, which then serves as an input to another subpopulation through intrinsic connections. Excitatory interneurons receive a mean firing rate input from both a user-defined external signal \(\mathbf{g}\) and inputs from the PC layer. Inhibitory interneurons receive a mean firing rate input from only the PC layer. The PC layer receives inputs from both the excitatory and inhibitory interneurons. Table 1 and Figure 1 contain the parameters and a diagram of the single-column JRNMM. Appendix A details the full state equations. We modified the JRNMM described in [31] by subtracting the membrane potential \(\mathbf{p}\), from the first time derivative of \(\mathbf{p}\) to remove DC offsets that would persist after current stimulation, to allow us to only observe perturbations around baseline. The sigmoid function \(\mathbf{S}(\cdot)\) converts membrane potentials from other populations into a firing rate, which serves as an input to another population:  
\[\mathbf{S}(\mathbf{V}_{j})=\frac{2\epsilon_{0}}{1+\mathbf{exp}(-r_{0}\mathbf{ V}_{j})}-\epsilon_{0} \tag{1}\]  
The single-column JRNMM can be easily expanded to include multiple interacting neural mass models with extrinsic connections between populations [31]. In a two-column model, the PCs from one column drive the subpopulations in the other column (Figure 2). Forward connections are excitatory and represent a bottom-up influence, which adds a firing rate input to the excitatory interneurons of the other cortical column. Backward connections provide top-down inhibition that increases the firing rate input to the depolarizing potential of the PC layer and inhibitory interneurons of the other cortical column. \begin{table}
\begin{tabular}{c c c} \hline
**Parameter** & **Description** & **Value** \\ \hline \(H_{e},H_{i}\) & Max amplitude of post-synaptic potential & 3.25, 29.3 (mV) \\ \(\tau_{e},\tau_{i},\tau_{p}\) & Lumped time constants of dendritic delays & 10, 15, 20 (s\({}^{-1}\)) \\ \(\epsilon_{0}\) & Max firing rate of neural population & 2.5 (s\({}^{-1}\)) \\ \(r_{0}\) & Steepness of the sigmoid function & 0.56 (mV\({}^{-1}\)) \\ \(\gamma_{1}\cdots\gamma_{4}\) & Number of synapses in neural population & 50, 40, 12, 12 \\ \(C\) & Connectivity scalar for extrinsic inputs & 1000 \\ \hline \end{tabular}
\end{table} 
Table 1: Description of model parameters. The parameters \(A_{F}\) and \(A_{B}\) parameterize the strength of the forward and backward connections from the other column, which has state equations of a similar form. Specifically, these values represent the average number of synaptic connections formed between the two columns. The PC membrane potentials of columns 1 and 2 are \(\mathbf{p}_{1}\) and \(\mathbf{p}_{2}\), respectively. The PC inputs between columns contain a delay to simulate conduction delays, here set to 0.01 ms. The two-column JRNMM allows the user to explore richer dynamics, as well as functional and effective connectivity between columns. The EEG signal is dominated by the activity of PCs (because they generate currents orthogonal to the scalp); therefore, \(\mathbf{p}_{1}\) and \(\mathbf{p}_{2}\) serve as the observable outputs of the model. In our simulations, we set forward connections from column 1 to column 2 with strength \(A_{F}=5\) and backward connections  
Figure 1: Single-column Jansen and Ritt neural mass model. The state \(\mathbf{V}_{\text{j}}\) describes the membrane potential of the \(j\)th subpopulation (\(j=1\) excitatory interneurons membrane potential, \(j=2\) PC depolarizing membrane potential, \(j=3\) PC hyperpolarizing membrane potential, \(j=4\) inhibitory interneurons membrane potential).