.. _inf_dose:

Infusion
==========================

An infusion administers the dose gradually, usually at a fixed rate over a fixed period of time (|ie| the rate of infusion is constant during the time period and zero before and after, typically intravenously).

The mathematical expression for an infusion is: 

.. math:: 
    \text{d[CENTRAL]} = \text{d[CENTRAL]} + \text{R(t)}

where the infusion has constant rate :pyml:`c[RATE]`, starts at time *t=0* and has duration :pyml:`c[DUR]` and in compartment CENTRAL is:-

where:-

.. math::

    R(t)= 
    \Biggl \lbrace
    {
        c[RATE] ,\text{ if } { t_S \leq t \leq t_S + c[DUR] }
        \atop
        0.0, \text{ otherwise }
    }

An infusion dose can be characterised either by the duration of the infusion or the rate of the infusion. As the rate of change is constant, an infusion is also known as zero order absorption.

Note: For a constant total infusion amount (AMT) the RATE and DURATION can be calculated from each other:

.. math:: 
      \text{AMT} = \text{RATE} \times \text{DURATION}

So specifying either a RATE or DURATION, together with a total amount, is sufficient to fully define an infusion.


.. _infdur_dose:

Infusion Duration
-----------------------

An infusion duration is coded by:

.. code-block:: pyml

    @inf_dur{amt: c[AMT], lag: m[LAG], dur: c[DUR]}

in the equation for the appropriate compartment in the **DERIVATIVES:** section of a fit or tutorial script.

Dose and lag are coded in the same way as for a bolus dose.

Duration can either be included in the input data or can be estimated as a parameter.

.. note:: 
    
    See the :ref:`sum_link_inf_dur_dosing_tut` for :ref:`tut_script` used to generate results in this section.


An example of an infusion dose spread over 20 time units added to a one compartment model with no lag time is:

.. code-block:: pyml

    DERIVATIVES: |
        d[CENTRAL] = (
            @inf_dur{amt: c[AMT], lag: 0.0, dur: 20} 
            - m[KE]*s[CENTRAL]
        )
            
If the infusion duration varies between individuals use:

.. code-block:: pyml

    DERIVATIVES: |
        d[CENTRAL] = (
            @inf_dur{amt: c[AMT], lag: 0.0, dur: c[DUR]} 
            - m[KE]*s[CENTRAL]
        )
        
See :ref:`@inf_dur` for some more syntax examples.

The Amount-vs-Time curve for an infusion (without elimination) is a ramp function where the cumulative dose rises linearly until it reaches the total amount administered (:numref:`fig_inf_dur_dose`).
        
.. _fig_inf_dur:
.. figure:: /case-studies/indiv_examples/dosing/inf_dur_tut/images/gen_sim_grph_outputs/allOBS_vs_TIME/comb_spag.*
    :name: fig_inf_dur_dose
    :align: center
    :width: 50%
    :alt: Cumulative amount following a infusion dose of 95 |nbsp| mg over a duration of 19 |nbsp| min with no elimination
    
    Cumulative amount following a infusion dose of 95 |nbsp| mg over a duration of 19 |nbsp| min with no elimination
    

.. _infrate_dose:

Infusion Rate
-------------------

An infusion duration is coded by:

.. code-block:: pyml

    @inf_rate{amt: c[AMT], lag: m[LAG], rate: c[RATE]}
 
in the equation for the appropriate compartment in the **DERIVATIVES:** section of a fit or tutorial script.

The amount and lag are coded in the same way as for a bolus dose.

Infusion rate can either be included in the input data or can be estimated as a parameter.

.. note:: 
    
    See the :ref:`sum_link_inf_rate_dosing_tut` for :ref:`tut_script` used to generate results in this section.

An example of an infusion dose at a rate of 5 dose units per time unit added to a one compartment model with no lag time is:

.. code-block:: pyml

    DERIVATIVES: |
        d[CENTRAL] = (
            @inf_rate{amt: c[AMT], lag: 0.0, rate: 5} 
            - m[KE]*s[CENTRAL]
        )
            
If the infusion rate is different between individuals use:

.. code-block:: pyml

    DERIVATIVES: |
        d[CENTRAL] = (
            @inf_rate{amt: c[AMT], lag: 0.0, rate: c[RATE]} 
            - m[KE]*s[CENTRAL]
        )
            
See :ref:`@inf_rate` for some more syntax examples.
        
.. figure:: /case-studies/indiv_examples/dosing/inf_rate_tut/images/gen_sim_grph_outputs/allOBS_vs_TIME/comb_spag.*
    :name: fig_inf_rate_dose
    :align: center
    :width: 50%
    :alt: Cumulative amount following a infusion dose of 95 |nbsp| mg at a rate of 5 |nbsp| mg/min with no elimination
    
    Cumulative amount following a infusion dose of 95 |nbsp| mg at a rate of 5 |nbsp| mg/min with no elimination
    