I’m having a problem with inconsistent units in my equation - I realize what’s going on, but I’m not sure the proper way to fix it. My conductance equations are of the form:
dg/dt = (gx/tau_rise - g)/tau_decay : 1
dgx/dt = -gx/tau_rise : 1
where tau_rise and tau_decay are in milliseconds. I get the error “Inconsistent units in differential equation” and I know why I get this error, but I’m not sure what I can do to safely change the equation so that the units match. Any help would be appreciated.
Hi, my quick assessment is ((g/tau_rise) / tau_decay) is your problem, that should result in units of (conductance / time^2) rather than (conductance / time). Looks like your conductance is unitless which should be fine, but the 1/time^2 will still be dimensionally inconsistent.
The fix would be to re-evaluate where your conductance equations are coming from, whether the expression is incorrect, or whether gx should have units of time (so that gx/tau_rise has the same units as g)
g(t) = \frac{1}{\tau_{dec}-\tau_{rise}} \left(e^{\frac{-t}{\tau_{dec}}} - e^{\frac{-t}{\tau_{rise}}}\right) \frac{dg}{dt} = \frac{\frac{gx}{\tau_{rise}}-g}{\tau_{dec}}
If that’s the case, it looks to me like g has units of 1/time, while gx has units of 1 (dimensionless)…
Then (gx/tau - g) would be consistent, and dg/dt would have units (1 / time^2), while dgx/dt would have units of (1/time). You’d write that something like
which looks very similar, but multiplies by an additional time term in V(t) and inside dV/dt which make both components dimensionless.
Here’s my favorite textbook chapter on this synapse model, which also has a version which describes conductance g, rather than voltage (eq. 7.4)
There g_{syn} is expressed in units of time then rescaled by an arbitrary constant to be dimensionless.
To summarize all that rambling, I think the problem lies in the specification of the original conductance equation, and what’s needed is to decide/check the assumption for the units of g, and either update the units for the differential equations, or introduce a scaling factor which makes g and gx dimensionless:
Hi everyone,
how to formulate synapses as ODEs has been confusing quite a number of people… I think @adam is spot on with the reference to the Brian documentation, and I agree that your equations should be the same (using g instead of V), i.e. something like:
they are normalized in a way that the peak of g will be the value of gx that you use for the spike – I’m not sure about the normalization in the equation you posted earlier – maybe that normalizes the integral under the curve or something like that?
using tau_decay and tau_rise here – instead of the more neutral tau_1 and tau_2 – can be a bit misleading. The two time constants are actually exchangeable, it is the smaller value that defines the rise time, and the larger value that defines the decay time. Which one you call tau_1 and which one you call tau_2 does not matter.