|
| 1 | +<Lems> |
| 2 | + |
| 3 | + |
| 4 | + <noisyCurrentSource id="noisyCurrentSource1" delay="100ms" duration="1000ms" mean="0 nA" stdev="0.05 nA" noiseDt="1.0ms"/> |
| 5 | + <noisyCurrentSource id="noisyCurrentSource2" delay="100ms" duration="1000ms" mean="0 nA" stdev="0.01 nA" noiseDt="1.0ms"/> |
| 6 | + <noisyCurrentSource id="noisyCurrentSource3" delay="100ms" duration="1000ms" mean="0 nA" stdev="0.005 nA" noiseDt="1.0ms"/> |
| 7 | + |
| 8 | + |
| 9 | + <ComponentType name="noisyCurrentSource" extends="baseVoltageDepPointCurrentSpiking" |
| 10 | + description="NeuroML implementation of PyNN's NoisyCurrentSource: a Gaussian 'white' noise current source. The current amplitude changes at fixed |
| 11 | + intervals, with the new value drawn from a Gaussian distribution."> |
| 12 | + |
| 13 | + <Parameter name="delay" dimension="time" description="Delay before change in current. Current is zero prior to this."/> |
| 14 | + <Parameter name="duration" dimension="time" description="Duration for holding current at amplitude. Current is zero after delay + duration."/> |
| 15 | + <Parameter name="mean" dimension="current" description="Amplitude of current pulse"/> |
| 16 | + <Parameter name="stdev" dimension="current" description="Standard deviation of current pulse"/> |
| 17 | + <Parameter name="noiseDt" dimension="time" description="Interval between updates of the current amplitude. Should be a |
| 18 | + multiple of the simulation time step. "/> |
| 19 | + |
| 20 | + |
| 21 | + <EventPort name="in" direction="in" description="Note this is not used here. Will be removed in future"/> |
| 22 | + |
| 23 | + <Dynamics> |
| 24 | + |
| 25 | + <StateVariable name="i" exposure="i" dimension="current"/> |
| 26 | + <StateVariable name="tsince" dimension="time"/> |
| 27 | + <TimeDerivative variable="tsince" value="1"/> |
| 28 | + |
| 29 | + |
| 30 | + <StateVariable name="U" dimension="none"/> |
| 31 | + <StateVariable name="V" dimension="none"/> |
| 32 | + <StateVariable name="randn" dimension="none"/> |
| 33 | + |
| 34 | + <OnCondition test="t .lt. delay-noiseDt"> |
| 35 | + <StateAssignment variable="i" value="0"/> |
| 36 | + <StateAssignment variable="tsince" value="0"/> |
| 37 | + </OnCondition> |
| 38 | + |
| 39 | + <OnCondition test="tsince .geq. noiseDt"> |
| 40 | + <StateAssignment variable="U" value="random(1)"/> |
| 41 | + <StateAssignment variable="V" value="random(1)"/> |
| 42 | + <StateAssignment variable="randn" value="sqrt(-2*log(U))*cos(2*3.14159265359*V)"/> |
| 43 | + |
| 44 | + <StateAssignment variable="i" value="mean+stdev*randn"/> |
| 45 | + |
| 46 | + <StateAssignment variable="tsince" value="0"/> |
| 47 | + </OnCondition> |
| 48 | + |
| 49 | + <OnCondition test="t .geq. duration + delay"> |
| 50 | + <StateAssignment variable="i" value="0"/> |
| 51 | + </OnCondition> |
| 52 | + |
| 53 | + </Dynamics> |
| 54 | + </ComponentType> |
| 55 | + |
| 56 | +</Lems> |
| 57 | + |
0 commit comments