### Calculations used for Tsmp


```
from sympy import *
init_printing()
```

#### Post synaptic dendritic current

Tfd (Tf difference) below represents the difference between $t$ (current time) and $Tf[i]$ (last pre synaptic spike time for dendrite i).  E. g. result of $t - Tf[i]$.


```
Tfd = var('Tfd')
```

Dt = Delta time
A dirac delta formula from 'Theoretical Neuroscience' page 405: $DiracDelta = lim(Dt->0)(if (-Dt/2) < t < Dt)$: return $1/Dt$; else return $0$;).  Due to that the formula $1/t$ for DiracDelta is able to be used when the if statement condition is matched.  It is represented as $1/Tfd$ in this case.

Formula 1 in the Gupta paper is   $T_d[i]*d(I_d[i][t])=-I_d[i][t]+R_d[i]*w[i]*(\frac{1}{Tfd})$

$T_d[i]$ can be brought to the other side of the equation through multipling $1/T_d[i]$ on both sides.  This produces $d(I_d[i][t])=(1/T_d[i])*-I_d[i][t]+R_d[i]*w[i]*(1/Tfd)$

The fundamental theorum of calculus is that $integral(derivative(f(x)))=f(x)$.  A.k.a. an integral can cancel a derivative out of an equation.  To get $Id[i]$ from formula 1 the integral of both sides should be taken to remove the derivative from the formula.


```
Id, Td, Rd, W = var('I_d T_d R_d W')
```


```
Id2 = Id
```


```
Id = ((1/Td)*-Id2+Rd*W*(1/Tfd))
```


```
Id.integrate(Id2)
```

#### Post synaptic direct synapse soma current

15 input neurons.  $W = weight, 1/Tdf = Dirac function$.  Using the formula $Sigma(w*Dirac)$ the output below is produced.


```
SummedWeights1 = var('SummedWeights1')
```


```
DiracWeightedSum = SummedWeights1/Tfd
```


```
Is_1, Ts_1 = var('Is_1 Ts_1')
```


```
Is_1b = Is_1
```


```
Is_1 = (1/Ts_1)*(-Is_1b+DiracWeightedSum)
```

###### Total soma membrane potential


```
DendriteGroup = [Id.integrate(Id2)]*15
```


```
SynapseToSoma = Is_1.integrate(Is_1b)
```

#### Total soma membrane potential calculation

It was found that end result variables representing prior component 
calculations (SummedDendriteGroupX, SynapseToSomaX) could be applied 
to solving for um in the equation.


```
Um, Tm, Rm = var('U_m T_m R_m')
```


```
Uu2 = (1/Tm)*(-Um+(Rm*(sum(DendriteGroup)+SynapseToSoma)))
```


```
Uu2.integrate(Um)
```

Below are shown the end result variables which can simplify the formula 
used instead of the above one


```
DiracWeightedSum_Z, Is_Z = var('DiracWeightedSum_Z Is_Z')
```


```
Is_Zb = Is_Z
```


```
Is_Z = (1/Ts_1)*(-Is_Zb+DiracWeightedSum_Z)
```


```
SynapseToSoma_Z = Is_Z.integrate(Is_Zb)
```


```
SynapseToSoma_Z
```


```
SummedDendriteGroupX, SynapseToSomaX = var('SummedDendriteGroupX SynapseToSomaX')
```


```
Uu3 = (1/Tm)*(-Um+(Rm*(SummedDendriteGroupX+SynapseToSomaX)))
```

The integration below solves the tsmp equation for Um and therefore 
provides the tsmp result wanted.


```
Uu3.integrate(Um)
```

bdc7b805f754f046ee9982ba7b5c16d5de49b013
ipynb
Jupyter Notebook
notebooks/TsmpCalcs.ipynb
Jbwasse2/snn-rl
29b040655f432bd390bc9d835b86cbfdf1a622e4
MIT
2015-04-16T11:14:31.000Z
2022-03-11T07:43:51.000Z
notebooks/TsmpCalcs.ipynb
Jbwasse2/snn-rl
29b040655f432bd390bc9d835b86cbfdf1a622e4
MIT
2015-11-24T04:53:57.000Z
2019-10-21T02:00:15.000Z
notebooks/TsmpCalcs.ipynb
Jbwasse2/snn-rl
29b040655f432bd390bc9d835b86cbfdf1a622e4
MIT
2015-12-27T10:04:53.000Z
2021-01-03T03:25:18.000Z
Qwen/Qwen-72B
1. YES
2. YES