Greetings!

I am trying to start using PyDSTool instead of my previous tools (XPP, R, Scipy and OpenOpt) but I've been stuck for days in a probably silly step: defining and using auxiliary functions.

I have simplified my script but could not find the issue - my initial suspects were using 't', 'beta' or 'exp' but it turns out even without those I can't get it right.

I would really appreciate some help. The code is pasted below - it is not the simplest form but with luck you can spot other traps ready to blow.

Thank you very much!

Daniel Damineli

import numpy as np

import PyDSTool as dst

# Name

DSargs = dst.args(name='Uncoupled phase oscillators')

# Auxiliary functions

DSargs.fnspecs = {'prc': (, '-sin(x-phs_cte)'),

'pcp': (, 'exp(-beta*(1-cos(x-phs_cte)))'),

'gate': (, 'if(t<(stim_on+stim_dur),0,1)')}

# Model parameters

DSargs.pars={'N':10,'mu':1,'sigma':0.1,'eps':1000,'beta':10,'stim_on':10,'stim_dur':1,'phs_cte':np.pi/2}

# Array of angular velocities to be used in for loop

omega=np.random.normal(DSargs.pars, DSargs.pars, DSargs.pars)

# Initialize dictionaries

DSargs.varspecs={}

DSargs.ics={}

# array of ICs to be used in for loop

ics=np.random.uniform(0, 2*np.pi, DSargs.pars)

for i in xrange(DSargs.pars):

# Assign angular velocities

DSargs.pars=omega_

# rhs of the differential equation

DSargs.varspecs='om'+str(i)+'+ eps*prc('+'x'+str(i)+',phs_cte)*pcp('+'x'+str(i)+',beta,phs_cte)*gate(t,stim_on,stim_dur)'

# Assign ICs

DSargs.ics = ics

DSargs.tdomain = # set the range of integration.

ode = dst.Generator.Vode_ODEsystem(DSargs) # an instance of the 'Generator' class.

_