sys-bio / antimony

BSD 3-Clause "New" or "Revised" License
16 stars 4 forks source link

Antimony Round-tripping Bug #46

Open luciansmith opened 7 years ago

luciansmith commented 7 years ago

For the first time in five years, I found an Antimony round-tripping bug. This isn't a priority, I just wanted to file it here so we don't forget about it.

The following code:

model advanced()
  # Create two compartments
  compartment compA=1, compB=0.5 # B is half the volume of A
  species A in compA, B in compB
  # Use the label `J0` for the reaction
  J0: A -> B; k*A
  # C is defined by an assignment rule
  species C
  C := sin(2*time/3.14) # a sine wave
  k = 0.1
  A = 10

  # Event: half-way through the simulation,
  # add a bolus of A
  at time>=5: A = A+10
end

Gets round-tripped as:

// Created by libAntimony v2.9.4
model *advanced()

  // Compartments and Species:
  compartment compA, compB;
  species A in compA, B in compB, $C;

  // Assignment Rules:
  C := sin(2*time/3.14);

  // Reactions:
  J0: A -> B; k*A;

  // Events:
  _E0: at time >= 5: A = A + 10;

  // Species initializations:
  A = 10;
  B = ;

  // Compartment initializations:
  compA = 1;
  compB = 0.5;

  // Variable initializations:
  k = 0.1;

  // Other declarations:
  const compA, compB, k;

  // SBO terms:
  // - Compartment SBO Terms:
  default_compartment.sboTerm = SBO:0000410;

end

C gets converted into a boundary species, and the simulations are different. Roadrunner plots the value of C in the first example, but not in the second.

Antimony 2.9.4, Win64, libSBML 5.15.0

Reported by: o0u812

luciansmith commented 7 years ago

The SBO term was added by Tellurium, can be deleted

Original comment by: o0u812