Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time-dependent rate laws? #275

Open
hodgensc opened this issue May 17, 2024 · 1 comment
Open

Time-dependent rate laws? #275

hodgensc opened this issue May 17, 2024 · 1 comment

Comments

@hodgensc
Copy link

Hi everyone! Apologies if this isn't the right place to put this.

I'm interested in applying a time-dependent rate law for one of my reactions. Currently what I've found to work is a structure like this, where I create a pseudo-species that increases linearly with time as a reaction and then define my time-varying rate law using that.

begin seed species
  A 100
  B 100
  C 0
  T 0
end seed species
begin observables
  Molecules A A()
  Molecules B B()
  Molecules C C()
  Molecules T T()
end observables
begin functions
tfunc() = sin(T)+1
end functions
begin reaction rules
  A() + B() <-> C() tfunc(), 1
  0 -> T	1
end reaction rules
simulate({method=>"ode",t_end=>100,n_steps=>1000})

But, is there a better way to do this? Is it possible to just access the current time state from within the BioNetGen file without having to do this workaround? I noticed that there's a "time" constant reserved in the syntax file in the VSCode extension, and what I know of cvode I'd expect there should be a way to access time from inside the problem function that's passed to it.

@wshlavacek
Copy link

wshlavacek commented May 17, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants