### Homework 1.3

```# One fast persistent calcium channel
# Here is the equation
dv/dt=(i+gl*(vl-v)+gca*minf(v)*(vca-v))/c

#and the initial condition
V(0)=-60

# and the calcium current
aux ica=gca*minf(v)*(v-vca)
aux il=gl*(v-vl)
# and the parameters
param vl=-60,vca=120
param i=0,gl=2,gca=4,c=20
param v1=-1.2,v2=18

# and the functions
minf(v)=.5*(1+tanh((v-v1)/v2))
done
```

### Homework 1.4b

```# nnet1.ode
da/dt = (-a+w*f(a)+i)/tau
f(a)=1/(1+exp(-beta*(a-theta)))
par beta=2,theta=1,i=0,tau=1,w=1
done
```

### PIR ODE file

```# PIR Model with GABA_A and GABA_B synapses
p gca=1,vk=-90,fh=2,vca=120
p gl=.1,vl=-70,i=0
p gsyna=0,gsynb=0,vsyna=-85,vsynb=-90,tvsyn=-40
p fka=2,rka=.08
ph(v)=1/(1+exp((v+79)/5))
ps(v)= 1/(1+exp(-(v+65)/7.8))
tauh(v)= ph(v)*exp((v+162.3)/17.8)+20
#
v'= gl*(vl-v)+gca*(vca-v)*h*ps(v)^3+i
h'= (ph(v)-h)*fh/tauh(v)
#
# GABA A synapse
sa'= fka*ssyn*(1-sa)-rka*sa
#
# GABA B synapse
tb'= 5*ssyn*(1-tb)-.007*tb
sb'= .03*tb*(1-sb)-.005*sb
#
ssyn= 1/(1+exp(-(v+40)/2))
done
```