# Create Simple Model - MATLAB & Simulink

Translated by Mouseover text to see original. Click the button below to return to the English verison of the page. Note: This page has been translated by MathWorks. Please click here To view all translated materals including this page, select Japan from the country navigator on the bottom of this page. MathWorks Machine TranslationThe automated translation of this page is provided by a general purpose third party translator tool.MathWorks does not warrant, and disclaims all liability for, the accuracy, suitability, or fitness for purpose of the translation.This example also uses:This example shows how to simulate and yze a model in SimBiology® using a physiologically based model of the glucose-insulin system in normal and diabetic humans.This example requires Statistics and Machine Learning Toolbox™ and Optimization Toolbox™.Meal Simulation Model of the Glucose-Insulin System. C. Dalla Man, R.A. Rizza, and C. Cobelli. IEEE Transactions on Biomedical Engineering (2007) 54(10), 1740-1749.A System Model of Oral Glucose Absorption: Validation on Gold Standard Data. C. Dalla Man, M. Camilleri, and C. Cobelli. IEEE Transactions on Biomedical Engineering (2006) 53(12), 2472-2478.Implement a SimBiology model of the glucose-insulin response.Simulate the glucose-insulin response to one or more meals for normal and impaired (diabetic) subjects.Perform parameter estimation using sbiofit with a forcing function strategy.In their 2007 publication, Dalla Man et al. develop a model for the human glucose-insulin response after a meal. This model describes the dynamics of the system using ordinary differential equations. The authors used their model to simulate the glucose-insulin response after one or more meals, for normal human subjects and for human subjects with various kinds of insulin impairments. The impairments were represented as alternate sets of parameter values and initial conditions.We implemented the SimBiology model, m1, by:Translating the model equations in Dalla Man et al. (2007) into reactions, rules, and events.Organizing the model into two compartments, one for glucose-related species and reactions (named Glucose appearance) and one for insulin-related species and reactions (named Insulin secretion).Using the parameter values and initial conditions from the model equations and from Table 1 and Figure 1.Including an equation for the gastric emptying rate as presented in Dalla Man et al. (2006).Setting the units for all species, compartments, and parameters as specified by Dalla Man et al. (2007), which allows the SimBiology model to be simulated using unit conversion. (Note that SimBiology also supports the use of dimensionless parameters by setting their ValueUnits property to dimensionless.)Setting the configuration set TimeUnits to hour, since simulations were conducted over 7 or 24 hours.Using a basis of 1 kilogram of body weight to transform species and parameters that were normalized by body weight in the original model. Doing so made species units in amount or concentration, as required by SimBiology.We represented the insulin impairments in the SimBiology model as variant objects with the following names:Type 2 diabeticLow insulin sensitivityHigh beta cell responsivityLow beta cell responsivityHigh insulin sensitivityWe represented the meals in the SimBiology model as dose objects:A dose named Single Meal represents a single meal of 78 grams of glucose at the start of a simulation.A dose named Daily Life represents one day's worth of meals, relative to a simulation starting at midnight: breakfast is 45 grams of glucose at 8 hours of simulation time (8 a.m.), lunch is 70 grams of glucose at 12 hours (noon), and dinner is 70 grams of glucose at 20 hours (8 p.m.).A diagram of the SimBiology model is shown below: Load the model.Suppress an informational warning that is issued during simulations.Select the Single Meal dose object and display its properties.Simulate for 7 hours.Display the simulation time units (and StopTime units).Simulate a single meal for a normal subject.Select the Type 2 diabetic variant and display its properties.Simulate a single meal for a Type 2 diabetic.Compare the results for the most important outputs of the simulation.Plasma Glucose (species Plasma Glu Conc)Plasma Insulin (species Plasma Ins Conc)Endogenous Glucose Production (parameter Glu Prod)Glucose Rate of Appearance (parameter Glu Appear Rate)Glucose Utilization (parameter Glu Util)Insulin Secretion (parameter Ins Secr)Note the much higher concentrations of glucose and insulin in the plasma, as well as the prolonged duration of glucose utilization and insulin secretion.Set the simulation StopTime to 24 hours.Select daily meal dose.Simulate three meals for a normal subject.Simulate the following combinations of impairments:Impairment 1: Low insulin sensitivityImpairment 2: Impairment 1 with high beta cell responsivityImpairment 3: Low beta cell responsivityImpairment 4: Impairment 3 with high insulin sensitivityStore the impairments in a cell array.Simulate each impairment.Compare the plasma glucose and plasma insulin results.Note that either low insulin sensitivity (dashed green line, ) or low beta-cell sensitivity (dashed-dotted cyan line, ) lead to increased and prolonged plasma glucose concentrations (top row of plots). Low sensitivity in one system can be partially compensated by high sensitivity in another system. For example, low insulin sensitivity and high beta-cell sensitivity (dotted red line, ) results in relatively normal plasma glucose concentrations (top row of plots). However, in this case, the resulting plasma insulin concentration is extremely high (bottom row of plots).Rather than simultaneously estimating parameters for the entire model, the authors perform parameter estimation for different subsystems of the model using a forcing function strategy. This approach requires additional experimental data for the "inputs" of the submodel. During fitting, the input data determine the dynamics of the inputs species. (In the full model, the dynamics of the inputs are determined from the differential equations.) In SimBiology terms, you can implement a forcing function as a repeated assignment rule that controls the value of a species or parameter that serves as an input for a subsystem of the model. In the following sections, we use the parameter fitting capabilities of SimBiology to refine the authors' reported parameter values.The gastrointestinal model represents how glucose in a meal is transported through the stomach, gut, and intestine, and then absorbed into the plasma. The input to this subsystem is the amount of glucose in a meal, and the output is the rate of appearance of glucose in the plasma. However, we also estimate the meal size since the value reported by the authors is inconsistent with the parameters and simulation results. Because this input only occurs at the start of the simulation, no forcing function is required.The function sbiofit supports the estimation of parameters in SimBiology models using several different algorithms from MATLAB™, Statistics and Machine Learning Toolbox, Optimization Toolbox, and Global Optimization Toolbox. First, estimate the parameters using Statistics and Machine Learning Toolbox function nlinfit.Now, estimate the parameters using the Optimization Toolbox function fminunc.Compare the simulation before and after fitting.Plot the change in parameter values, relative to reported values.Note that the model fits the experimental data significantly better if the meal size (Dose) is significantly larger than reported, the parameter kmax is significantly larger than reported, and kabs is smaller than reported.The muscle and adipose tissue model represents how glucose is utilized in the body. The "inputs" to this subsystem are the concentration of insulin in the plasma (Plasma Ins Conc), the endogenous glucose production (Glu Prod), and the rate of appearance of glucose (Glu Appear Rate). The "outputs" are the concentration of glucose in the plasma (Plasma Glu Conc) and the rate of glucose utilization (Glu Util).Because the inputs are a function of time, they need to be implemented as forcing functions. Specifically, the values of Plasma Ins Conc, Glu Prod, and Glu Appear Rate are controlled by repeated assignments that call functions to do linear interpolation of the reported experimental values. When using these functions to control a species or parameter, you must make inactive any other rule that is used to set its value. To facilitate the selection of these rules, the rule Name properties contain meaningful names.Plot the change in parameter values, relative to reported values.Clean up the changes to the model.Compare the simulation before and after fittingNote that significantly increasing some parameters, such as Vmx, allows a much better fit of late-time plasma glucose concentrations.Restore warning settings.SimBiology contains several features that facilitate the implementation and simulation of a complex model of the glucose-insulin system. Reactions, events, and rules provide a natural way to describe the dynamics of the system. Unit conversion allows species and parameters to be specified in convenient units and ensures the dimensional consistency of the model. Dose objects are a simple way to describe recurring inputs to a model, such as the daily meal schedule in this example. SimBiology also provides built-in support for ysis tasks like simulation and parameter estimation.You clicked a link that corresponds to this MATLAB command: Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.Choose your country to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .You can also select a location from the following list:See all countriesAccelerating the pace of engineering and scienceMathWorks is the leading developer of mathematical computing software for engineers and scientists.Discover...© 1994-2017 The MathWorks, Inc.Join the conversation

Translated by Mouseover text to see original. Click the button below to return to the English verison of the page. Note: This page has been translated by MathWorks. Please click here To view all translated materals including this page, select Japan from the country navigator on the bottom of this page. MathWorks Machine TranslationThe automated translation of this page is provided by a general purpose third party translator tool.MathWorks does not warrant, and disclaims all liability for, the accuracy, suitability, or fitness for purpose of the translation.Create 2-D Line GraphCreate Graph in New Figure WindowPlot Multiple LinesColors, Line Styles, and MarkersSpecify Line StyleSpecify Different Line Styles for Multiple LinesSpecify Line Style and ColorSpecify Line Style, Color, and MarkersPlot Only Data PointsThis example shows how to create a simple line graph. Use the linspace function to define x as a vector of 100 linearly spaced values between 0 and .Define y as the sine function evaluated at the values in x.Plot y versus the corresponding values in x.This example shows how to create a graph in a new figure window, instead of plotting into the current figure. Define x and y.Create a stairstep plot of y versus x. Open a new figure window using the figure command. If you do not open a new figure window, then by default, MATLAB® clears existing graphs and plots into the current figure.This example shows how to plot more than one line by passing multiple x,y pairs to the plot function.Define y1 and y2 as sine waves with a phase shift. Plot the lines.plot cycles through a predefined list of line colors.To change the line color, line style, and marker type, add a line specification input argument to the x,y pair. For example, 'g:*' plots a green dotted line with star markers. You can omit one or more options from the line specification, such as 'g:' for a green dotted line with no markers. To change just the line style, specify only a line style option, such as '--' for a dashed line. For more information, see the LineSpec input argument for plot.This example shows how to create a plot using a dashed line. Add the optional line specification, '--', to the x,y pair.This example shows how to plot two sine waves with different line styles by adding a line specification to each x,y pair. Plot the first sine wave with a dashed line using '--'. Plot the second sine wave with a dotted line using ':'.This example shows how to specify the line styles and line colors for a plot.Plot a sine wave with a green dashed line using '--g'. Plot a second sine wave with a red dotted line using ':r'. The elements of the line specification can appear in any order.This example shows how to specify the line style, color, and markers for two sine waves. If you specify a marker type, then plot adds a marker to each data point.Define x as 25 linearly spaced values between 0 and . Plot the first sine wave with a green dashed line and circle markers using '--go'. Plot the second sine wave with a red dotted line and star markers using ':r*'. This example shows how to plot only the data points by omitting the line style option from the line specification.Define the data x and y. Plot the data and display a star marker at each data point.contour | linspace | loglog | plot | plotyy | scatter | semilogx | semilogy | stairs | stemYou clicked a link that corresponds to this MATLAB command: Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.Choose your country to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .You can also select a location from the following list:See all countriesAccelerating the pace of engineering and scienceMathWorks ist der führende Entwickler von Software für mathematische Berechnungen für Ingenieure und Wissenschaftler.Entdecken Sie...© 1994-2017 The MathWorks, Inc.Folgen Sie uns