These are chat archives for nightscout/intend-to-bolus

Feb 2015
Feb 14 2015 00:39
Computations are taking a long time in MATLAB, but fortunately I can write all of it to file for use in future runs. It's been running for a couple of hours now and the code is correct and has not given any runtime or compile time errors. There are no loops or anything, it's just a bunch of computations. I have an Intel i7 laptop with Haswell chipset and 8 GB of RAM.
Also, I feel weird due to the medicine that was given to me due to GI problems, but maybe it will keep me from ending up in the hospital again due to severely low blood potassium levels.
Darrell Wright
Feb 14 2015 01:05
Might be worth reimplementing the algorithm in C++.
Then again, why bother for one offs
Feb 14 2015 01:08
It would be really hard (extremely hard to). Like it uses a bunch of Gaussian Mixture Models, probability distributions, and differential equations. It's ideal work for MATLAB, especially considering that a controller is going to be put onto it. However, I can port it to C++ plus some MEX (MATLAB executable files) for the toolbox components, so that might be a good idea.
I already have the controller just FYI. It's currently being used in clinical trials with Stanford. Every file needed for it is there except for the Controller.m file, which won't be hard to figure out, in my opinion.
It's the only controller that covers for missed meal boluses, however, the target is set at 112.5 (a nice number geometrically) in this version of the controller. Currently, in clinical trials, the target is set at 140.
The appendices are where the files are.
Darrell Wright
Feb 14 2015 01:23
Quick question. why differentiate between a bolus and a basal dose? Aren't they the same as far as modelling would go
Feb 14 2015 01:24
They are the same in the modelling I am using. Everything is in U/min.
Darrell Wright
Feb 14 2015 01:25
Ah im still at the header
Feb 14 2015 01:26
If you PM me your email, I can send you the dropbox (backup) of my work, so far
This is what my models are based off of Stochastic Virtual Population of Subjects With
Type 1 Diabetes for the Assessment of Closed-Loop
Glucose Controllers
So basically, the design process for the mathematical modeling:
  1. Design a virtual patient from models
  2. Test the virtual patient
  3. Modify the virtual patient
  4. Go real-time (live on myself)
Design process overall:
  1. Mathematical modeling
  2. Controller
  3. Interfacing with Nightscout and pump
Scott Leibrand
Feb 14 2015 01:43
Nice work. Glad to see how quickly it's coming along. Looking forward to seeing simulation results. :-)
Feb 14 2015 01:44
Thanks. Will do.