Main Content

DimensionalAnalysis

Perform dimensional analysis on model

Description

TheDimensionalAnalysisproperty specifies whether to perform dimensional analysis on the model before simulation. It is a property of theCompileOptionsobject.CompileOptionsholds the model's compile time options and is the object property of theconfigsetobject. WhenDimensionalAnalysisis set totrue, the SimBiology®software checks whether the physical quantities of the units involved in reactions and rules, match and are applicable.

For example, consider a reactiona + b —> c. Using mass action kinetics, the reaction rate is defined asa*b*k, wherekis the rate constant of the reaction. If you specify that initial amounts ofaandbare 0.01M and 0.005M respectively, then units ofkare1/(M*second). If you specifykwith another equivalent unit definition, for example,1/[(moles/liter)*second],DimensionalAnalysischecks 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. IfDimensionalAnalysisis off, and you turnUnitConversionon, thenDimensionalAnalysisis turned on automatically. IfUnitConversionis on and you turn offDimensionalAnalysis, thenUnitConversionis 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(inconfigsetobject)
数据类型 boolean
Data values

trueorfalse. Default value istrue.

Access Read/write

Note

SimBiology allows exponentiation of any dimensionless quantity to any dimensionless power. For example, you can write the following expression if bothxandaare dimensionless:(x + 3)^(a + 0.5)

Note

SimBiology uses units including empty units in association withDimensionalAnalysisandUnitConversion特性。

  • WhenDimensionalAnalysisandUnitConversionare 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.

  • WhenDimensionalAnalysisistrueandUnitConversionisfalse, units (if not empty) must have consistent dimensions so that SimBiology can perform dimensional analysis. However, the units are not converted.

  • WhenUnitConversionis 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 andUnitConversionis 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 asy = 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 setDimensionalAnalysisfrom the defaulttruetofalsein the default configuration set in a model object.

  1. Import a model.

    modelObj = sbmlimport (“振荡器”)

    SimBiology Model - Oscillator Model Components: Models: 0 Parameters: 0 Reactions: 42 Rules: 0 Species: 23
  2. Retrieve theconfigsetobject 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 theCompileOptionsobject.

    optionsObj = get(configsetObj,'CompileOptions') Compile Settings: UnitConversion: true DimensionalAnalysis: true
  4. Assign a value offalsetoDimensionalAnalysis.

    set(optionsObj,'DimensionalAnalysis', false)