main content

(to be removed) perform dimensional analysis on model -凯发k8网页登录

(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 toobject: compileoptions (in configset object)
data typeboolean
data values

true or false. default value is true.

accessread/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 dimensionalanalysis and unitconversion are both false, 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 dimensionalanalysis is true and unitconversion is false, units (if not empty) must have consistent dimensions so that simbiology can perform dimensional analysis. however, the units are not converted.

  • when unitconversion is set to true (which requires dimensionalanalysis to be true), 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 to dimensionless.

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) where t is the time in hour and y is 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, where time is the simulation time, t0 is a parameter defined as 1.0 hour, s0 is a parameter defined as 1.0 mole/liter, and s1 is the concentration of a species in mole/liter. note that time and s1 do not have to be in the same units as t0 and s0, but they must be dimensionally consistent. for example, the time and s1 units 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.

  1. import a model.

    modelobj = sbmlimport('oscillator')
    simbiology model - oscillator 
       model components:
         models:            0
         parameters:        0
         reactions:         42
         rules:             0
         species:           23
    
  2. retrieve the configset object 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:  true
  3. retrieve the compileoptions object.

    optionsobj = get(configsetobj,'compileoptions')
    compile settings:
         unitconversion:       true
         dimensionalanalysis:  true
  4. assign a value of false to dimensionalanalysis.

     set(optionsobj,'dimensionalanalysis', false)

see also

unitconversion, , , ,

version history

网站地图