----------------------------------- lines 15-85 of file: xrst/math.xrst ----------------------------------- {xrst_begin ode_iota_omega} {xrst_spell da ds } Dismod ODE With Constant iota and omega ####################################### If :math:`iota` and :math:`\omega` are constant w.r.t. age and time, and the other rates are zero, the dismod ode is .. math:: S'(a) &= - (\omega + \iota) S(a) \\ C'(a) &= + \iota S(a) - \omega C(a) Using the first equation with initial condition :math:`S(0) = 1`, we have .. math:: S(a) = \exp[ - (\omega + \iota) a ] The integrating factor for the second equation is :math:`D(a) = \exp( \omega a )` . The derivative of :math:`D(a) C(a)` is .. math:: \frac{d}{da} [ D(a) C(a) ] &= D'(a) C(a) + D(a) C'(a) \\ &= \omega D(a) C(a) + \iota D(a) S(a) - \omega D(a) C(a) \\ &= \iota D(a) S(a) Note that the right hand side does not depend on :math:`C(a)` . Integrating both sides of the last equation above from zero to :math:`a`, and using the initial condition :math:`C(0) = 0`, we obtain .. math:: D(a) C(a) &= \iota \int_0^a D(s) S(s) ds \\ &= \iota \int_0^a \exp( \omega s ) \exp[ -(\omega + \iota) s ] ds \\ &= \left[ - \exp( - \iota s ) \right]_0^a \\ &= 1 - \exp( - \iota a ) Dividing both sides of the last equation by :math:`D(a)` we obtain .. math:: C(a) = \exp( - \omega a ) - \exp[ - (\omega + \iota) a ] As a check of this solutions we compute .. math:: C'(a) & = (\omega + \iota) \exp[ - (\omega + \iota) a ] - \omega \exp( - \omega a ) \\ C'(a) + \omega C(a) & = \iota \exp[ - (\omega + \iota) a ] \\ C'(a) + \omega C(a) &= \iota S(a) Furthermore :math:`C(0) = 0` . Thus :math:`C(a)` satisfies its differential equation and its initial condition. {xrst_end ode_iota_omega}