openaps / oref0

oref0: The open reference implementation of the OpenAPS reference design.
http://www.OpenAPS.org
MIT License
427 stars 396 forks source link

Test openaps using Matlab simulink #1396

Open dehengcai opened 3 years ago

dehengcai commented 3 years ago

Hello all, I want to test the glucose control performance of the openaps using Matlab simulink. But I am confused about how to connect the openaps to Matlab. Is there any way to achieve this?

scottleibrand commented 3 years ago

I’ve never used Matlab, so you’ll have to be more specific about what it needs.

dehengcai commented 3 years ago

Thank you for your timely reply. More specifically, I want to use Matlab simulink as a virtual patient, which can produce the virtual CGM data to the openaps, and execute the basal rate recommended by the openaps. I have read the source codes of the openaps, but am still confused about the codes. Is the basal rate recommendation algorithm only programmed in the determine-basal.js? If yes, is that say if I can feed the correct inputs into the determine-basal.js, I can get the recommended basal rate from the openaps? Moreover, how do I program the basic information (e.g, ISF, carb ratio and basal rate) of the virtual patient into the openaps.

scottleibrand commented 3 years ago

Take a look at https://github.com/openaps/oref0/blob/dev/bin/oref0-simulator.sh and https://github.com/openaps/oref0/blob/dev/bin/oref0-backtest.sh to see how we did something similar.