Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'NDSolve and conditions' topicStudent Support Forum > General > Archives > "NDSolve and conditions"

Help | Reply To Topic
Author Comment/Response
02/06/12 08:20am

Hi Folks

I'm very new to Mathematica and so in an effort to get to know the program and at the same time try to implement some models of my field of research I have run into a little implementation problem. I guess it is quite a simple issue for those in the know.

I'm trying to implement the Izhikevich model of spiking neurons. The equations are:

v'=0.04v^2 + 5v + 140 - u + I
if v>=30mV then v<-c and u<-u+d

This is what I have done so far in Mathematica:
a = 0.02;
b = 0.2;
c = -65;
d = 2;
i = 0.1;
NDSolve[{v'[t] == 0.04*v[t]^2 + 5 v[t] + 140 - u[t] + i,
u'[t] == a (b*v[t] - u[t]),
u[0] == 0,
v[0] == 0},
{v[t], u[t]},
{x, 0, 100}]

The question: How on earth to I add the condition: if v>=30 then v<-c and u<-u+d

Any help is greatly appreciated.

Kind Regards

URL: ,
Help | Reply To Topic