Patent attributes
Disclosed herein are techniques related to model predictive control. The techniques may involve generating a desired glucose trajectory that approaches a desired steady state setpoint from a current glucose value over a prediction horizon. The techniques may involve generating a plurality of insulin delivery patterns. Each insulin delivery pattern may correspond to an amount of insulin to be delivered over a control horizon. The techniques may involve generating a plurality of predicted glucose trajectories over the control horizon. Each predicted glucose may be generated based on the current glucose value and a respective insulin delivery pattern. The techniques may involve comparing the desired glucose trajectory against each predicted glucose trajectory and selecting a predicted glucose trajectory that is more similar to the desired glucose trajectory than any other predicted glucose trajectory. The techniques may involve determining an insulin delivery pattern used to generate the selected predicted glucose trajectory.