Skip to content

Help needed: New to pomp #192

Answered by kingaa
ibrahimStrathclyde asked this question in Q&A
Discussion options

You must be logged in to vote

Here are some things I notice.

I do not see how R0 supposed to be set in your code.

What is beta and is it supposed to be different from Beta?

To raise a number to a power in C, one uses the pow() function.

In C, you must end a complete line with a semicolon.

You have declared epsilon and Beta to be both parameters and local variables.

If you are new to C, you should look at some introductory tutorials about the language. There are many good ones.

Compare the following:

library(ggplot2)
library(pomp)

open.sir.ode <- Csnippet("
  DS = -Beta*(rho*E+I)*pow(S,1+v*v);  
  DE =  Beta*(rho*E+I)*pow(S,1+v*v)-delta*E;
  DI = delta*E-gamma*I;
  DR = gamma*I;")

init1 <- Csnippet("
  S = 1-epsilon;…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ibrahimStrathclyde
Comment options

@kingaa
Comment options

@kingaa
Comment options

@ibrahimStrathclyde
Comment options

Answer selected by ibrahimStrathclyde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants