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

Abierto
#1,056 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
perl, python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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).

Lenguaje dominante
Python
Estrellas
26
Forks
25
Merge medio
4 h 25 min
PR fusionados (30 d)
9

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de lanl/PyBNF

Todos los issues de lanl/PyBNF

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.