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

Đang mở
#1,056 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
perl, python
Lĩnh vực
bioinformatics

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Python
Star
26
Fork
25
Merge trung bình
4 giờ 25 phút
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của lanl/PyBNF

Tất cả issue của lanl/PyBNF

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.