[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ode_plot()



On Mon, 20 Feb 2006, Jorge Manuel de Almeida Magalhães wrote:

> I am trying to implement the function ode_plot() to simulate the
> behavior of neuron  potential that depends off the input current I(t)
> that is a random number (several nA).
> Its differential equation is V' = (Vrest-V)/(RC) + I(t)//C.
> Vrest=-0.065, R=10^8, C=10^-10 are constants.
>
Dear Jorge,

In ePiX, differential equations are written in the form

  X' = F(X)

with X the unknown (vector-valued) function of time and F a vector-valued
function of position. Thus you need to define a function

  P F(double u, double v);

in order to express your ODE. Since you're in two dimensions (one of
space -- measured by V, and one of time), your file might look like

const double Vrest = -0.065;
const double R = 1E8;
const double C = 1E-10;

double I(double t); // define as appropriate

P F(double t, double V)
{
  return P(1, (Vrest-V)/(R*C) + I(t)/C); // t'=1, V'=...
}

---
The ode_plot() should now graph V as a function of t.

I hope that's helpful. Sorry for the confusing example in the documentation!

Best,
Andy

Andrew D. Hwang			ahwang@mathcs.holycross.edu
Department of Math and CS	http://math.holycross.edu/~ahwang
College of the Holy Cross	(508) 793-2458 (Office: 320 Swords)
Worcester, MA, 01610-2395	(508) 793-3530 (fax)