Hi,
The issue you are seeing is addressed in the "Tip" on the documentation for UnitConversion. The problem is that you are have written your function calculateSolubilityCD to assume that the input arguments have specific units, but SimBiology does not pass the input arguments in with those units. I would address the issue using the advice from the Tip (ensure input arguments are passed in as dimensionless) as follows:
First, I would create parameters with value 1 and the units of your input and output arguments:
- Parameter mg_per_mL with value 1 and units "milligram/milliliter"
- Parameter g_per_mol with value 1 and units "gram/mole"
Then, I would change
ColonSolubility=calculateSolubilityCD(Colon.CD,CDMW,AGMW)
to
ColonSolubility=mg_per_mL*calculateSolubilityCD(Colon.CD/mg_per_mL,CDMW/g_per_mol,AGMW/g_per_mol)
Finally, you can remove the factors of 1000 from calculateSolubilityCD.
Good luck!
-Arthur
0 Comments
Sign in to comment.