yaml2sbml-dev / yaml2sbml

Tool to convert an ODE model specified in the YAML format to SBML.
https://yaml2sbml.readthedocs.io/en/latest/
Other
12 stars 7 forks source link

Initial assignment feature #145

Open aidinbii opened 5 months ago

aidinbii commented 5 months ago

Hello, I want to ask about this feature

The definition of Ke_3 in the model should not be with an assignment Ke_3 := Ke_30 + diff_Ke1
but with an initial assignment Ke_3 = Ke_30 + diff_Ke1

From this discussion: https://github.com/ICB-DCM/pyPESTO/issues/1334#issuecomment-2034771374

dilpath commented 5 months ago

Hi @aidinbii

You can create this initial assignment with the following:

parameters:
  - parameterId: Ke_30
    nominalValue: 30

  - parameterId: diff_Ke1
    nominalValue: 1

odes:
    - stateId: Ke_3
      rightHandSide: 0 + 0
      initialValue: Ke_30 + diff_Ke1

The Ke_3 ODE is a bit of a hack: it will create the correct initial assignment, and the right-hand-side needs to be anything that evaluates to 0, so that Ke_3 doesn't change value over time. 0 by itself doesn't seem to work in the current version of yaml2sbml.

You can then use Ke_3 as a parameter in other expressions.