(to be removed) perform dimensional analysis on model -pg电子麻将胡了
(to be removed) perform dimensional analysis on model
dimensionalanalysis will be removed in a future release. use
unitconversion instead.
description
the dimensionalanalysis property specifies whether to perform
dimensional analysis on the model before simulation. it is a property of the
compileoptions object. compileoptions holds the
model's compile time options and is the object property of the configset
object. when dimensionalanalysis is set to true, the
simbiology® software checks whether the physical quantities of the units involved in
reactions and rules, match and are applicable.
for example, consider a reaction a b —> c. using mass
action kinetics, the reaction rate is defined as a*b*k, where
k is the rate constant of the reaction. if you specify that initial
amounts of a and b are 0.01m and 0.005m respectively,
then units of k are 1/(m*second). if you specify
k with another equivalent unit definition, for example,
1/[(moles/liter)*second], dimensionalanalysis checks
whether the physical quantities match. if the physical quantities do not match, you see an
error and the model is not simulated.
unit conversion requires dimensional analysis. if dimensionalanalysis
is off, and you turn unitconversion on, then
dimensionalanalysis is turned on automatically. if
unitconversion is on and you turn off
dimensionalanalysis, then unitconversion is turned off
automatically.
if you have matlab® function calls in your model, dimensional analysis ignores any expressions containing function calls and generates a warning.
valid physical quantities for reaction rates are amount/time, mass/time, or concentration/time.
characteristics
| applies to | object: compileoptions (in configset
object) |
| data type | boolean |
| data values |
|
| access | read/write |
note
simbiology allows exponentiation of any dimensionless quantity to any dimensionless
power. for example, you can write the following expression if both x and
a are dimensionless: (x 3)^(a 0.5)
note
simbiology uses units including empty units in association with dimensionalanalysis and unitconversion features.
when
dimensionalanalysisandunitconversionare bothfalse, units are not used. however, simbiology still performs a minimum level of dimensional analysis to decide whether a reaction rate is in dimensions of amount/time or concentration/time.when
dimensionalanalysisistrueandunitconversionisfalse, units (if not empty) must have consistent dimensions so that simbiology can perform dimensional analysis. however, the units are not converted.when
unitconversionis set totrue(which requiresdimensionalanalysisto betrue), simbiology performs a dimensional analysis and converts everything to consistent units. hence, you must specify consistent units, and no units can be empty. if you have a dimensionless parameter, you must still set its unit todimensionless.
tip
if you have a custom function and unitconversion is on, follow the recommendation below.
non-dimensionalize the parameters that are passed to the function if they are not already dimensionless.
suppose you have a custom function defined as
y = f(t)wheretis the time in hour andyis the concentration of a species in mole/liter. when you use this function in your model to define a repeated assignment rule for instance, define it as:s1 = f(time/t0)*s0, wheretimeis the simulation time,t0is a parameter defined as 1.0 hour,s0is a parameter defined as 1.0 mole/liter, ands1is the concentration of a species in mole/liter. note thattimeands1do not have to be in the same units ast0ands0, but they must be dimensionally consistent. for example, thetimeands1units can be set to minute and picomole/liter, respectively.
examples
this example shows how to retrieve and set dimensionalanalysis from the
default true to false in the default configuration set
in a model object.
import a model.
modelobj = sbmlimport('oscillator')simbiology model - oscillator model components: models: 0 parameters: 0 reactions: 42 rules: 0 species: 23retrieve the
configsetobject of the model object.configsetobj = getconfigset(modelobj) configuration settings - default (active) solvertype: ode15s stoptime: 10.000000 solveroptions: absolutetolerance: 1.000000e-006 relativetolerance: 1.000000e-003 runtimeoptions: statestolog: all compileoptions: unitconversion: true dimensionalanalysis: trueretrieve the
compileoptionsobject.optionsobj = get(configsetobj,'compileoptions') compile settings: unitconversion: true dimensionalanalysis: trueassign a value of
falsetodimensionalanalysis.set(optionsobj,'dimensionalanalysis', false)
see also
unitconversion, , , ,