[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help with iSpikes
From: |
fredomatic |
Subject: |
Re: Help with iSpikes |
Date: |
Sun, 5 Jul 2020 09:03:12 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 |
Hi Bill,
Spikes is doing almost nothing, as expected...
Instantaneously, that is, during a time period of length zero, inflow
goes up to 10. The change in State is therefore 10 * 0 = 0, and State
does not change.
I must admit that Spikes has limited utility...
Cheers!
Frederic
These model and input file may help a bit to understand (two outputs added):
-----
States = {
State
};
Inputs = {
inflow
};
Outputs = {
check1, check2
};
Initial_State = 0.0;
Initialize{
State = Initial_State;
};
Dynamics{
check1 = inflow;
dt(State) = inflow;
};
CalcOutputs{
check2 = inflow;
};
End.
------
Integrate(Lsodes,1.0e-6,1.0e-6,0);
OutputFile("spikes.test01.out");
StartTime(0.0);
Initial_State = 0.0;
Simulation { # Base
inflow = 1.0;
PrintStep(State,0.0,200.0,1.0);
PrintStep(inflow,0.0,200.0,1.0);
}
Simulation { # Base w/ Spikes
inflow = Spikes(
5,
10.0, 10.0, 10.0, 10.0, 10.0,
0.0, 50.0, 100.0, 150.0, 200.0);
PrintStep(State,0.0,200.0,1.0);
PrintStep(inflow,check1,check2,0.0,200.0,1.0);
}
End.
-------
On 05/07/2020 04:53, Bill Harris wrote:
> Mode File:
>
> States = {
> State
> };
> Inputs = {
> inflow
> };
> Initial_State = 0.0;
> Initialize{
> State = Initial_State;
> };
> Dynamics{
> dt(State) = inflow;
> };
> End.
>
> $ makemcsim spikestest.model
> Creating model.c file from spikestest.model ...
>
> ________________________________________
>
> Mod v6.1.0 - Model Generator for MCSim
>
> MCSim and associated software comes with ABSOLUTELY NO WARRANTY;
> This is free software, and you are welcome to redistribute it
> under certain conditions; see the GNU General Public License.
>
> No CalcOutputs{} equations. Null function defined.
>
>
> * Created model file 'model.c'.
>
>
> Compiling and linking model ...
> Cleaning up ...
> Created executable mcsim.spikestest
>
> Input File:
>
> Integrate(Lsodes,1.0e-6,1.0e-6,0);
> OutputFile("spikes.test01.out");
> StartTime(0.0);
> Initial_State = 0.0;
>
> Simulation { # Base
> inflow = 1.0;
> PrintStep(State,0.0,200.0,1.0);
> PrintStep(inflow,0.0,200.0,1.0);
> }
>
> Simulation { # Base w/ Spikes
> inflow = Spikes(
> 5,
> 10.0, 10.0, 10.0, 10.0, 10.0,
> 0.0, 50.0, 100.0, 150.0, 200.0);
> PrintStep(State,0.0,200.0,1.0);
> PrintStep(inflow,0.0,200.0,1.0);
> }
>
> End.
>
> OUtput File:
>
> Results of Simulation 1
>
> Time State inflow
> 0 0 1
> 1 1 1
> 2 2 1
> 3 3 1
> 4 4 1
> 5 5 1
> 6 6 1
> .
> .
> .
>
> Results of Simulation 2
>
> Time State inflow
> 0 0 10
> 1 0 0
> 2 0 0
> 3 0 0
> 4 0 0
> 5 0 0
> 6 0 0
> .
> .
> .
>
> Question: Why doesn 't State jump by 10 every 50 time units? What is
> Spikes doing?
>
> Thanks,
>
> Bill
> --
> Bill Harris