design insulin infusion pump using model-凯发k8网页登录
this example show you how to use a model-based systems engineering workflow to investigate optimal insulin infusion pump design. insulin pumps are medical devices used by people with diabetes that mimic the human pancreas by delivering insulin continuously and delivering variable amounts of insulin with food intake.
the purpose of an insulin pump wearable device is to keep the blood glucose level of the wearer near a healthy set point by infusing insulin as needed and in response to food intake. this example shows a proposed insulin infusion pump system with two sensor and three pump variants that represent alternate design choices.
begin by determining system requirements, then create detailed design models with code generation and verification tests. finally, simulate the system architecture model that meets the evolving requirements.
insulin pump system architecture model
this figure shows the system composer™ architecture model for the insulin pump system. this example uses stateflow® blocks. if you do not have a stateflow license, you can open and simulate the model but can only make basic changes, such as modifying block parameters.
systemcomposer.openmodel("insulininfusionpumpsystem");
the bgsensor
component measures the blood glucose level. the controller
component makes a decision about the insulin rate. the pump
component provides insulin to the body using the infusionset
. the patient
receives the treatment. the bgmeter
calibrates the bgsensor
. finally, the hid
(human interface device) component may be a mobile app on the phone for the patient to communicate with the system. the hid
provides information to the patientdataserver
component, which sends analyses to the clinician
, regulator
, and reimburser
components.
system requirements and links
use requirements toolbox™ to analyze the system requirements, further break them down into subsystem requirements, and link derived requirements to architectural components that satisfy them. a requirements toolbox license is required to link, trace, and manage requirements in system composer.
manage requirements and architecture together in the requirements perspective from requirements toolbox. select apps > requirements manager. to edit requirements, select requirements > requirements editor or enter these commands to open the (requirements toolbox).
slreq.open("infusion_pump_system"); slreq.open("insulin_pump_controller_software_specification"); slreq.editor
the requirements decomposition and analysis at this point represent these concerns:
accuracy of delivery
mitigations against over-infusion, which leads to dangerously low blood glucose levels
fault analysis to prevent negative outcomes, for example, when the battery is depleted or the device runs out of medication
on the architecture model, select the requirements icon to see the requirements that are associated with the component. for example, below are the requirements linked to the pump
component.
conversely, select a requirement to see the highlighted component by which the requirement is implemented. for example, the bgsensor
component implements the sense blood glucose
requirement.
outcome analysis for optimal design choice
outcome analysis consists of a trade study where the goal is to maximize the business value of the design options based on calculations that sum up different component properties with weighting factors. many are directly entered properties, such as non-recurring engineering (nre) costs to develop the component. compliance score, however, is a derived property that is based on different data for each type of component. these properties model the burden to an end user of the system. the compliance score includes these considerations:
energy consumption
size and weight
accuracy
mean time between failures (mtbf)
sound level produced during operation
ease of use
navigate to modeling > profiles > profile editor, or enter this command.
systemcomposer.profile.editor
a system composer profile, defined in the , is composed of stereotypes with properties defined. you can apply stereotypes to components in the model to assign specific property values to each component.
the pump and sensor trade study includes these steps:
collect all variant combinations.
activate variants one by one to represent all the combinations.
iterate over the model to calculate compliance and compute the outcome using the stored and calculated parameters.
collect outcomes and weight them using the same units.
provide the optimized option.
a block named bgsensor
contains two different sensor variants representing example sensors from different manufacturers.
the variant component block named pump
contains three different pumps in this example called peristalticpump
, syringepump
, and patchpump
.
to programmatically cycle between the different variant choice combinations, calculate compliance, and monitor the outcome to determine the optimal design choice, run outcomeanalysis.m
. for more information on variant analysis, see .
run("outcomeanalysis.m")
the normalized outcome score is at a maximum for the sensora syringepump
combination. this design choice is optimal for the insulin pump.
controller implementation model
implement the insulin infusion pump controller in simulink®. the input ports in this implementation include user input
, with user metrics that the insulin pump reads, and hardware status
, with information about the insulin pump. the block named modecontrol
deteremines in which mode the insulin pump must operate.
the block named modecontrol
contains a stateflow chart with details on how to select the mode.
the three modes include:
alarm
mode, where the system is be suspended, repaired, and restarted once clearbolus
delivery mode to deliver insulin quickly with food intakebasal
delivery mode to deliver insulin over a longer period of time to keep glucose levels steady throughout the day
after the mode is selected, this component behavior determines the insulin rate for the outport.
verification and validation using test manager
you can use model-based design to verify architectural designs and system requirements. the abstract architecture model and the detailed simulink design model are connected with traceable requirement links. this section requires a simulink® test™ license.
the controller
implementation model in simulink demonstrates requirements traceability for the alarm handling
requirement.
load and view the (simulink test) using these commands.
sltest.testmanager.load("controller_tests.mldatx");
sltest.testmanager.view
the alarm_detection
functional test verifies the alarm handling
requirement.
click the icon to the right of the harness box to open the test harness. in this example, the block named controller
is isolated for unit testing using a test harness. for more information on creating a test harness, see (simulink test).
double-click the test sequence block to view the steps in the test sequence. the steps define a scenario to verify the functioning of the alarm system.
to run this test, go back into the (simulink test).
sltest.testmanager.view
right-click the test alarm_detection
in the test browser and select run. in the results and artifacts section, view your test results. a passing test indicates that the system requirement alarm handling
is verified by the conditions defined in the test assessment block:
whether the alarm disables insulin delivery when there is low battery, occlusion (line blockage), or low medication (insulin)
whether the system restarts after the issue has passed
see also
apps
- | (simulink test) | (requirements toolbox)