Skip to content
New issue

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

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

Already on GitHub? # to your account

Why removing N variable in equationsToTransitions? #291

Open
SergeStinckwich opened this issue Mar 11, 2021 · 4 comments
Open

Why removing N variable in equationsToTransitions? #291

SergeStinckwich opened this issue Mar 11, 2021 · 4 comments
Milestone

Comments

@SergeStinckwich
Copy link
Collaborator

Why do we need to remove N from the events in equationsToTransitions method:

equationsToTransitions

	"This is only working for status ODE equations, not general ODE equations"

	| events |
	events := self generateEvents.

	"Remove N variable in events rate. Why?"
	events do: [ :e | 
		e fromStatus = #empty ifTrue: [ 
			e rate: (e rate removeVariable: (KEVariable new symbol: #N)) ] ].

	events do: [ :each | 
		self
			addTransitionFrom: { (#status -> each fromStatus) }
			to: { (#status -> each toStatus) }
			probability: each rate ].

	"Why initializing equations at the end?"
	equations := OrderedCollection new
@SergeStinckwich SergeStinckwich added this to the v1.0 milestone Mar 11, 2021
@btmanh
Copy link
Collaborator

btmanh commented Mar 12, 2021

Because in the equation of S, dS/dt = muN - lambdaS, we have the transition: empty — mu —> S
however the rate extract from the equation is muN, and we store only per capita transition rate, so to obtain the rate mu, we remove N.

@SergeStinckwich
Copy link
Collaborator Author

Maybe a correct way to do it, is to store only per capita transition rate when we generate the events (in method generateEvents), so don't have to deal with that later.

@btmanh
Copy link
Collaborator

btmanh commented Mar 12, 2021

Yes, i agree. And it seems that in the generateEvents method, we store per capita rate for other events, except empty-->S.

@SergeStinckwich
Copy link
Collaborator Author

Why there is a special treatment for empty -> S ?

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

No branches or pull requests

3 participants