Two-Compartment Alcohol Model

Source Notebook

Two-compartment model of alcohol concentration in the body

Examples

Basic Examples (3) 

Retrieve the model:

In[1]:=
ResourceData[\!\(\*
TagBox["\"\<Two-Compartment Alcohol Model\>\"",
#& ,
BoxID -> "ResourceTag-Two-Compartment Alcohol Model-Input",
AutoDelete->True]\)]
Out[1]=

The icon:

In[2]:=
ResourceData[\!\(\*
TagBox["\"\<Two-Compartment Alcohol Model\>\"",
#& ,
BoxID -> "ResourceTag-Two-Compartment Alcohol Model-Input",
AutoDelete->True]\), "Icon"]
Out[2]=

The annotation:

In[3]:=
ResourceData[\!\(\*
TagBox["\"\<Two-Compartment Alcohol Model\>\"",
#& ,
BoxID -> "ResourceTag-Two-Compartment Alcohol Model-Input",
AutoDelete->True]\), "Annotation"]
Out[3]=

Scope & Additional Elements (5) 

Available content elements:

In[4]:=
\!\(\*
TagBox[
RowBox[{"ResourceObject", "[", "\"\<Two-Compartment Alcohol Model\>\"",
      "]"}],
#& ,
BoxID -> "ResourceTag-Two-Compartment Alcohol Model-Input",
AutoDelete->True]\)["ContentElements"]
Out[4]=

The transfer function model:

In[5]:=
ResourceData[\!\(\*
TagBox["\"\<Two-Compartment Alcohol Model\>\"",
#& ,
BoxID -> "ResourceTag-Two-Compartment Alcohol Model-Input",
AutoDelete->True]\), "TransferFunctionModel"]
Out[5]=

The input variables:

In[6]:=
ResourceData[\!\(\*
TagBox["\"\<Two-Compartment Alcohol Model\>\"",
#& ,
BoxID -> "ResourceTag-Two-Compartment Alcohol Model-Input",
AutoDelete->True]\), "InputVariables"]
Out[6]=

Other variables:

In[7]:=
ResourceData[\!\(\*
TagBox["\"\<Two-Compartment Alcohol Model\>\"",
#& ,
BoxID -> "ResourceTag-Two-Compartment Alcohol Model-Input",
AutoDelete->True]\), "OtherVariables"]
Out[7]=

Temporal variable:

In[8]:=
ResourceData[\!\(\*
TagBox["\"\<Two-Compartment Alcohol Model\>\"",
#& ,
BoxID -> "ResourceTag-Two-Compartment Alcohol Model-Input",
AutoDelete->True]\), "TemporalVariable"]
Out[8]=

Analysis (3) 

The numerical model:

In[9]:=
nssm = ResourceData[\!\(\*
TagBox["\"\<Two-Compartment Alcohol Model\>\"",
#& ,
BoxID -> "ResourceTag-Two-Compartment Alcohol Model-Input",
AutoDelete->True]\)] /. ResourceData[\!\(\*
TagBox["\"\<Two-Compartment Alcohol Model\>\"",
#& ,
BoxID -> "ResourceTag-Two-Compartment Alcohol Model-Input",
AutoDelete->True]\), "Parameters"]
Out[9]=

The linear numerical model:

In[10]:=
ssm = N[ResourceData[\!\(\*
TagBox["\"\<Two-Compartment Alcohol Model\>\"",
#& ,
BoxID -> "ResourceTag-Two-Compartment Alcohol Model-Input",
AutoDelete->True]\), "StateSpaceModel"] /. ResourceData[\!\(\*
TagBox["\"\<Two-Compartment Alcohol Model\>\"",
#& ,
BoxID -> "ResourceTag-Two-Compartment Alcohol Model-Input",
AutoDelete->True]\), "Parameters"]]
Out[10]=

Plot their responses to a disturbance in the states:

In[11]:=
Table[OutputResponse[{sys, {1.2, 0}}, 0, {t, 0, 3000}], {sys, {nssm, ssm}}];
In[12]:=
Plot[{%[[1, 1]], %[[2, 1]]}, {t, 0, 300}, PlotRange -> All, PlotLegends -> {"nonlinear", "linear"}]
Out[12]=

Suba Thomas, "Two-Compartment Alcohol Model" from the Wolfram Data Repository (2025)  

Data Resource History

Source Metadata

Publisher Information