/**************************************************************************	FirstOrder.h												JJS 9/06/95			part of CONICAL, the Computational Neuroscience Class Library		This header file does not declare a class, but rather, a general-	purpose function for integrating first-order kinetic equations of 	the form:				dy/dt = alpha*(1-y) - beta*y		This is equivalent to the kinetic reaction a <---> b, where y is the	value of a (or b), 1-y is the value of the other, the forward reaction	rate is alpha, and the backward rate is beta.  To use, write					newy = FirstOrder( y, alpha, beta, dt )	Requires:		math library		-- ANSI math functions, defined in <math.h>		**************************************************************************/#ifndef FIRSTORDER_H#define FIRSTORDER_H#include <math.h>#ifndef real#define real double#endifinline real FirstOrder( real y, real alpha, real beta, real dt ){	real ratesum = alpha + beta;	return y + (alpha/ratesum - y) * (1 - exp(-ratesum*dt) );}#endif
