.. _dosing_functions:

Dosing Functions
###################

:numref:`table_dosing_functions` shows the dosing functions that are available in the |derivatives| section and their parameters:-

.. _table_dosing_functions:

.. list-table:: Dosing Functions
    :header-rows: 1
    
    * - Name
      - Parameters
      
    * - :ref:`@bolus`
      - amt/lag
      
    * - :ref:`@inf_rate` 
      - amt/lag/rate
      
    * - :ref:`@inf_dur` 
      - amt/lag/dur
      
    * - :ref:`@gamma` 
      - amt/lag/alpha/beta
      
    * - :ref:`@weibull` 
      - amt/lag/lambda/kappa

      
.. _@bolus:
      
@bolus
=======

Example of :ref:`Bolus dosing<bolus_dose>`:-

.. code-block:: pyml

    DERIVATIVES: |
        d[DEPOT] = @bolus{amt: c[AMT], lag: m[LAG]} - m[KE] * s[DEPOT]
        
This bolus dose will be activated by the 'dose' entry in the |type| field of the |popy| |data_file|. Note it is also possible to specify a **named** bolus dose as follows:-

.. code-block:: pyml

    DERIVATIVES: |
        dose[my_bolus] = @bolus{amt: c[AMT], lag: m[LAG]} 
        d[DEPOT] = dose[my_bolus] * s[DEPOT]

This bolus dose will be activated by the 'dose:my_bolus' entry in the |type| field of the |popy| |data_file|.

        
.. _@inf_rate:
      
@inf_rate
================

Example of :ref:`infusion rate <infrate_dose>` dosing:-

.. code-block:: pyml

    DERIVATIVES: |
        d[DEPOT] = (
            @inf_rate{amt: c[AMT], lag: m[LAG], rate: c[RATE]} 
            - m[KE] * s[DEPOT])
        
This infusion rate dose will be activated by the 'dose' entry in the |type| field of the |popy| |data_file|. Note it is also possible to specify a **named** infusion rate dose as follows:-

.. code-block:: pyml

    DERIVATIVES: |
        dose[my_inf_rate] = @inf_rate{amt: c[AMT], lag: m[LAG], rate: c[RATE]}  
        d[DEPOT] = dose[my_inf_rate] * s[DEPOT]

This infusion rate dose will be activated by the 'dose:my_inf_rate' entry in the |type| field of the |popy| |data_file|.
        
.. _@inf_dur:
      
@inf_dur
================

Example of :ref:`infusion duration <infdur_dose>` dosing:-

.. code-block:: pyml

    DERIVATIVES: |
        d[DEPOT] = (
            @inf_dur{amt: c[AMT], lag: m[LAG], dur: c[DUR]} 
            - m[KE] * s[DEPOT])
        
This infusion duration dose will be activated by the 'dose' entry in the |type| field of the |popy| |data_file|. Note it is also possible to specify a **named** infusion duration dose as follows:-

.. code-block:: pyml

    DERIVATIVES: |
        dose[my_inf_dur] = @inf_dur{
            amt: c[AMT], lag: m[LAG], dur: c[DUR]}
        d[DEPOT] = dose[my_inf_dur] * s[DEPOT]

This infusion duration dose will be activated by the 'dose:my_inf_dur' entry in the |type| field of the |popy| |data_file|.
        
.. _@gamma:
      
@gamma
================

Example of :ref:`gamma <gamma_dose>` dosing:-

.. code-block:: pyml

    DERIVATIVES: |
        d[DEPOT] = (
            @gamma{amt: c[AMT], lag: m[LAG], 
                alpha: m[ALPHA], beta: m[BETA]} 
            - m[KE] * s[DEPOT]
        )
        
This gamma dose will be activated by the 'dose' entry in the |type| field of the |popy| |data_file|. Note it is also possible to specify a **named** gamma dose as follows:-

.. code-block:: pyml

    DERIVATIVES: |
        dose[my_gamma] = @gamma{
            amt: c[AMT], lag: m[LAG], 
            alpha: m[ALPHA], beta: m[BETA]}
        d[DEPOT] = dose[my_gamma] * s[DEPOT]

This gamma dose will be activated by the 'dose:my_gamma' entry in the |type| field of the |popy| |data_file|. 
        
.. _@weibull:
      
@weibull
================

Example of :ref:`weibull <weibull_dose>` dosing:-

.. code-block:: pyml

    DERIVATIVES: |
        d[DEPOT] = (
            @weibull{
                amt: c[AMT], lag: m[LAG], 
                lambda: m[LAMBDA], kappa: m[KAPPA]} 
            - m[KE] * s[DEPOT]
        )
        
This weibull dose will be activated by the 'dose' entry in the |type| field of the |popy| |data_file|. Note it is also possible to specify a **named** weibull dose as follows:-

.. code-block:: pyml

    DERIVATIVES: |
        dose[my_weibull] = @weibull{
            amt: c[AMT], lag: m[LAG], 
            lambda: m[LAMBDA], kappa: m[KAPPA]}
        d[DEPOT] = dose[my_weibull] * s[DEPOT]

This weibull dose will be activated by the 'dose:my_weibull' entry in the |type| field of the |popy| |data_file|.
        
