Difference between revisions of "NumericalDiffEqs"
Line 11: | Line 11: | ||
<math> \frac{dy}{dt} = - k y </math> | <math> \frac{dy}{dt} = - k y </math> | ||
− | Here k is the rate constant, 1/k is the time constant, 1/k is <math> \frac{C}{g_L} = RC </math> in the notation above. A leaky cell is what is called an RC circuit. The time constant of an RC circuit is RC. The bigger k, the higher the rate of convergence, and the smaller the time constant 1/k. The time constant is the time it takes the solution to decay to 1/e of its value. | + | Here k is the rate constant, 1/k is the time constant, 1/k is <math> \frac{C}{g_L} = RC </math> in the notation above. A leaky cell is what is called an RC circuit -- a resistor and capacitor together in a circuit. The time constant of an RC circuit is RC. The bigger k, the higher the rate of convergence, and the smaller the time constant 1/k. The time constant is the time it takes the solution to decay to 1/e of its value. |
+ | Solution of differential equations happens at discrete times: <math> y_k </math>, separated by small time intervals dt. | ||
+ | |||
+ | The simplest way of solving this equation is with Euler's method: | ||
+ | |||
+ | <math> y_k = y_{k-1} + dt (k y_{k-1}) </math> | ||
+ | |||
+ | This is a special case of the general formula for Euler's method applied to the (vector) differential equation | ||
+ | |||
+ | <math> \frac{dy}{dt} = f(y) </math> | ||
+ | |||
+ | <math> y_k = y_{k-1} + dt f(y_{k-1}) | ||
+ | |||
Click here for [[Media:intuit.hoc|code]] for visualizing the numerical solution of differential equations. | Click here for [[Media:intuit.hoc|code]] for visualizing the numerical solution of differential equations. |
Revision as of 22:45, 12 February 2009
Remember the equation for the cell with only leak channels.
Let's simplify: suppose there is no injected current and that the reversal potential for the leak channels is . Then our equation is
Using different letters for the variables (because this is done in the software linked below):
Here k is the rate constant, 1/k is the time constant, 1/k is in the notation above. A leaky cell is what is called an RC circuit -- a resistor and capacitor together in a circuit. The time constant of an RC circuit is RC. The bigger k, the higher the rate of convergence, and the smaller the time constant 1/k. The time constant is the time it takes the solution to decay to 1/e of its value.
Solution of differential equations happens at discrete times: , separated by small time intervals dt.
The simplest way of solving this equation is with Euler's method:
This is a special case of the general formula for Euler's method applied to the (vector) differential equation
<math> y_k = y_{k-1} + dt f(y_{k-1})
Click here for code for visualizing the numerical solution of differential equations.