After using scipy.integrate for a while, I am at a point where I need more functions, such as bifurcation analysis or parameter estimation. That's why they are interested in using PyDSTool, but from the documentation I canβt understand how to work with ModelSpec, and if this is actually what will lead me to the solution.
Here is an example of the game I'm trying to make: I have a network with two nodes, each of which has the same dynamics (SIR) described by the two ODEs, but different initial conditions. The equations are connected between nodes via Epsilon (see Formula below). formulas as an image for better reading, "n" and "m" are indexes, not indicators ~> http://image.noelshack.com/fichiers/2014/28/1404918182-odes.png
(failed to use loading in stack, unfortunately)
In two cases of node, my code (using PyDSTool) looks like this:
import PyDSTool as pdt
params={'alpha': 0.7, 'beta':0.1, 'epsilon1':0.5,'epsilon2':0.5}
ini={'s1':0.99,'s2':1,'i1':0.01,'i2':0.00}
DSargs=pdt.args(name='SIRtest_multi',
ics=ini,
pars=params,
tdata=[0,20],
varspecs={'s[o]':'for(o,1,2,-alpha*s[o]*sum(k,1,2,epsilon[k]*i[k]))',
'i[l]':'for(l,1,2,alpha*s[l]*sum(m,1,2,epsilon[m]*i[m]))'})
DS = pdt.Generator.Vode_ODEsystem(DSargs)
trj=DS.compute('test')
pts=trj.sample()
pdt.plt.plot(pts['t'],pts['s1'],label='s1')
pdt.plt.plot(pts['t'],pts['i1'],label='i1')
pdt.plt.plot(pts['t'],pts['s2'],label='s2')
pdt.plt.plot(pts['t'],pts['i2'],label='i2')
pdt.plt.legend()
pdt.plt.xlabel('t')
pdt.plt.show()
But in my original problem for each of them there are more than 1000 nodes and 5 ODEs, each node is associated with a different number of other nodes, and epsilon values ββare not equal for all nodes. So messing with this syntax has not yet led me to a solution.
, , - / (?) node, (, node). . , , PyDSTool, .
PyDSTool, , , ! , -, , , . ( // : ( ) / , )
( , , , , !)