.. _dosing_examples:

Dose Administration
######################
So far we have considered only a bolus dose - a single amount administered instantaneously to a given compartment, either intravenously (|eg| an injection) or via absorption (|eg| an orally administered pill).

There are, of course, other means of administering a drug and here we will introduce the dosing functions supported by |popy|. All of the dosing functions have two arguments in common:

* the *amt* argument is the quantity of drug administered in total.
* the *lag* argument defines a delay between the drug being administered (as specified in the |data_file|) and the drug entering the compartment where it is administered.  This can be useful when very little drug is absorbed immediately. Unless otherwise stated, it is assumed that the lag time is zero.

The remaining arguments to the dosing function are dependent on the dose type.

.. _bolus_dose:

Bolus Dose
==========================
.. include:: dosing/bolus.txt


.. _inf_dose:

Infusion
==========================
.. include:: dosing/infusion.txt

      
.. _infdur_dose:

Infusion Duration
-----------------------
.. include:: dosing/inf_dur.txt


.. _infrate_dose:

Infusion Rate
-------------------
.. include:: dosing/inf_rate.txt


.. _gamma_dose:

Gamma Dose
==========================
.. include:: dosing/gamma.txt


.. _weibull_dose:

Weibull Dose
==========================
.. include:: dosing/weibull.txt


.. _repeated_dosing:

Repeated Dosing
==================

There need not be only one dose administered to the subject for a given experiment -- several doses may be given, for example to maintain drug concentration at a steady state over a period of time. |popy| handles this by allowing multiple dose lines in the |data_file| and superimposing the resulting curves, see :numref:`table_repeated_dosing`.

.. list-table:: Repeated dosing, administered to a one compartment model with first order elimination
    :name: table_repeated_dosing

    * - Repeated Bolus Dosing
      - Repeated Infusion Dosing
    * - .. thumbnail:: /_autogen/indiv_examples/dosing/bolus_repeated_tut/images/gen_dense/comb_spag_.*
      - .. thumbnail:: /_autogen/indiv_examples/dosing/inf_rate_repeated_tut/images/gen_dense/comb_spag_.*
    * - Repeated Gamma Dosing
      - Repeated Weibull Dosing
    * - .. thumbnail:: /_autogen/indiv_examples/dosing/weibull_repeated_tut/images/gen_dense/comb_spag_.*
      - .. thumbnail:: /_autogen/indiv_examples/dosing/gamma_repeated_tut/images/gen_dense/comb_spag_.*

.. note:: 
    
    See :ref:`sum_link_bolus_dosing_repeated_tut`, :ref:`sum_link_inf_rate_dosing_repeated_tut`, :ref:`sum_link_gamma_dosing_repeated_tut` and :ref:`sum_link_weibull_dosing_repeated_tut` for the :ref:`tutorial scripts<tut_script>`  used to generate results in this section.
      
Note |popy| can superimpose consecutive complex :ref:`dosing_functions` (|eg| |weibull| and |gamma| functions) that can cause numerical instability in other |pkpd| packages.
