1. Field of Invention
The present invention relates generally to systems, apparatuses, and methods for simulating a mathematical model. The present invention may facilitate comparing and/or fitting simulated mathematical models to experimental data. The present invention may also allow users to share models and datasets easily with others.
2. Discussion of Background
In a typical scenario, a scientist or engineer hypothesizes a mathematical model describing some physical phenomena and needs to validate and refine the model by comparing it and fitting it to (i.e., replicating) experimental data. After parameters have been fit or identified, the model is simulated under different inputs so as to make predictions as to how the system would behave under different conditions.
Such analysis could also be useful in understanding the underlying physical phenomena by seeing how well different models fit the experimental data. Identified (fit) model parameters fit to the experimental data help classify the source of the data. For example, in the design of a suspension system consisting of a mass, spring, and dashpot, fitting a second order model to experimental data allows an engineer to classify the system as under damped, critically damped, or over damped.
Scientists and engineers must manually program custom software (e.g., in C++, Java, or another programming language) or program a specialized numerical programming language such as Matlab, Mathmatica, R, Python, Perl, S+, or SAS Institute software to describe a mathematical model, to choose and implement the computational methods for solving the model, and to apply experimental data to the model. A custom program needs to be written for each mathematical model to be analyzed. Because most physical phenomena are described by dynamic systems consisting of multiple differential equations, writing computer programs or scripts in mathematical modeling tools is very involved and requires specialized knowledge of applied mathematics (e.g., computational algorithms for integrating differential equations). These software packages are installed on personal computers requiring much hard drive space hardware infrastructure with heavy processing capability.
Typically, a scientist who hypothesizes a mathematical model does not possess the programming expertise required to perform the mathematical analysis. A programmer is usually hired to perform the task. Moreover, a model typically needs to be changed multiple times as the scientist considers the results, and the program must be updated accordingly each time. There is a fair deal of overhead involved in this back-and-forth between the scientist and programmer.
Publishing a model or sharing it with other scientists is also problematic. Although there are many sources of published models and their related data (usually paper publications), a different party wishing to study the models will have to implement it on their own platform—requiring more programming.
Publishing models is typically done via paper publications that only cover the findings and not all of the data analyzed to arrive at those findings. For example, the raw experimental data used to test the hypothesis (model) is typically not included in the publication. It is very difficult for third-party scientists to validate the published model using their own experimental data. In order to do so, a third-party scientist would have to contact the publisher and ask for the necessary models and data, program the model to run in their own analysis tool (or custom program), and apply their own data to the model. In order to ask questions and resolve anomalies in the results, the third-party scientist will likely have to contact the author via email or phone, and the author will not be able to see exactly what the other scientist is doing unless the author replicates the analysis on this own system. There is considerable cost in reconciling differences in findings.
Accordingly, there is a need in the art for improved systems, apparatus, and methods for facilitating the creation and analysis of mathematical models as compared to experimental data and/or sharing models and datasets.
The present invention provides, among other advantages, improved systems, apparatuses, and methods for facilitating the creation and analysis of mathematical models as compared to experimental data. Some aspects of the invention may address one or more of the problems of convention mathematical model analysis by providing a system, apparatus, or method for analyzing mathematical models without the need for any programming. In some embodiments, the system may also provide a shareable, searchable repository where one or more user can publish their models and data. In one embodiment, a user may choose a model from the repository and run analysis on the chosen model. Some embodiments may enable collaboration, commenting, and/or asking questions. In some embodiments, users may be able to navigate to a specific workspace (i.e., model with its related data set) via the click of a link. In some embodiments, users may be able to run batches of computations on multiple combinations of models and data sets (e.g., a model may be fit to multiple data sets or multiple models may be fit to a data set or both). Some embodiments may use distributed processing (e.g., using map-reduce or other means) to speed batch computation.
Some aspects of the invention may provide a mathematical model analysis tool that requires no installation by the end user. The tool may run on a website and may be compatible with multiple devices and operating systems. In some embodiments, any device with a web browser may serve as a front end Graphical User Interface. In some non-limiting embodiment, inputs and/or data may be sent to a remote server where analysis is performed and results are sent back to the user's device.
In some embodiments, a system embodying aspects of the present invention may provide a visual tool (e.g., a graph) to ensure that the initial guess is reasonable. The visual tool may plot a simulation of the model using a set of values assigned to the parameters so that the user can choose a decent initial guess when fitting model parameters to experimental data. In some embodiments, the system may solve models consisting of multiple interdependent equations that may be discrete equations, differential equations, closed form equations, or a combination of two or more equation types. In some embodiments, the system may handle discrete inputs (e.g., step functions, impulses, interpolation methods, or a combination of them) well, and inputs may be constant or may change with time. In some embodiments, parameters may be constrained to be within certain bounds or constrained to a certain function. Parameters may be constrained as constants while others may be fit/identified by the system. In some embodiments, after fitting a model to a particular experimental dataset, the system may re-simulate the model under different inputs and initial conditions to optimize an output profile. This may allow the user to test the effect of different input profiles by computer before implementing them in real life.
In some embodiments, a system embodying aspects of the present invention may be capable of performing tests on multiple models against a particular data set and determining which models most adequately fit the data for their complexity (i.e., by using the residual runs test or the f test to compare pairs of models.) In some embodiments, the system may enable the user to run one or more tests to determine whether parameters identified from a group of data sets is significantly different from those derived from other data sets (e.g., the system may perform the P test or the Anova test.)
In some embodiments, a system embodying aspects of the present invention may offer a common platform and repository where mathematical models can be uploaded, searched, and tested against different data sets. Accordingly, the system may greatly improve collaboration between scientists, who can easily publish their models and data, and others, who can easily replicate the findings and verify them using their own experimental data. In some embodiments, there may be a forum/blog where questions can be posed alongside the model and data set to which they pertain. This may allow anomalies in scientists' findings to be easily resolved because all parties will be looking at the same results on the same platform, and all factors leading to the results may be clearly shown.
One aspect of the invention may provide a method of analyzing or simulating a mathematical model. The method may include receiving, at a computer, an identification of a user-defined model from a device remote from the computer. The method may include receiving the identified model. The model may include one or more model equations. The one or more model equations may include at least one differential equation and/or at least one closed form equation. The one or more model equations may not be written in a syntax particular to a specific programming language. The one or more model equations may include one or more parameters. The method may include receiving a parameter set including a parameter value for each of the one or more parameters from a device remote from the computer. The method may include receiving an identification of a dataset from a device remote from the computer. The method may include receiving the identified dataset. The dataset includes experimental data related to the model. The method may include generating a simulation of the model based on the one or more model equations and the parameter set. The method may include generating simulation results including a plot of the model simulation and the dataset. The method may include transmitting the simulation results to a device remote from the computer.
In some embodiments, the method may include calculating an error between the simulated model and the experimental data, and the simulation results may include the calculated error. In some embodiments, the method may include identifying a best fit parameter set including a best fit parameter for each of the one or more parameters.
In some embodiments, the parameter set may be an initial parameter set, and identifying the best fit parameter set may include: calculating an error between the simulated model and the experimental data; generating a new parameter set including a parameter value for each of the one or more parameters, wherein one or more of the parameter values of the new parameter set is different from a corresponding parameter value of the initial parameter set; generating a new simulation of the model based on the one or more model equations and the new parameter set; and calculating an error between the new simulated model and the experimental data.
In some embodiments, identifying the best fit parameter set may include iteratively generating new parameter sets, wherein the best fit parameter set is a set of the new parameter sets that minimizes a calculated error between a simulation of the model based on the one or more model equations and the set of the new parameter sets and the experimental data. In some embodiments, identifying the best fit parameter set may include using either a linear or non-linear least squares procedure. In some embodiments, identifying the best fit parameter set may include automatically determining whether to use a linear least squares procedure or a non-linear least squares procedure.
In some embodiments, the method may include generating a best fit simulation of the model based on the one or more model equations and the best fit parameter set, and generating best fit results including the best fit parameter set and a plot of the best fit simulation and the dataset. In some embodiments, the method may include receiving a second dataset, which includes experimental data related to the model, from a device remote from the computer; generating second simulation results including a plot of the model simulation and the second dataset; and transmitting the second simulation results to a device remote from the computer.
In some embodiments, the method may include receiving a second model from a device remote from the computer. The second model may include one or more second model equations that (i) include at least a differential equation or multiple closed form equations, (ii) are not written in a syntax particular to a specific programming language, and (iii) include one or more second model parameters. The method may include receiving a second parameter set including a parameter value for each of the one or more second model parameters from a device remote from the computer, generating a second simulation of the second model based on the one or more second model equations and the second parameter set, generating second simulation results including a plot of the second model simulation and the dataset, and transmitting the second simulation results to a device remote from the computer. In some embodiments, generating the second simulation of the second model may require none of re-writing, re-interpreting, and re-compilation of a program.
In some embodiments, the one or more model equations may include a differential equation. In some embodiments, the one or more model equations may include two or more differential equations. In some embodiments, the one or more model equations may include a closed form equation. In some embodiments, the one or more model equations include multiple closed form equations.
In some embodiments, the method may include receiving a second parameter set including a second parameter value for each of the one or more parameters from a device remote from the computer, generating a second simulation of the model based on the one or more model equations and the second parameter set, generating second simulation results including a plot of the second simulation of the model and the dataset, and transmitting the second simulation results to a device remote from the computer.
In some embodiments, generating the simulation of the model may include interpreting the one or more model equations as an interdependent system of equations. In some embodiments, interpreting the one or more model equations as an interdependent system of equations may include treating a state variable listed on the left hand side of a model equation of the one or more model equations that also appears on the right hand side of a model equation of the one or more model equations as the same variable.
Another aspect of the invention may provide a computer system for analyzing or simulating a mathematical model. The computer system may include a storage device; a computer; and a computer readable medium storing computer readable instructions executable by said computer. The computer may be operative to receive an identification of a user-defined model from a remote device. The computer may be operative to receive the identified model from the storage device. The received model may include one or more model equations. The one or more model equations may include at least a differential equation and/or at least one closed form equations. The one or more model equations may not be written in a syntax particular to a specific programming language. The one or more model equations may include one or more parameters. The computer may operative to receive an identification of a dataset from the remote device. The computer may be operative to receive the identified dataset from the storage device. The received dataset may include experimental data related to the model. The computer may operative to receive a parameter set including a parameter value for each of the one or more parameters from the remote device. The computer may be operative to generate a simulation of the model based on the one or more model equations and the parameter set. The computer may be operative to generate simulation results including a plot of the model simulation and the dataset. The computer may be operative to transmit the simulation results to the remote device.
Further variations encompassed within the systems and methods are described in the detailed description of the invention below.
A “model” or “mathematical model” refers to a set of one or more equations, that may be differential equations, closed-form equations, or discrete equations, representing physical phenomena or other dynamical systems. The equations may be dependent on each other. The equations may feature one of more parameters which may be fixed or may be identified by the tool via systems identification.
A “closed form equation” refers to an equation that takes the form y=f(x) where y is any variable name and f(x) is a formula. Examples of closed form in this document include equations include Equations 7, 19, 24, 32, 33, 34, 35, 36, and 37.
An “independent variable” refers to a variable that is not dependent on any other variable in a model. It never appears on the left hand side of an equation. However, it is noted that the t in dy/dt does not count as dy/dt signifies the derivative of the dependent variable y with respect to the independent variable, t. The range of values of the independent variable is controlled by a user in a numerical simulation. In all the Examples in this document, the independent variable is t (time), but it could any unique variable defined by the user such as x, but then every t would have to be replaced by x.
A “discrete equation” refers to an equation where a value of a state variable at a point in time is dependent on another. For example, the equation x[t]=2*x[t−1]+y[t] is a discrete equation.
A “state variable” refers to a dependent variable whose value is calculated for every value spanned by the independent variable. The value of the state variable may change as the independent variable changes. In some embodiments of the invention, every variable lifted on the left hand side of a model equation may be treated as a state variable. State variables may also appear on the right hand side of an equation.
“Systems identification” or “model fitting” refers to the process by which parameters of a model are identified by fitting a simulated model variable to a data set though linear or non-linear least squares.
“Linear least squares” or “linear regression” refers to the process by which an output variable of a linear model is fit to a dataset whereby the optimal parameters of the model are solved for such that the Sum Squared Error (SSE) between the model and the dataset is minimized. Linear least squares gives a true and direct solution (no iteration and therefore no initial guess is required) for optimal parameters. An example of a linear model is the equation of a line, or a set of linear equations.
“Nonlinear least squares” refers to the process by which an output variable of a non-linear model is fit to a dataset whereby the optimal parameters of the model are solved for such that the sum of squared errors of prediction (SSE) between the model and the dataset is minimized. The identification of optimal in nonlinear least squares is an iterative process that requires an initial guess for each parameter. For instance, if we are trying to identify parameters a and b in the example equation y=a*exp(−t/b) where t is the independent variable, then non-linear least squares is required, however if b is a constant, then linear least squares can solve for the optimal a.
“Repository” refers to the database of models and their related data sets.
“Computational methods” refer to the application of computer simulation and other numerical analysis to solve problems in various scientific disciplines. Examples of computational methods that may be used in the invention are, without limitation, numerical simulations, model fitting, and/or computational optimization.
“Numerical simulations” refers to calculation of values of one or more variables in the model for a series of inputs across the entire span of an independent variable.
“Cloud” refers to an Internet-based development and use of computer technology stored on servers rather than the client computers. In some embodiments, the cloud may be implemented in heavily redundant and load-balanced cluster of servers and network infrastructure to ensure maximum availability.
“Cloud storage” refers to a model of networked online storage. Distribution, replication, and/or load balancing across database servers may be used to ensure minimal data loss.
“Load balancing” refers to a method for distributing workloads across multiple computers or a computer cluster, network links, central processing units, disk drives, or other computing resources.
“Distributed processing” refers to the use of distributed computer systems to solve computational problems (single or multiple models fit to one or more datasets). In distributed computing, a problem may be divided into many tasks, each of which is solved by one or more computers.
“Programming” refers to writing lines of code in a particular syntax unique to a particular programming language. For every different model, current state of the art software (e.g., MATLAB, Mathematica, R, Python, Perl, and SAS) requires that a new program be re-written (re-coded), re-interpreted or re-compiled in syntax particular to the programming language. There is a difference between interpreting the equations that are input to the software, which is what the invention does, versus writing (i.e., coding), interpreting and/or compiling the program required by the state of the art.
The accompanying drawings, which are incorporated herein and form part of the specification, illustrate various, non-limiting embodiments of the present invention. In the drawings, like reference numbers indicate identical or functionally similar elements.
In some embodiments, the system 100 may include one or more remote devices 104 (e.g., client or user devices). In some non-limiting embodiments, a remote device 104 may be, for example, a desktop computer, a laptop computer, a tablet computer, or a smartphone. In some non-limiting embodiments, a remote device 104 may include a user interface (e.g., a display and/or input device, such as, for example, a mouse, touchpad, keyboard, stylus, microphone, or touchscreen). In some embodiments, a remote device 104 may transmit and receive information to and from the network 106. In some embodiments, a remote device 104 may connect with the mathematical model analysis computer system 102 (e.g., via a web browser executed on the remote device 104), and the remote device 102 may transmit and receive information to and from the mathematical model analysis computer system 102 over the network 106.
In some embodiments, the database 212 may be a non-volatile storage device. In some embodiments, the database 212 may store one or more of mathematical models 214, datasets 216, permissions 218, batches 220, batch processing results 222, and batch processing reports 224. In some embodiments, one or more of the mathematical models 214 in the database 212 may have been received/uploaded from a remote device 104. Similarly, in some embodiments, one or more of the datasets 216 in the database 212 may have been received/uploaded from a remote device 104. Although the database 212 is illustrated in
In some embodiments, the computer 210 may receive information (e.g., a selection or identification of a mathematical model 214 and a dataset 216) from a remote device 104 (e.g., via network 106 and network interface 208). In some non-limiting embodiments, based on the received information, the computer 210 may access a mathematical model 214 and a dataset 216 stored in the database 212, simulate the mathematical model 214, fit the mathematical model 214 to experimental data in the dataset 216, generate graphs and/or results, and/or transmit the generated graphs and/or results to the remote device 104 (e.g., via network interface 208 and network 106).
In some embodiments, equations can be added to or removed from a model. In some embodiments, a set of one or more model equations in a mathematical model 214 may be interpreted as an interdependent system of equations and treated appropriately as a mathematical system of equations. That is, a state variable listed on the left hand side of an equation may appear on the right hand side of another equation and may be treated as the same variable. Also, a state variable listed on the left hand side of a model equation may appear in the formula on the right hand side of the same model equation (e.g., “y=y+1” or “dy/dt=−y”). In some embodiments, certain variables that appear in one or more equations can be defined as parameters that may have constants assigned to them. In some embodiments, parameters can be added or removed and their values can be altered.
In some embodiments, the process 300 may include a step 302 in which the computer 210 determines whether the model and/or dataset submitted for the simulation operation has been validated (e.g., since the last edit of the model and/or dataset).
In some embodiments, the process 300 may include a step 303 in which the computer 210 validates the submitted mathematical model and/or dataset. The process 300 may proceed to the validation step 303 if the computer 210 determines in step 302 that the model and/or dataset submitted for the simulation operation has not been validated. A non-limiting embodiment of the processing that may be performed in the validation step 303 is described below with reference to
In some embodiments, the process 300 may include a step 304 in which the computer 210 determines whether the submitted model contains at least one differential equation. In some embodiments, the process 300 may proceed to the step 304 if the submitted mathematical model and dataset passes validation in step 303. Likewise, if the computer 210 determines in step 302 that the submitted mathematical model and dataset has been validated, the process 300 may proceed to the step 304 of determining whether the submitted model contains at least one differential equation.
In some embodiments, the process 300 may include a step 305 in which the computer 210 simulates the submitted mathematical model without differential equations. In some embodiments, the process 300 may proceed to the step 305 if the computer 210 determines in step 304 that the submitted model does not contain any differential equations. A non-limiting embodiment of the processing that may be performed in step 305 is described below with reference to
In some embodiments, the process 300 may include a step 306 of simulating the submitted mathematical model with differential equations. In some embodiments, the process 300 may proceed to the step 306 if the computer 210 determines in step 304 that the submitted mathematical model contains at least one differential equation. A non-limiting embodiment of the processing that may be performed in step 306 is described below with reference to
In some embodiments, the process 300 may include a step 307 in which the computer 210 generates one or more graphs and/or one or more results. For instance, the computer 210 may generate a graph plotting the simulated model and the dataset. However, if only one of a model and a dataset is submitted in step 301, the computer 210 may generate a graph plotting only the simulated model or only the dataset. In some embodiments, the computer 210 may transmit the generated graphs and/or results to the remote device 104. In some embodiments, the generated graphs and/or results may be transmitted to the remote device 104 via the network interface 208 and the network 106. In some non-limiting embodiments, the remote device 104 may display the generated graphs and/or results to a user of the remote device 104 (e.g., via a user interface).
In some embodiments, the process 400 may include a step 403 in which the computer 210 validates equations and data. In some non-limiting embodiments, the step 403 may include validating for one or more of correct equation form, the identified variables and parameters, and matching data variables. For example, in some embodiments, the computer 210 may determine an equation that is missing a parenthesis (e.g., “y=(x+3”) to be invalid. For another example, in some embodiments, the computer 210 may determine a model invalid if it includes the equation “y=(x+3)” but x is undefined on a different line (as a state variable on the left hand side of another equation) or as an independent variable or parameter. For still another example, the computer 210 may detect if the variable z was defined as a state variable, and x was not and the user accidentally typed “y=(x+3)” instead of “y=(z+3)”.
In some embodiments, the process 400 may include a step 404 in which the computer 210 determines whether the mathematical model and/or dataset passed validation. If the mathematical model and/or dataset did not pass validation, the process 400 may proceed to a step 405 in which the computer 210 transmits the errors that prevented the mathematical model and/or dataset from passing validation to the remote device 104. In some embodiments, the errors may be transmitted to the remote device 104 via the network interface 208 and the network 106. In some non-limiting embodiments, the remote device 104 may display the errors to a user of the remote device 104 (e.g., via a user interface).
In some embodiments, the process 400 may include a step 406 in which the computer 210 submits a revised or different mathematical model and a dataset for validation. In some non-limiting embodiments, the computer 210 may receive an identification of a different mathematical model and/or dataset from the remote device 104. In some embodiments, the identification of the different mathematical model and/or dataset may be received from the remote device 104 via the network 106 and the network interface 208. In some embodiments, the identification of a different mathematical model may be a selection of a mathematical model 214 stored in database 212 or a mathematical model transmitted from remote device 104 (e.g., after being input by a user into the remote device 104). In some embodiments, the identification of the different dataset may be a selection of a dataset 216 stored in database 212 or a dataset transmitted from remote device 104 (e.g., after being input by a user into the remote device 104). In some embodiments, after submitting a revised or different mathematical model and a dataset for validation in step 406, the computer 210 may repeat steps 401-404 with the revised or different mathematical model and a dataset.
In some embodiments, the process 3400 may begin in step 3401 with the computer 210 receiving start, delta, and end values for an independent variable (e.g., from a remote device 104 via a model tab, such as that illustrated in any one of
In some embodiments, the process 500 may be performed by the computer 210 during step 305 of the process 300 for simulating a mathematical model. In some embodiments, the process 500 may begin in step 501 with the computer 210 initializing spanIndex i to zero. In some embodiments, the process 500 may include a step 502 in which the computer 210 determines whether the spanIndex i equals the number of elements in an independent variable vector.
In some embodiments, the process 500 may include a step 503 in which the computer 210 initializes an equationIndex j to zero. In some embodiments, the process 500 may proceed to step 503 if the computer 210 determines that the spanIndex i does not equal the number of elements in the independent variable vector. In some embodiments, the equationIndex j may be a variable that keeps track of the equation (of the mathematical model) being processed. In some embodiments, the process 500 may include a step 504 in which the computer 210 determines whether the equationIndex j equals the number of equations. In some embodiments, the process 500 may proceed to a step 505 if the computer 210 determines that the equationIndex j does not equal number of equations in the mathematical model or to a step 509 if the computer 210 determines that the equationIndex j is equal number of equations in the mathematical model.
In some embodiments, the process 500 may include a step 505 in which the computer 210 evaluates the right hand side (RHS) of the jth equation at the ith point. In some embodiments, the evaluation may be based on one or more parameters of the model. In some embodiments, the process 500 may include a step 506 in which the computer 210 assigns a value to SVM[i][equationIndex] for storage, where SVM stands for State Variable Matrix and is a two dimensional array of simulated values for each state variable at each spanIndex i (e.g., time point). The different rows may represent different spanIndices, and the different columns may represent the different stateVariables. SVM may contain simulated results of all state variables in the model.
In some embodiments, the process 500 may include a step 507 in which the computer 210 assigns a value to a workspace variable defined by the left hand side (LHS) of the jth equation for future evaluations. In other words, because equations may be interdependent, the computer 210 may store the current value (at the current spanIndex) of a state variable (defined in the left hand side of an equation) for use in other equations in the model simulation process 500.
In some embodiments, the process 500 may include a step 505 in which the computer 210 increments the equationIndex before returning to step 504.
In some embodiments, the process 500 may include a step 509 in which the computer 210 increments the spanIndex i before returning to step 502.
In some embodiments, the process 600 may include a step 602 in which the computer 210 initializes a spanIndex i to zero. In some embodiments, the process 600 may include a step 603 in which the computer 210 initializes an equationIndex k to zero.
In some embodiments, the process 600 may include a step 604 in which the computer 210 determines whether the current kth equation is a differential equation. If the current kth equation is a differential equation, the process 600 may advance to step 608, but, if the current kth equation is not a differential equation.
In some embodiments, the process 600 may include a step 605 in which the computer 210 interprets (i.e., evaluates) the right hand side (RHS) of the non-differential equation on (k+1)th row as calcValue. In some embodiments, the evaluation may be based on one or more parameters of the model. In some non-limiting embodiments, the right hand side of each differential equation and closed form equation may be evaluated and stored in a StateVariableVector (SVV), which may be a one dimensional array of all state variables at the particular spanIndex during the simulation. For elements that correspond to differential equations (derivatives of state variables), the stored values may be the integrated value with respect to the independent variable. In some embodiments, SVV may change for each spanIndex (e.g., time point) of the simulation and may be available for an ordinary differential equation (ODE) solver to integrate the set of differential equations (e.g., in step 617).
In some embodiments, the process 600 may include a step 606 in which the computer 210 assigns a value to a workspace variable defined by the left hand side of the non-differential equation on the (k+1)th row of the model grid. In some embodiments, the process 600 may include a step 607 in which the computer 210 assigns a value to a current state variable vector SVV [uniqueIndex]=calcValue. In some embodiments, the process 600 may include a step 608 in which the computer 210 assigns a value to state variable matrix SVM[i][uniqueIndex]=SVV[uniqueIndex] for storage. In some non-limiting embodiments, the SVM may be a two dimensional state variable matrix or a two dimensional array of simulated values for each state variable at each spanIndex (e.g., time point). The different rows may represent different spanIndices, and the different columns may represent the different stateVariables. If the state variable is expressed as a differential equation (e.g., the “y” in “dy/dt”), then the stored value may be integrated with respect to the independent variable (e.g., “t”) at that particular spanIndex (e.g., point in time). SVV may be a particular row of SWM depending on the current spanIndex. In some embodiments, the process 600 may include a step 609 in which the computer 210 increments the equationIndex k.
In some embodiments, the process 600 may include a step 610 in which the computer 210 determines whether the equationIndex k equals the number of equations in the model. In some non-limiting embodiments, the equations of the model may be entered in a grid or table (e.g., as shown in
In some embodiments, the process 600 may include a step 611 in which the computer 210 initializes a diffEqIndex to zero. In some embodiments, the process 600 may include a step 612 in which the computer 210 gets a uniqueIndex for a state variable defined by the left had side (LHS) of the (diffEqIndex)th differential equation. In some embodiments, the process 600 may include a step 613 in which the computer 210 yVector_this[diffEqIndex] is set equal to the SVV[uniqueIndex] value. In some embodiments, yVector_this may be a subset of SVV containing integrated state variables whereby the left hand side is expressed as a derivative (e.g., “dy/dt”). yVector_this may be a one dimensional array of integrated variables at the current spanIndex (e.g., time), and yVector_next may be the one dimensional array of integrated variables at the next spanIndex (spanIndex+delta) solved by an ODE differential equation integrator in step 617.
In some embodiments, the process 600 may include a step 614 in which the computer 210 increments the diffEqIndex. In some embodiments, the process 600 may include a step 615 in which the computer 210 determines whether the diffEqIndex is equal to the number of differential equations. If the diffEqIndex is not equal to the number of differential equations, the process 600 may return to step 612. Otherwise, the process 600 may advance to step 616.
In some embodiments, the process 600 may include a step 616 in which the computer 210 sets x this equal to independentVariableVector[i] and sets x next equal to independentVariableVector[i+1]. In some embodiments, the process 600 may include a step 617 in which the computer 210 performs an ordinary differential equation (ODE) Runge Katta differential equation integration. In some embodiments, the integration may be based on one or more parameters of the model.
In some embodiments, the process 600 may include a step 618 in which the computer 210 performs yVector_next. In some embodiments, the process 600 may include a step 619 in which the computer 210 resets the diffEqIndex to zero. In some embodiments, the process 600 may include a step 620 in which the computer 210 gets uniqueIndex for the state variable defined by the left hand side (LHS) of the (diffEqIndex)th differential equation. In some embodiments, the process 600 may include a step 621 in which the computer 210 sets SVV[uniqueIndex] equal to yVector_next[diffEqIndex]. In some embodiments, the process 600 may include a step 622 in which the computer 210 increments diffEqIndex. In some embodiments, the process 600 may include a step 623 in which the computer 210 determines whether diffEqIndex equals the number of differential equations. If the diffEqIndex is not equal to the number of differential equations, the process 600 may return to step 620. Otherwise, the process 600 may advance to step 624.
In some embodiments, the process 600 may include a step 624 in which the computer 210 increments the spanIndex i. In some embodiments, the process 600 may include a step 625 in which the computer 210 determines whether the spanIndex i is equal to the total number of points spanned in the independentVariableVector. If the spanIndex i is equal to the total number of points spanned in the independentVariableVector, the process 600 may return to step 603. Otherwise, the process 600 may end. In other words, in some embodiments, when spanIndex has simulated the result for the end value of the independent variable (e.g., when the result for all state variables at the last time point has been calculated), the simulation process 500 may end.
In some embodiments, the process 700 may include a step 704 in which the computer 210 determines whether the lineIndex k is equal to the number of lines of model/instruction grid. If the lineIndex k is equal to the number of lines of model/instruction grid, the process 700 may end. Otherwise, the process 700 may advance to step 705.
In some embodiments, the process 700 may include a step 705 in which the computer 210 determines whether the equation on the current line is a differential equation. If the equation on the current line is a differential equation, the process 700 may advance to step 706. Otherwise, the process 700 may advance to step 711.
In some embodiments, the process 700 may include a step 706 in which the computer 210 interprets (i.e., evaluates) the initial condition expression on the (k+1)th row, second column of the model grid. In some embodiments, the process 700 may include a step 707 in which the computer 210 assigns a value to y0[diffEqIndex] for storage. In some embodiments, the process 700 may include a step 708 in which the computer 210 assigns a value to yVector_this[diffEqIndex] for storage. In some embodiments, the process 700 may include a step 709 in which the computer 210 assigns a value SVV[uniqueIndex] equal to yVector_this[diffEqIndex] for storage. In some embodiments, the process 700 may include a step 710 in which the computer 210 increments diffEqIndex.
In some embodiments, the process 700 may include a step 711 in which the computer 210 evaluates the right hand side of a non-differential equation on the (k+1)th row, 1st column of the model grid. In some embodiments, the process 700 may include a step 712 in which the computer 210 assigns a value to a workspace variable defined by the left hand side of the non-differential equation on the (k+1)th row, 1st column of the model grid. In some embodiments, the process 700 may include a step 713 in which the computer 210 assigns a value to SVV[uniqueIndex] for storage. In some embodiments, the process 700 may include a step 714 in which the computer 210 increments the model grid line index k.
In some embodiments, the process 800 may include a step 802 in which the computer 210 determines whether the model and/or dataset submitted for the simulation operation has been validated (e.g., since the last edit of the model and/or dataset). In some embodiments, the process 800 may include a step 803 in which the computer 210 validates the submitted mathematical model and/or dataset. The process 800 may proceed to the validation step 803 if the computer 210 determines in step 802 that the model and/or dataset submitted for the simulation operation has not been validated. A non-limiting embodiment of the processing that may be performed in the validation step 803 is described above with reference to
In some embodiments, the process 800 may include a step 804 in which the computer 210 sets parameters to initial guess values. In some embodiments, the process 800 may proceed to the step 804 if the submitted mathematical model and dataset passes validation in step 803. Likewise, if the computer 210 determines in step 802 that the submitted mathematical model and dataset has been validated, the process 800 may proceed to the step 804 of determining whether the submitted model contains at least one differential equation. In some non-limiting embodiments, the computer 210 may receive the initial guesses from the remote device 104. In some embodiments, the initial guesses may be received from the remote device 104 via the network 106 and the network interface 208.
In some embodiments, the process 800 may include a step 805 in which the computer 210 determines whether the submitted model contains at least one differential equation. In some embodiments, the process 800 may include a step 806 in which the computer 210 simulates the submitted mathematical model without differential equations. In some embodiments, the process 800 may proceed to the step 806 if the computer 210 determines in step 805 that the submitted model does not contain any differential equations. A non-limiting embodiment of the processing that may be performed in step 806 is described above with reference to
In some embodiments, the process 800 may include a step 807 in which the computer 210 simulates the submitted mathematical model with differential equations. In some embodiments, the process 800 may proceed to the step 807 if the computer 210 determines in step 305 that the submitted mathematical model contains at least one differential equation. A non-limiting embodiment of the processing that may be performed in step 807 is described above with reference to
In some embodiments, the process 800 may include a step 808 in which the computer 210 calculates Sum Squared Error (SSE) or other penalty function between the model variable and the experimental data. In some embodiments, the process 800 may proceed to the step 808 from either step 806 or step 807. In some embodiments, the process 800 may include a step 809 in which the computer 210 determines whether (a) the maximum number of iterations has been reached, (b) improvement in SSE (or other penalty function) is less than tolerance, or (c) change in parameters is smaller than the fractional step. If not, the process 800 may proceed to a step 810. Otherwise, the process 800 may proceed to a step 811.
In some embodiments, the process 800 may include a step 810 in which the computer 210 changes parameter values to one or more new guesses and increments the number of iterations by one. In some non-limiting embodiments, the processor 210 may iteratively change the parameter values following standard non-linear least squares algorithms, such as, for example and without limitation, the Nelder-Mead, Levenberg-Marquardt, or Gauss-Newton algorithms. In some non-limiting embodiments, the system 100 may provide the user of a remote device 104 (e.g., via a user interface) with the ability to individually set each of the one or more parameters of the one or more model equations of a mathematical model 214 as either (a) fixed to the initial guess or (b) allowed to vary during the non-linear least squares procedure. In these embodiments, the step 810 would only change a parameter value to a new guess if the parameter is allowed to vary. In some non-limiting embodiments, each parameter to be fit can be bounded to fall within a certain range or constrained to satisfy a particular expression. In these embodiments, the step 810 would only change a parameter value to a new guess that is within the certain range and/or satisfies the particular expression.
In some embodiments, the process 800 may include a step 811 in which the computer 210 copies the latest parameter values to the fit column and generates graphics and results. In some embodiments, the computer 210 may transmit the generated graphs and/or results to the remote device 104. In some embodiments, the generated graphs and/or results may be transmitted to the remote device 104 via the network interface 208 and the network 106. In some non-limiting embodiments, the remote device 104 may display the generated graphs and/or results to a user of the remote device 104 (e.g., via a user interface).
Although the fit operation process 800 illustrated in
y=p
1
+p
2
*x
2
+p
3
*x
3
+ . . . +p
n
*x
n (1)
where x2, x3, . . . , xn are functions of one or more independent variables has a closed form analytical solution that gives us fit parameters p1, p2, . . . , pn. If there are m sets of y experimental data points and (x2, x3, . . . , xn) values, the parameters (p1, p2, . . . , pn) can be solved with matrix algebra. In matrix form, the equation above is represented as:
With a stack of m y values and m sets of (x2, x3, . . . , xn) values, this is expanded to:
As long as m≧n, then the closed form solution for the set of parameters, P exists where the SSE between modeled y values and experimental y values is minimized (no iteration required). The solution is given by the matrix equation where the T superscript denotes matrix transpose:
P=X
S
T
*X
S
*X
S
T
*Y (4)
In some embodiments, in performing a fit operation process, the computer 210 may evaluate whether to use linear least squares or nonlinear least squares to obtain the optimal set of model parameters by evaluating the form of the model equation (takes the form of eq # or not). Linear least squares may not require an initial guess for each parameter because an analytical solution exists.
In some embodiments, the process 900 may include a step 904 in which the computer 210 applies an equation computation algorithm. In some non-limiting embodiments, step 904 may correspond to steps 804-809 of fit operation processing 800 described above with reference to
In some embodiments, the process 900 may include a step 906 in which the computer 210 determines whether the user is satisfied with the results. In some embodiments, the computer 210 may receive an indication as to whether the user is satisfied with the results from the remote device 104. If the computer 210 determines whether the user is not satisfied with the results, the process 900 may return to step 901, where the computer 210 may submit a different model and dataset for a fit operation. If the computer 210 determines whether the user is not satisfied with the results, the process 900 may proceed to step 907.
In some embodiments, the process 900 may include a step 907 in which the computer 210 names the model and data set. In some non-limiting embodiments, the computer 210 may receive a user-specified name for the model and dataset from the remote device 104. In some embodiments, the process 900 may include steps 908 and 909 in which the computer 210 grants or denies access to other users or groups and sets the access permissions for the model and data set. In some non-limiting embodiments, the computer 210 may grant or deny access based on an indication of any persons and/or groups to be allowed access from the remote device 104. Accordingly, in some non-limiting embodiments, the user may be able to share one or more models and data with one or more other users and/or groups or keep the models and data private. In some embodiments, the process 900 may include a step 910 in which the computer 210 saves one or more of the model, data set, and permissions in the database 212 (e.g., as models 214, datasets 216, and/or permissions 218) and/or in another database.
In some embodiments, the process 900 may include a web publisher step 911 in which the computer 210 may make published models and datasets available for display (e.g., on one or more remote devices 104).
In some embodiments, the process 1000 may include a step 1004 in which the computer 210 receives a selection of a model and/or dataset (e.g., from a remote device 104). In some embodiments, multiple models and datasets may be selected for batch processing. In some embodiments, the process 1000 may include a step 1005 in which the computer 210 retrieves the selected model(s) and/or dataset(s) from the repository. In some embodiments, the process 1000 may include a step 1006 in which the computer 210 calculates a default simulation based on the retrieved model(s) and/or dataset(s). In some non-limiting embodiments, the default simulation may include steps corresponding to steps 301-307 of model simulation process 300 described above with reference to
In some non-limiting embodiments, an independent variable and the “Start”, “Delta” and “End” that define its range and increment can be entered into the Graphical User Interface or uploaded from/downloaded to a text file, excel file, XML file or other formats. In some non-limiting embodiments, model equations can be entered into a table within a Graphical User Interface or uploaded from or downloaded to a text file, excel file, XML file or other formats. In some non-limiting embodiments, parameters and constant values assigned to them can be entered into a separate table within the Graphical User Interface or uploaded from/downloaded to a text file, excel file, XML file or other formats. In some non-limiting embodiments, datasets (e.g., tables), which may include inputs to the model and/or experimental data, can be entered into a separate table (e.g., under the “Data” tab) within the Graphical User Interface or uploaded from/downloaded to a text file, excel file, XML file or other formats. In some non-limiting embodiments, the header of a data column may be used as an input variable name accessed by the model. In some non-limiting embodiments, variables to a plot (e.g., x,y) and/or plotting properties can be entered into a separate table (e.g., under a “Plots” tab) within the Graphical User Interface or uploaded from/downloaded to a text file, excel file, XML file or other formats. In some non-limiting embodiments, the header of a data column may be used as input variable name accessed by the model. In some non-limiting embodiments, all or a portion of the information entered into the GUI and/or downloaded/uploaded may be grouped together into a single workspace file. In some non-limiting embodiments, the single workspace file may contain the model equations, parameters, datasets, plot options, fitting options, and/or other advanced settings that can be uploaded/downloaded.
In some embodiments, a user can batch fit one model to multiple datasets and/or one dataset to multiple models to determine which one best represents the experimental data. In some embodiments, distributed processing (e.g., using map-reduce or other means) may be used to perform the processing on multiple processors (e.g., in the cloud). This may speed processing times for large batch computations.
In some embodiments, the process 1200 may include, for each model/dataset combination, a step 1205 in which the computer 210 performs a model simulation or fit operation and a step 1206 in which the computer 210 saves the results of the model simulation or fit operation in the repository (e.g., database 212). In some non-limiting embodiments, step 1205 may correspond to steps 304-307 of model simulation process 300 described above with reference to
In some embodiments, the mathematical model analysis computer system 102 may ease the creation and analysis of complex mathematical models. In some embodiments, the mathematical model analysis computer system 102 may enable the created models to be shared easily with others. For example, a scientist who has hypothesized a mathematical model describing some physical phenomena may use the mathematical model analysis computer system 102 to replicate the hypothesized model in simulation. Experimental data from different systems or individuals may follow the same model, but may have different parameters or constants. The scientist (e.g., operating a remote device 104) may use an embodiment of the mathematical model analysis computer system 102 to identify the parameters for a unique system or individual by fitting the model to each dataset. Subsequently, the scientist may use the model to simulate what would happen under different input conditions before implementing changes. In some non-limiting embodiments, the scientist may use the mathematical model analysis computer system 102 to publish the model and its data. Others may use the mathematical model analysis computer system 102 to access the published model and run their own analysis on it, making refinements and testing it with their own experimental data or set of inputs.
In some embodiments, the system 100 may eliminate the need for the scientist to program mathematical models for model analysis. In some embodiments, the scientist may use a remote device 104 to enter the equations representing the model and enter the experimental data, and the mathematical model analysis computer system 102 will perform the necessary mathematical analysis. In some embodiments, the scientist may use the system 100 to tweak the model if it does not fit the data well. For example, in some non-limiting embodiments, the scientist may add or eliminate data points (outliers) depending on how well the model performs. In such cases, the scientist's remote device 104 may receive results from mathematical model analysis computer system 102 in a matter of seconds or minutes rather than the days or weeks often required when manual programming is required to make the changes. In some embodiments, the model is described in mathematical terms (as opposed to a programming language) so the expression language is familiar to the scientist, and great efficiencies can be realized.
In some embodiments, the system 100 may be web-based so that the mathematical model analysis computer system 102 is accessible from multiple platforms and devices (e.g., remote devices 104). In some non-limiting embodiments, the system 100 may require no installation of software (e.g., including “run time engines” such as, for example, Adobe's Flash Player, Java's Runtime Engine, and Wolfram's Computable Document Format (CDF) Player, which may not run on all operating systems and internet accessible devices) on a remote device 104. In some embodiments, the system 100 may provide a graphical user interface (GUI) for display on a remote device 104, and, in some non-limiting embodiments, the GUI may run on base technology built into all modern web browsers. Some non-limiting examples of remote devices 104 accessing the mathematical model analysis computer system 102 may include a Dell personal computer (PC) with a FireFox web browser on a Windows XP operating system (OS), an Apple MacBook with a Safari web browser on a Mac OS X 10.5.8, an Apple MacBook Pro with a Safari web browser on a Mac OS X 10.8.2, an Apple iPhone smart phone with a Safari web browser on an iOS, a Samsung Galaxy S3 smart phone with a Chrome web browser on an Android OS, an Apple iPad tablet with a Safari web browser on an iOS, and a Samsung Galaxy tablet with a web browser on an Android OS.
In some non-limiting embodiments, the mathematical model analysis computer system 102 may be hosted in the cloud (e.g., in a heavily redundant, replicated, and load-balanced cluster of servers and networking infrastructure ensuring maximum availability and minimal risk of data loss). Many mathematical models capable of being analyzed by the mathematical model analysis computer system 102 require a fair amount of computing power to analyze properly. A fair deal of storage may be required for the experimental data. In embodiments where the mathematical model analysis computer system 102 is hosted in the cloud, the cloud may provide ample storage and computing (possibly distributed), and absolves the user from having to maintain hardware. In some embodiments, the system 100 may include one or more cloud based remote servers that may be used to perform computational analysis. In some non-limiting embodiments, the runtime of the computational analsysis may be accelerated relative to the runtime of installed software on a single local machine as the computational load may be distributed (particularly with batch processing).
In some embodiment, the system 100 may facilitate the publishing of models and data with others, thus fostering creativity and collaboration. In some embodiments, the mathematical model analysis computer system 102 may offer users access to one or more models (e.g., one or more of models 214 stored in database 212) for users to study, copy, and/or edit. In some embodiments, users may search for or browse through models (e.g., using the search and retrieve process 1000 illustrated in
In some non-limiting embodiments, users may register themselves on the mathematical model analysis computer system 102 in order to avail of the full functionality. For example, in one embodiment, a user must be registered in order to save models and participate in forums. In some embodiments, a user may create groups and/or request to be added to groups for private collaboration. In some embodiments, the mathematical model analysis computer system 102 will ensure that users can log in securely (e.g., users' password and registration details may be encrypted and stored securely). In some embodiments, the system 100 may support social media site integration in the form of single sign on using Google, Facebook, and/or other credentials. In some embodiments, users can create models and post descriptions and comments adjacent to the models with those credentials.
In some embodiments, a saved model (and its related experimental data) may be kept private or published to a group or to the public. In some embodiments, the mathematical model analysis computer system 102 may only allow private models to be deleted. In some embodiments, a private model may only be visible to the author, and the author may modify, save, and/or delete a private model at will. In some embodiments, only the author of a model may make private a public or group public model, and only the model's author may delete it.
In some embodiments, group-published models are visible to all members of a group. In some embodiments, group members may run the model but may not delete it. In some embodiments, group members may modify the model but can only save it using a different name (essentially making a new model from the group-published model). In some embodiment, the same rules may apply to public models.
In some embodiments, the creator may write a description of the model, its comprised set of equations, state variables, and parameters. In some embodiments, the description may include the model's relevance to a particular problem (e.g., an explanation of the experimental phenomenon the model simulates) along with a description of a particular data set to which the model is fit. Registered users may comment on the model or data set. Registered users may “like” or give a rating to the model (e.g., with ratings for a model limited to a maximum of one per user), whereby the total number of likes is tabulated and displayed for each model. In some embodiments, a remote device 104 may display the description in a forum window, which may be, for example, adjacent to the model and/or the data set. See
Below are several non-limiting examples that demonstrate the usage and value of a mathematical model analysis computer system in accordance with embodiments of the invention relative to the current state of the art in solving engineering and scientific problems. However, the use of this invention is not limited to the models or algorithms provided in these examples; the model can be customized to have any set of user defined equations (closed form and/or differential equations), and any set of parameters.
In some embodiments, the mathematical model analysis computer system 102 may be used to evaluate (fit) out the current suspension properties of a shock absorber to experimental data and modify it to have the optimal critically damped response.
Model equations:
eta, w0, y1
In this example y0 and y1, are state variables that change with time which are velocity and displacement of the shock absorber respectively. y0(0) and y1(0) are the initial velocity and displacement respectively. Any time differential equations of state variables relative to an independent variable (in this case time) are integrated, and the initial conditions of those state variables may be required. The parameters eta, w0 define the viscoelastic properties of the shock absorber. The parameter y1_ini defines the initial displacement of the mass attached to the shock absorber consisting of a spring and damper in parallel. Different shock absorbers may be described by the same set of model equations with different numerical values assigned to the parameters.
Applying the fit operation in Example 1 using the initial guess listed in
In contrast, MATLAB requires the programming of script and functions, such as the script and functions described below, to simulate and fit the Example 1 model to experimental data. The following illustrates a MATLAB file (FitSpringDamperSystem.m) that is the main programming script but requires the additional three functions described below to run:
SpringDamperSystemODE.m
(Text following the “%” are merely comments for the reader and are not interpreted as code). The following illustrates a MATLAB function (SSESimulateSpringDamperSystem.m) that calls the SimulateSpringDamperSystem function to simulate the model of differential equation defined in Example 1 and returns the sum squared error between the model and the experimental data for the iterative non-linear least squares fitting routine:
The following illustrates a MATLAB function (SimulateSpringDamperSystem.m) that solves or simulates the model of differential equation defined in the SpringDamperSystemODE.m file using MATLAB's built in ODE (Ordinary Differential Equation) solver:
The following is a MATLAB function (SpringDamperSystemODE.m) that contains the differential equations of the model described in Example 1 and is called by MATLAB's ODE solver:
In some embodiments, one or more of the model equations of a mathematical model 214, which may include one or more differential equations and/or one or more closed form equations and may be entered manually or by uploading a file (e.g., text file) via a GUI displayed on a remote device 104, may be in a format like one would see in a scientific or mathematics publication. In some non-limiting embodiments, one or more model equations of a mathematical model 214 may be typed into an equation editor (e.g., of the GUI displayed on a remote device 104) in a format like one would see in a scientific or mathematics publication. In some embodiments, one or more model equations of a model 214 may not be written in a syntax particular to a specific programming language. In some non-limiting embodiments, the left had side (i.e., the state variable) of the equations of a model 214 are not elements assigned to a coded array.
For instance, in some non-limiting embodiments, the model equations of example 1, when input into the system 100 (e.g., via the GUI displayed on a remote device 104) may look like “dy0/dt=−2*eta*w0*y0−w0̂2*y1” and “dy1/dt=y0” instead of “dydt(1)=−2*eta*w0*y0−w0̂2*y1” and “dydt(2)=y0” in MATLAB or other conventional software where dydt(1) and dydt(2) the first and second elements of the same array and not the first derivatives of two distinct variables. In some non-limiting embodiments, in contrast with MATLAB and the other conventional software, the mathematical model analysis computer system 102 may interpret “dy0/dt” on the left hand side of an equation as the first derivative of the variable “y0” with respect to “t.”
In non-limiting alternative embodiments, the models equations illustrated in
In some embodiments, the mathematical model analysis computer system 102 may be used to evaluate (fit) the pharmacokinetics of orally or subcutaneously delivered drug such as insulin to a particular individual from a known insulin delivery profile and measured plasma insulin concentration profile.
A dynamic model that describes insulin concentration in the plasma from known insulin delivery profile is given by the following 2 differential equations as typed in the graphical user interface (GUI) shown in
Model equations
tau1, tau2, clearance
In this example y1 and y2, are state variables that change with time, BolusInsulin and BasalInsulin are inputs entered or uploaded by the user into the “Data” tab. BolusU and BasalUPerHr are variables that define inputs BolusInsulin and BasalInsulin available for any time required by the ODE integrator to evaluate state variables y1 and y2 which are the insulin concentrations in a remote compartment and plasma respectively. The parameters tau1, tau2 and clearance define the pharmacokinetic properties of an administered drug such as insulin for a particular individual. The parameter table below the model equation table allows the user to quickly modify the values assigned to the model parameters and re-simulate the model with different values.
Applying the fit operation in Example 2 using the initial guess for parameters in
In contrast, MATLAB requires the programming of script and functions, such as the script and functions described below, to simulate and fit the Example 2 model to experimental data. The following illustrates a file (FitBasalBolusInsulin.m) that is the main programming script but requires the additional three functions described below to run:
The following illustrates a MATLAB function (SSESimulateBasalBolusInsulin.m) that calls the SimulateBasalBolusInsulin function to simulate the model of differential equation defined in Example 2 and returns the sum squared error between the model and the experimental data for the iterative non-linear least squares fitting routine:
The following illustrates a MATLAB function (SimulateBasalBolusInsulin.m) that solves or simulates the model of differential equation defined in the BasalBolusInsulinODE.m described in Example 2 using MATLAB's built in ODE (Ordinary Differential Equation) solver. This file contains a for loop to handle periodically changing inputs to the differential equations.
The following is a MATLAB function (BasalBolusInsulinODE.m) that contains the differential equations of the model described in Example 2 and is called by MATLAB's ODE solver:
In some embodiments, the mathematical model analysis computer system 102 may be used to simulate and identify (fit) parameters of a metabolic model to experimental glucose data from an individual patient with type 1 diabetes for a given meal and insulin delivery profile and predict what the glucose profile would have looked like had the insulin delivery profile been different.
Model equations
taui, Insulin Gain, taum, VG, p2, GEZI, EGP
In this example ISC, IP, ISC, Ra, IEFF, ISC and G are state variables that change with time which are subcutaneous insulin, plasma insulin, meal appearance rate, insulin effect, and plasma glucose respectively. Conditional expressions such as Equation 24 allow for one of two possible equations to be active depending on whether the condition is satisfied. InsulinBasal, InsulinBolus, InsulinBolusTime, InsulinBolusU, MealTime, Carbs and BasalUPerHr are variables that are assigned to constant values. Constants can also be assigned as parameters in the parameters table if they are to be identified by fitting the model to experimental glucose data. Different individuals may be described by the same set of model equations with different numerical values assigned to the pharmacokinetic and pharmacodynamic parameters depending on the physiological differences between individuals. The parameters tauS, Insulin Gain, taum, VG, p2, GEZI, EGP, are the insulin time constant, insulin gain, meal time constant, glucose distribution volume, insulin effect time constant, glucose effectiveness at zero insulin and endogenous glucose production. These parameters vary from individual to individual.
In some embodiments, the mathematical model analysis computer system 102 may be used to simulate the Hodgkin-Huxley action potential model and identify parameters (fit model) to replicate experimental voltage data from the squid axon resulting from a current clamp (clamp the current and measure the resulting voltage). The mathematical model analysis computer system 102 may then be used to simulate a voltage clamp and measure the resulting current. Hodgkin and Huxley tested many models to develop of this model simulation that replicated experimental data with the identified parameters, earned Hodgkin and Huxley the Nobel Prize in Physiology or Medicine in 1963, formed the basis understanding of ionic mechanisms involved in neural activation, and revolutionized the treatment of neurological disorders with drugs or electrical stimulation. In some embodiments, the mathematical model analysis computer system 102 may be used to quickly simulate the Hodgkin-Huxley action potential and fit it to data, without the need for software installation or knowledge in computer programming and applied mathematics.
Model equations
Cm, E_Na, E_K, E_L, g_Na, g_K, g_L
In this example v, n, m, h, a_n, b_n, a_m, b_m_a_h, b_h are state variables that change with time. v is the intracellular voltage, n, m, h dictate the probabilities of certain ionic channels being open. a_n, b_n, a_m, b_m_a_h, b_h are voltage dependent rate constants. The parameters Cm represents capacitance, E_Na, E_K, and E_L represent the sodium, potassium and leak membrane potentials respectively. g_Na, g_K, and g_L represent the sodium, potassium and leak conductances respectively.
In some embodiments, the system 100 may not require the installation of software on a remote device 104 to perform the model analysis; rather, in some embodiments, the a remote device 104 may access mathematical model analysis computer system 102 by going to a website independent of the remote device 104 and/or operating system running on the remote device 104. The website may provide a graphical user interface (GUI) from which a user can define a model, its parameters, and upload data. In some embodiments, the user may instruct mathematical model analysis computer system 102 on what analysis to perform (e.g., simulations or model fitting to data) by entering information and/or clicking buttons on the GUI. The remote device 104 may send data from the GUI to the mathematical model analysis computer system 102, which may be hosted on one or more cloud based servers. The mathematical model analysis computer system 102 may perform computational analysis with an accelerated the runtime compared to traditional software packages that require installation and run on one local machine. In some nonlimiting embodiments, once data and models are saved, they can be saved and shared with any number of individuals, whereby the data, models and plots can be accessed from any other device with access to the internet. In some non-limiting embodiments, users can access the computation engine (e.g., mathematical model analysis computer system 102) from their website using their own custom GUI (third-party extension). In some embodiments, the model equations, parameters, and data may be sent to the computation engine through web communication. In some embodiments, the computation engine may perform analysis, model simulation, and/or fit models to data and send the result back to the user's website.
In some embodiments, users can create any custom mathematical model or algorithm by typing in a set of custom equations that include one or more closed form equations and/or one or more differential equations. In some embodiments, the equations that define a model may be typed into a GUI displayed on a remote device 104 exactly as they would appear in a mathematics, science, or engineering textbook. In other words, in some embodiments, the equations may be typed into the GUI just as they appear as listed in the examples above in the same format with the same variable names (see, e.g.,
In some embodiments, the mathematical model analysis computer system 102 may handle closed form and differential equations. In some embodiments, the set of differential equations may be numerically integrated at different time points using standard Runge-Kutta Ordinary Differential Equation (ODE) solvers or numerical integration methods to obtain the state variables y1(t) and y2(t) at the desired time points or every minute from start to end time (see, e.g., the process 600 for simulating a mathematical model that contains at least one differential equation described above with reference to
In some embodiments, the mathematical model analysis computer system 102 may be able to integrate differential equations. Unlike conventional system, the mathematical model analysis computer system 102 may not require programming to integrate the differential equations. In conventional system, closed form equations and differential equations have to be treated differently in how they are programmed; multiple state variables listed as differential equations have to be grouped together in arrays. In conventional systems, an array containing the integrated state variables has to be passed in an out of a function call that has to be programmed along with various settings that have to be sent in as additional arguments to the function in a specific order for the simulation to execute properly. In conventional systems, this function containing the model equations has to be called multiple times if the inputs to the model change over time. In conventional systems, parameters that are input to the model have to be entered as the first argument to the function. In summary, conventional systems require much programming, which changes if the model changes and leaves much room for user error (see MATLAB scripts and functions set forth above with respect to Examples 1 and 2).
In some embodiments, the mathematical model analysis computer system 102 may be able to handle both closed form equations as well as differential equations without the user having to treat them differently or do any programming. In some embodiments, the user only has to enter the equations (e.g., as they appear in a math or science textbook) and corresponding parameters and assigned values. In some non-limiting embodiments, the span of the independent variable may define the sampling frequency and range of the simulated results of state variables according to the “Start”, “Delta” and “End” values.
Some conventional standalone software packages allow users to simulate and fit a single, closed form, non-linear equation to experimental data with programming (e.g., Graphpad Prism). However, unlike conventional software packages, mathematical model analysis computer system 102 may allow users to simulate and fit a model consisting of a set of one or more closed form equations and/or one or more differential equations without extensive programming. In some embodiments, the mathematical model analysis computer system 102 may simulate and fit a model containing any number of closed form equations and/or any number of differential equations that have to be integrated.
In some embodiments, the mathematical model analysis computer system 102 may handle multiple changing input data to the model (other than parameters). See, e.g.,
In some non-limiting embodiments, discrete inputs can be uploaded into or entered into an input table. In some embodiments, the input table may be uploaded as part of a text file or manually entered. As shown in
Although conventional modeling software, such as MATLAB, has similar impulse and step functions to ensure inputs are continuous for all time, the MATLAB ODE function does not start and stop at all time points where there is a sudden change in inputs to the model. For such inputs to be handled correctly additional code would need to be written in a for loop that starts and stops the ODE routine every time there is a sudden change in the input variables as shown in the MATLAB function (SimulateBasalBolusInsulin.m) that solves or simulates the model of differential equation defined in the BasalBolusInsulinODE.m described in Example 2.
In some embodiments, the mathematical model analysis computer system 102 may simulate the model with a set of parameters. Each customized model or algorithm can have parameters that are particular to a unique system, individual or experiment. Parameters may have a physical meaning associated with their value. In some embodiments, after defining the model and values to a set of parameters, users can easily run a model simulation by entering a simulate model instruction (e.g., clicking the “Simulate Model” button). In some embodiments, users can quickly modify the parameters and/or the model equations and re-simulate the model. In some embodiments, each state variable of a model (i.e., left hand side of a closed form model equation) may have computed values stored for each value spanned by the independent variable, and the stored values may be downloadable to a file.
In some embodiments, the mathematical model analysis computer system 102 may identify or fit the model parameters to experimental data from particular system or individual. In some embodiments, the mathematical model analysis computer system 102 may fit a simulated model to data collected from a particular experiment or individual (e.g., through linear or non-linear least squares (regression)). In embodiments using non-linear least squares, model parameters may be given an initial guess and simulated (e.g., as shown in
SSE=(y1(t)−dataY(t))2 (48)
Here the model variable y1 is fit to the experimental data dataY listed under the “Data” tab. The mathematical model analysis computer system 102 may automatically pair up model values and experimental data that occur at the same point in time (or other independent variable) when the experimental data points (shown as black squares in the figures) does not exist at every point in time the model variable is simulated.
In Example 2, the simulated model variable y2 is fit to the experimental data PlasmaInsulin listed under the “Data” tab of
In Example 3, the simulated model variable G (glucose) is fit to the experimental data data_G listed under the “Data” tab and generates the fit parameter results shown in
In some embodiments, when the SSE is minimized, the model parameters are optimized or fit to that experimental data set. In some embodiments, the iterative process may terminate when further reduction in SSE is marginal, change in model parameters is marginal, or the maximum number of iterations is reached (see, e.g., step 809 of
The fit parameters may reveal important properties of the system or individual from which the experimental data came. When the mathematical model analysis computer system 102 yields a good fit between the model and the data, the fit parameters of the model can classify a property of the system from which the data was obtained.
For instance, in Example 1, as shown in
In Example 2, the fit pharmacokinetic parameters tell us the properties of a drug such as insulin for a particular individual. This allows a scientist to figure out how fast a drug is absorbed into the individual, when it reaches maximal concentration in the blood, etc. The fit modeled plasma insulin (simulated plasma insulin using the fit parameters) describes the experimentally collected plasma insulin points shown in
Example 3 is an extension of Example 2 that includes the pharmacodymanics of how insulin therapy affects an individual with type 1 diabetes glucose profile. Identified parameters such as Insulin Gain encapsulates the individuals sensitivity to insulin (i.e., how much glucose is reduced per unit of insulin) and is important in figuring out dosing. Here the model fit glucose replicates plasma glucose collected experimentally by a glucose sensor or lab analyzer.
In Example 4, the nerve axon parameters have been fit in
The conventional systems, such as MATLAB, require additional programming to fit a defined model to experimental data as shown in MATLAB scripts for Examples 1 and 2. Furthermore additional code is required to indicate which subset of model points are paired up with the experimental data (see code line:“[intersection,ia,indexPairs]=intersect(data_t,tSpan);” in the FitSpringDamperSystem.m file for Example 1, and the same line of code in the FitBasalBolusInsulin.m file for Example 2) as well as calculate the SSE or penalty function to be minimized to identify the optimal model parameters for the particular experimental dataset.
In some embodiments, once the model is entered or uploaded into the GUI along with experimental data, the user may only have to select the model variable and the experimental dataset that the user wishes to fit the model variable to and enter the fit model instruction (e.g., by clicking on the “Fit Model” button). In some embodiments, the model variable and experimental dataset may be selected from a drop down list. In some non-limiting embodiments, all model variables may be listed under the “Fit Variable” drop down, and all experimental data columns are listed under the “To Data” drop down defined by the headers in the table in the “Data” tab. This may prevent the user from typing in variable names that don't exist and may limits the possibility of errors. Here again, no custom programming is required by the user. In some embodiments, when the fitting procedure is complete, the model output and plots may be automatically updated. Model data and experimental data may be automatically paired up for the same independent variable values (e.g., at the same times).
In some embodiments, the mathematical model analysis computer system 102 may simulate an identified model to different input conditions. Once model parameters are identified or fit to a particular system or individual, subsequent simulations using the fit parameters can be done under different inputs. After the fit parameters are obtained in the second column of the parameters table, the user can click on “Copy Fit to Initial Guess” for subsequent simulations to be performed with the fit parameters. This may allow the user to observe how a system or individual would behave under different conditions in simulation prior to implementing them experimentally. Inputs to the system can be optimized to achieve a desired output.
In Example 2, using an initial guess for each parameter, the mathematical model analysis computer system 102 may generate the simulation shown in
In Example 3, the mathematical model analysis computer system 102 has identified or fit an individual patient's model parameters to their experimental data and generated the fit parameter results shown in
In Example 4, the mathematical model analysis computer system 102 has identified or fit the nerve axon parameters have been identified from data experimentally collected during a current clamp and generated the results shown in
Conventional, standalone software packages may allow users to simulate and fit a single user defined closed form equation. However, in some embodiments of the present invention, the mathematical model analysis computer system 102 may simulate or fit a custom user defined model consisting of multiple closed form equations and/or single or multiple differential equations without requiring programming or scripting from the user. Furthermore, in some embodiments the mathematical model analysis computer system 102 may handle multiple changing inputs (see Example 2) without requiring programming or scripting from the user. Accordingly, the mathematical model analysis computer system 102 may have the flexibility of model customization with changing inputs that requires no programming (in a particular scripting language) by the user.
In some embodiments, the system 100 may automatically plot data on graphs on the screen once a model is simulated or fit to a dataset. In some embodiments, users can define a variable on the y-axis to plot against a variable on the x-axis (e.g., using a drop down list containing the names of existing state variables and datasets, which may eliminate data entry errors). In some embodiments, plot properties (e.g., which graph # to plot the data to, “X-axis” variable to plot, “Y-axis” variable to plat, and/or plot properties such as “Point Type”, “Point Size”, “Line Type”, “Line Thickness” and/or “Color” as shown in
In some non-limiting embodiments, the simulation of the model by the mathematical model analysis computer system 102 using the initial guess parameters may be visualized prior to fitting a model to an experimental dataset. This is because the mathematical model analysis computer system 102 may use a non-linear least squares procedure to iterate model parameters starting with the initial guess to minimize the SSE between the model and the experimental data. Depending on the initial guess values selected for the parameters, the resulting fit parameters and resulting model output may vary.
The resulting fit parameters and model in
Visualization may also be useful when comparing the goodness of fit of two or more models to a data set as shown in
In some embodiments, the functionality mathematical model analysis computer system 102 may be architected as a collection of web services, each performing one or more of the functions listed above. A consequences of such an architecture may be that each service may be load-balanced as per demand. For example, should there be great demand for Data Storage/Retrieval service, then multiple instances of the service may be spawned and requests may be load-balanced between them. Another consequence may be that the Web services may be exposed to power users (third parties) who want to build their own applications using the functionality provided mathematical model analysis computer system 102. That is, in some embodiments, the system 100 may be configured such that a third party website can access the mathematical model analysis computer system 102 from the third party website using its own custom GUI or software. The model equations, parameters, and data would be sent to the mathematical model analysis computer system 102 through web communication. The mathematical model analysis computer system 102 would perform analysis, model simulation, fitting models to data and send the results/plots back to the user's website. Also, the third party website may have the ability to save and retrieve models from the inventions repository.
In some embodiments, the system 100 may be applied to one or more of scientific research, academics, education websites, design of sensors and control systems, the financial industry, and sales teams. In scientific research, models are devised to replicate and physical phenomena (as in Examples 2 and 3). A scientist or engineer hypothesizes a mathematical model describing some physical phenomena and needs to validate and refine the model by comparing it and fitting it to (i.e., replicating) experimental data. After parameters have been fit or identified to an appropriate model, the model is re-simulated under different inputs so as to make predictions as to how the system would behave under different conditions before implementing them to the real patient. A priori knowledge of how a person responds to a drug therapy may add a measure of safety to the patient and therapy can be optimized quickly as opposed to a repetitive test and see approach. Evaluating whether predicted results are independently validated with independent datasets (not used to identify the model) can help further refine and improve the model. For example, the system 100 may be applied in the pharmaceutical industry where pharmacokinetic models of different drugs are used to optimize dosage amounts and scheduling to achieve a desired concentration of the drug at a targeted location (see Example 2). Furthermore, as medicine is moving towards a personalized approach, a unique set of model parameters can be identified to each individual whereby the model is fit to experimental data that measures the concentration of a drug in response to a dose. Then, the patients dosing regimen can be optimized in simulation to achieve a desired concentration profile over time. For example, the dosage of Tylenol is currently the same for adults and normalized to body weight for children. There are many factures that affect an individual's sensitivity to a drug. Models can be used to evaluate an individual's sensitivity and response to a drug and provide an individualized dosing strategy.
In regard to academics, the system 100 may be used to teach applied mathematics can be taught without having the students first learn to program. More time could be spent learning the mathematical concepts as opposed to programming the tool. Students may use the system 100 share their models and data and learn from each other. Collaborating on the current state-of-the-art requires copying programs and re-running them. Such steps are eliminated by the invention. Universities may subscribe entire classes to the system 100 instead of buying licenses for software packages like MATLAB (and installing and maintaining them). Educational websites may access the mathematical model analysis computer system 102 by sending model equations, parameters and data from their own website. Once the mathematical model analysis computer system 102 performs analysis (simulation and/or systems identification), results can be sent back.
Educational websites often publish model equations and simulations; however these simulation outputs are often static images, or fixed animations. They are usually not interactive. For example Wikipedia's description of the Hodgkin-Huxley model is shown here: http://en.wikipedia.org/wiki/Hodgkin%E2%80%93Huxley_model. It would be more instructive if one could evaluate how changes in inputs, model parameters or equations affect the simulated output which can be done with this invention.
In regard to sensors and control systems, temperature sensor and other sensor manufacturers often require users to recalibrate sensors by fitting a calibration model to experimental data. The manufacturers may offer a software download by which users may tweak how their device is calibrated or rely on the end user to have the knowledge to re-calibrate the sensors themselves. Such manufacturers may publish the model on the mathematical model analysis computer system 102 instead of having to develop and maintain their own computational tool.
The financial industry may use the mathematical model analysis computer system 102 to analyze models used to predict the price of a stock. They could calculate whether certain parameters are significantly correlated to the movement in stock price. The time- and cost-efficiencies mentioned above for the scientific research industry can also be achieved by the financial industry—through quick delivery of results, not needing to program, and not having to maintain installed software and hardware.
In regard to sales teams, the mathematical model analysis computer system 102 may be used to create sales forecasts. Sales teams may devise models based on past sales, and use the product to predict future sales based on certain inputs.
While various embodiments of the present disclosure are described herein, it should be understood that they have been presented by way of example only, and not limitation. Thus, the breadth and scope of the present disclosure should not be limited by any of the above-described exemplary embodiments. For example, although embodiments were described in which the mathematical model analysis computer system 102 is remotely accessed by one or more device 104, this is not required. In some alternative embodiments, the mathematical model analysis computer system 102 may be present on user device, such as a laptop, tablet, smart phone, or personal computer. Moreover, any combination of the above-described elements in all possible variations thereof is encompassed by the disclosure unless otherwise indicated herein or otherwise clearly contradicted by context. Additionally, while the processes described above and illustrated in the drawings are shown as a sequence of steps, this was done solely for the sake of illustration. Accordingly, it is contemplated that some steps may be added, some steps may be omitted, the order of the steps may be re-arranged, and some steps may be performed in parallel.
This application claims the benefit of priority to U.S. Provisional Application Ser. No. 62/024,664, filed on Jul. 15, 2014, which is incorporated herein by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
62024664 | Jul 2014 | US |