BrainDynamicsUSYD / nftsim

C++ library for simulation of multiscale neural field dynamics
Apache License 2.0
30 stars 24 forks source link

Keyword `Duration` affects all subsequent stimuli if using superimposition #136

Closed pausz closed 6 years ago

pausz commented 6 years ago

Case A: Superimpose 2 stimuli - Pulse train lasts 2 seconds; White noise should last 15 seconds

    Time: 15 Deltat: 0.0001
   Nodes: 144

    Connection matrix:
From:  1 
To 1:  0

Population 1: Stimulation
Length: 0.5
 Stimulus: Superimpose: 2
 Stimulus: Pulse - Onset: 5 Duration: 2 Node: 72 Amplitude: 8 Width: 0.05 Frequency: 0.8 Pulses: 10
 Stimulus: White - Onset: 0 Mean: 1 Psd: 1e-05

Output: Node: 72 Start: 0 Interval: 0.001 
Population: 1
Dendrite:  
Propagator:
Coupling:  
Output:

eirs-superimposed_2017-12-11t160845

Case B: Same parameters as Case A, except that the order of the individual stimuli was swapped.

Time: 15 Deltat: 0.0001
Nodes: 144

    Connection matrix:
From:  1 
To 1:  0

Population 1: Stimulation
Length: 0.5
 Stimulus: Superimpose: 2
 Stimulus: White - Onset: 0 Mean: 1 Psd: 1e-05
 Stimulus: Pulse - Onset: 5 Duration: 2 Node: 72 Amplitude: 8 Width: 0.05 Frequency: 0.8 Pulses: 10

Output: Node: 72 Start: 0 Interval: 0.001 
Population: 1
Dendrite:  
Propagator:
Coupling:  
Output

eirs-superimposed_2017-12-11t161013

To work around this problem one has to set an explicit value for Duration for the white noise stimulus in Case A. However, this issue is still a bug. The parameter values of each individual stimulus should not affect the properties of other individual stimulus. Also, in superimposition mode, chaging the order of individual stimuli should not affect the resulting stimulus because superimposition is basically an addition (stim_a + stim_b == stim_b + stim_a)

I ratify that Duration affects all subsequent stimuli. The following test:


Time: 15 Deltat: 0.0001
Nodes: 144

    Connection matrix:
From:  1 
To 1:  0

Population 1: Stimulation
Length: 0.5
 Stimulus: Superimpose: 4
 Stimulus: Pulse - Onset: 5 Duration: 2 Node: 72 Amplitude: 8 Width: 0.05 Frequency: 0.8 Pulses: 10
 Stimulus: White - Onset: 0 Mean: 1 Psd: 1e-05
 Stimulus: Const - Onset: 0 Mean: 0.5 
 Stimulus: Sine - Onset: 0 Amp: 1.5 Width: 0.5

Output: Node: All Start: 0 Interval: 0.001 
Population: 1
Dendrite:  
Propagator:
Coupling: 

produces

eirs-superimposed-white-pulse_2017-12-11t164706

pausz commented 6 years ago

By the way, I checked if the keyword Node did the same as 'Duration' -- ie, checked in Case A if the White Noise was only applied to node 72. It doesn't. White noise is applied to all nodes in Case A and Case B.