Next: Running the simulation Up: Numerical solution of Previous: Numerical solution of

## Writing an ODE file

To simulate this in XPPAUT we must create an ODE file which has information such as the number of equations, the parameters, initial conditions, names of variables and function definitions. The following file does the trick:

```# passive membrane with step function current: passive.ode
dV/dt = ((E-V)/R_M + 1000*I_0*p(t))/(C_M*1000)
V(0)=-70
parameter R_M=10000, C_m=1e-6, I_0=2e-6, E=-70
parameter t_on=5, t_off=10
# define a pulse function
p(t)=heav(t_off-t)*heav(t-t_on)
# track the current
aux ibar=p(t)*I_0
done
```

There is little explanation needed except for the following points:

• The factors of 1000 are to adjust the time units to milliseconds and voltage to millivolts. The resistance is in Ohms per cm^2, the capacitance in Farads per cm^2 and the current in Amps per cm^2.
• heav(t) is the Heaviside step function which is 0 for t<0 and 1 for Thus is a pulse function which turns on at and turns off at
• V(0)=-70 is the initial condition.
• aux means that what follows is something that we want to plot but does not satisfy a differential equation.
• XPPAUT is case insensitive so upper and lower cases are synonymous.
• # means that what follows is a comment.
• param ... defines parameters
• dV/dt = ... tells XPPAUT that this is a differential equation
• done tells the parser the file is done.

Notes: (1) All the declarations at the beginning of each line can be abbreviated to their first letter; all others are ignored until a space is encountered. (2) Variables, functions, and parameters can have up to 9 letters. (3) There are at most 300 differential equations allowed, 200 parameters, and 50 functions.

Bard Ermentrout
Mon Jan 5 13:18:36 EST 1998