MATLAB: Can I use “mL/kg” and “mg/kg” for compartment and species units in SimBiology

capacityunitsinitialamountunitsSimBiologyunits

Best Answer

Currently, defining species in milligram/kilogram is not allowed in SimBiology. Species have to be defined in dimensions of amount or concentration. Compartments need to be defined in units of length, area or volume. As such, you can't create a compartment with unit 'kilogram'.
In order to calculate concentrations, SimBiology uses the compartmental dimensions to convert the amount of a species (gram/mole) to concentration (gram/liter, mole/liter).
To workaround, please define your species in units of 'milligram', and then add two parameters (bodyweight and [speciesName_normalized]). On the second parameter, add a repeated assignment speciesName_normalized = speciesName/bodyweight.
Alternatively, you could also implicitly implement this by just assuming that all species are normalized by bodyweight and normalizing the relevant parameters/dose amounts by bodyweight (e.g. your dose is implied to be in milligram/kilogram but it is still defined in your model as 'milligram).