1.0.0 • Published 5 months ago

@datagrok/deqs v1.0.0

Weekly downloads
-
License
-
Repository
github
Last release
5 months ago

Deqs

Deqs is a package for the Datagrok platform. It provides in-browser tools for solving intial value problem for systems of ordinary differential equations (ODE).

  • Go to Apps and run EquaSleek X
  • Enter formulas or modify template
  • Press Run button on the top panel

The solver takes a set of the differential equations in a declarative form, and creates a UI that solves the equations, visualizes the results, and lets you change parameters on the fly.

Quick start

Datagrok provides intuitive tools for the rapid solving ODEs.

  • Run the solver:
    • Go to Apps and run EquaSleek X
    • Press Run button on the top panel
  • Modify a template:
    • Edit formulas or add new ones
    • Click F5 or Run button
  • Use an advanced template:
    • Rigth click and select Templates > Advanced...
    • Modify formulas and click F5
  • Save formulas in a local file:
    • Rigth click and select Save...
    • Find the file in Downloads
  • Load equations from a local file:
    • Rigth click and select Load...
    • Select a file with formulas

Create model from template

Start from one of these templates:

TemplateFeatures
Basicthe simplest model
Advancedextra math features, including expressions, constants, parameters and tolerance specification
Extendedthe annotating feature for extended UI generation

Use cases

The solver has built-in use cases. Get access to them via the context menu. You can use them as a template.

  • Chem reactions
  • Robertson's model
    • Robertson’s chemical reaction model
    • stiff equations example
    • shows how Datagrok solves complicated ODEs
  • Fermentation
    • models the kinetics of the biochemical reactions in fermentation
    • shows the usage of the runOnOpen and runOnInput meta-features
  • PK-PD
    • simulates pharmacokinetics (PK), pharmacodynamics (PD), and their relationship
    • illustrates the usage of the loop feature for dosing specification
  • Acid production
    • models gluconic acid production by Aspergillus niger
    • shows the usage of the update feature for multi-stage simulation
  • Nimotuzumab
    • models population pharmacokinetic for nimotuzumab
    • demonstrates the output feature

Datagrok's ODEs suite has tools for solving both stiff and non-stiff equations. It provides a numerical solution.

Model structure

A model defines initial value problem. It contains name, differential equations, initial values and argument specifications:

#name: My ODEs
#equations:
  dx/dt = x + y + exp(t)
  dy/dt = x - y - cos(t)
#argument: t
  initial = 0
  final = 1
  step = 0.01
#inits:
  x = 2
  y = 5

Use the following sections to specify various problems:

Control blockFeatures
#nameDefines a name.
#equationsDifferential equation specification
#argumentIndependent variable specification
#initsInitial values specification
#constantsConstants specification
#parametersParameters specification
#expressionsDefines auxiliary compuations.
#outputDefines output columns and their captions
#tagsSpecifies tags (model, app, etc.).
#descriptionDefines description of the model.
#meta.runOnOpenProvides computations immediately upon application launch after the model is exported to JavaScript script.
#meta.runOnInputUpdates results immediately upon input changes after the model is exported to JavaScript script.
#commentSpecifies comments block.

Platform applications

Once you are satisfied with the result, you can convert your model to a Datagrok application. To do so:

  1. Press Export button on the top panel
  2. Press SAVE button
  3. Script is created, and can be found in the "Scripts" section of the platform

Improve usability. Use #tags: model to add your model to Model Catalog. Provide a description in the #description-line:

#name: Bioreaction
#tags: model
#description: Complex bioreaction simulation

Apply annotations to get better UI. Append them, when defining parameters, initial values and argument.

Group inputs by specifying their category:

#parameters:
  P1 = 1 {category: Parameters}
  P2 = -1 {category: Parameters}

Add units:

#inits:
  x = 2 {units: C; category: Initial values}
  y = 0 {units: C; category: Initial values}

Define the desired caption:

#argument: t
  start = 0 {caption: Initial; units: min; category: Time}
  finish = 2 {caption: Final; units: min; category: Time}
  step = 0.01 {caption: Initial; units: min; category: Time}

Provide hints in brackets [ ]:

  P1 = 1 {category: Parameters} [P1 parameter tooltip]

Apply scripting tools to get:

  • non-elementary and special functions' use
  • Datagrok packages' functions call

See also