A rate law that reads time() runs with the clock held fixed over each output step on bngl_backend = bionetgen, so the same job fits a different answer than on bngsim

Aperta
#1,056 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
perl, python

Direzione di ricerca

Start by reproducing the clock.bngl model with perl $BNGPATH/BNG2.pl clock.bngl, then compare the generated .gdat values with the closed form and with bngsim.Model.from_net over t_span=(1, 3). Trace how time() is updated during run_network, including the bngl_backend = bionetgen and bngl_backend = bngsim paths. Done means both backends produce consistent trajectories for the stated model, or unsupported time() use is rejected or clearly warned about with the affected function and backend named.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What you see. A BNGL model whose rate law reads time() gives a different trajectory on bngl_backend = bionetgen than on bngl_backend = bngsim, and the gap depends on the output grid. The same fitting job therefore fits different parameters on the two backends. Nothing warns.

Example. A() -> 0 kt() with kt() = k_deg*time(), k_deg = 0.7, A0 = 1, and simulate({method=>"ode",t_start=>1,t_end=>3,n_steps=>8}). The closed form is A(t) = exp(-k (t² - 1)/2), so A(3) = 0.0608100626.

run A(3) worst relative error over the grid
BNG2.pl 2.9.3, n_steps=>8 0.0731234744 20%
BNG2.pl 2.9.3, n_steps=>80 0.0621399694 2.2%
bngsim 0.18.0 (.net from the same BNG2.pl run) 0.0608100321 5e-7

The BNG2.pl numbers match holding time() at the start of each output interval. For example, A(1.25) = exp(-0.7 × 1 × 0.25) = 0.8395, where the closed form gives 0.8213. So run_network appears to update time() only at output steps, and a coarse grid integrates a different model.

Reproduce. Write the model above with its actions block, then run perl $BNGPATH/BNG2.pl clock.bngl and compare the .gdat with the closed form. Then load the generated .net with bngsim.Model.from_net and run it over t_span=(1, 3).

Possible fixes. Refuse, at load, a BNGL model whose functions read time() when it would run on BNG2.pl, naming the function. Or keep it, state the run_network behaviour, and say what output grid makes it close. Upstream, RuleWorld/bionetgen#275 was closed on the basis that BioNetGen supports time() in ODE rate laws. That may need reopening with these numbers.

Found during independent review of the multiple-shooting batch (#911–#915, #959, #1038, #1049).

Lingua principale
Python
Stelle
26
Fork
25
Merge medio
4h 25m
PR unite (30g)
9

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lanl/PyBNF

Tutte le issue di lanl/PyBNF

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.