MATLAB: Continuous vs Discrete Dosing in SimBiology

SimBiology

I am using SimBiology and want to administer a dose continuously instead of discretely. 
1) How can I define the duration of a continuous dosing? For example, I want to have dosing from t=0 to t=2 while the simulation time is 24 hours (from t=0 to t=24). In other word, after 2 hours of dosing simulation runs for 22 hours.
2) Alternatively, how can I administer a continuous dosage throughout the entire duration of my simulation? 
3) Lastly, how can I administer a a dosage at a particular instance in time? For example, over 24 hours I want all the dosage to be in one instance of time at every hour with none of it between each hour. 

Best Answer

1) The RepeatDose (or ScheduleDose) allows you to do this.
If you want to give an infusion at a rate of 3 milligram/hour for 2 hours. That would mean that you give a total dose of 6 milligrams. You would create a dose with the following:
  • Rate = 3
  • RateUnits = milligram/hour
  • Amount = 6
  • AmountUnits = milligram
SimBiology automatically takes care of ensuring that this is done continuously through the given time. A totaly of 7 milligrams will be continuously distributed. 
2) Use a repeat or scheduled dose with just one dose starting at t=0. You can set the 'rate' parameter to the rate you need and set the 'amount' parameter to a large number. This way, the total amount will never be reached and the dose is given continuously. Your 'amount' should be larger than 'rate*(duration of simulation)'
3) The way that you can make this instantaneous is to set the 'rate' to a value of '0'.