<s> """<STR_LIT>""" <EOL> from __future__ import division <EOL> from WC_net import * <EOL> from PyDSTool . Toolbox . phaseplane import * <EOL> import sys <EOL> builder_no5HT = rate_network ( ) <EOL> S = thresh_Naka_Rushton_fndef ( <NUM_LIT:2> , '<STR_LIT>' , <NUM_LIT:100> , <EOL> sys_pars = [ '<STR_LIT:g>' ] ) <EOL> builder_no5HT . add_neuron ( '<STR_LIT>' , tau = <NUM_LIT:9> , ic = <NUM_LIT:1> , thresh_fn = S ) <EOL> builder_no5HT . add_rate ( '<STR_LIT>' , tau = <NUM_LIT> , ic = <NUM_LIT:1> ) <EOL> builder_no5HT . add_syn_input_to_neuron ( '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT:6> ) <EOL> builder_no5HT . add_syn_input_to_neuron ( '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT:1> ) <EOL> builder_no5HT . pardefs [ '<STR_LIT>' ] = <NUM_LIT:10> <EOL> builder_no5HT . pardefs [ '<STR_LIT:g>' ] = <NUM_LIT:6> <EOL> builder_no5HT . add_interaction ( '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT:1> ) <EOL> burst_on = Events . makeZeroCrossEvent ( '<STR_LIT>' , <NUM_LIT:1> , <EOL> { '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : False } , <EOL> varnames = [ '<STR_LIT>' ] ) <EOL> net_no5HT = builder_no5HT . make_network ( events = burst_on ) <EOL> net_no5HT . set ( tdata = [ <NUM_LIT:0> , <NUM_LIT> ] , <EOL> algparams = { '<STR_LIT>' : <NUM_LIT:1> } ) <EOL> builder_norm = rate_network ( ) <EOL> S2 = thresh_Naka_Rushton_fndef ( <NUM_LIT:2> , '<STR_LIT>' , <NUM_LIT:100> , <EOL> sys_pars = [ '<STR_LIT:g>' , '<STR_LIT>' ] ) <EOL> builder_norm . add_neuron ( '<STR_LIT>' , tau = <NUM_LIT:9> , ic = <NUM_LIT:1> , thresh_fn = S2 ) <EOL> builder_norm . add_rate ( '<STR_LIT>' , tau = '<STR_LIT>' , ic = <NUM_LIT:1> ) <EOL> builder_norm . add_syn_input_to_neuron ( '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT:6> ) <EOL> builder_norm . add_syn_input_to_neuron ( '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT:1> ) <EOL> builder_norm . pardefs [ '<STR_LIT>' ] = <NUM_LIT:10> <EOL> builder_norm . fndefs [ '<STR_LIT:g>' ] = ( [ '<STR_LIT:A>' ] , '<STR_LIT>' ) <EOL> builder_norm . fndefs [ '<STR_LIT>' ] = ( [ '<STR_LIT:A>' ] , '<STR_LIT>' ) <EOL> builder_norm . add_interaction ( '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT:1> ) <EOL> net_norm = builder_norm . make_network ( events = burst_on ) <EOL> net_norm . set ( tdata = [ <NUM_LIT:0> , <NUM_LIT> ] , <EOL> algparams = { '<STR_LIT>' : <NUM_LIT:1> } ) <EOL> def freq ( traj ) : <EOL> ts = traj . getEventTimes ( '<STR_LIT>' ) <EOL> if len ( ts ) > <NUM_LIT:1> : <EOL> return <NUM_LIT> / ( ts [ - <NUM_LIT:1> ] - ts [ - <NUM_LIT:2> ] ) <EOL> else : <EOL> return <NUM_LIT:0> <EOL> def stim ( net , A ) : <EOL> net . set ( pars = { '<STR_LIT>' : A } ) <EOL> traj = net . compute ( '<STR_LIT:test>' ) <EOL> pts = traj . sample ( ) <EOL> plt . clf ( ) <EOL> plt . plot ( pts [ '<STR_LIT:t>' ] , pts [ '<STR_LIT>' ] , '<STR_LIT:k>' , label = '<STR_LIT>' ) <EOL> plt . plot ( pts [ '<STR_LIT:t>' ] , pts [ '<STR_LIT>' ] , '<STR_LIT:r>' , label = '<STR_LIT>' ) <EOL> plt . legend ( ) <EOL> plt . xlabel ( '<STR_LIT>' ) <EOL> plt . ylabel ( '<STR_LIT>' ) <EOL> return pts , freq ( traj ) <EOL> fs_no5HT = [ ] <EOL> fs_norm = [ ] <EOL> As = linspace ( <NUM_LIT:0> , <NUM_LIT> , <NUM_LIT:15> ) <EOL> for A in As : <EOL> print "<STR_LIT>" % A <EOL> sys . stdout . flush ( ) <EOL> pts , f = stim ( net_no5HT , A ) <EOL> fs_no5HT . append ( f ) <EOL> pts , f = stim ( net_norm , A ) <EOL> fs_norm . append ( f ) <EOL> plt . figure ( <NUM_LIT:2> ) <EOL> plt . plot ( As , fs_norm , '<STR_LIT>' , label = '<STR_LIT>' ) <EOL> plt . plot ( As , fs_no5HT , '<STR_LIT>' , label = '<STR_LIT>' ) <EOL> plt . legend ( ) <EOL> plt . show ( ) </s>
