title: Identical ODE equations acting differently
body: <p>Hi guys I am having an issue with one of my equations in my ODE series. I have two equations that are exactly the same however they are coming out with very different answers. Is there a reason for my equations giving different answers?
  The two equations are the ones governing e and r.</p>
  
  <pre><code>library(sigmoid)
  
  parameters &lt;- c(
                  a = 0.032,
                  b = (9 / 140),
                  c = (5 / 1400),
                  d = (95 / 700),
                  k = 1 / 140,
                  i = 0.25,
                  # r = 0.2,
                  n = 6000000,
                  x = 0.5 ,
                  y = 0.25,
                  t = 1 / 180,        # important in looking at the shape
                  u = 1 / 180,        # important in looking at the shape
                  v = 1 / 180,        # important in looking at the shape
                  p = 10,
                  s = 100,
                  g = 100
  
                  # e = .4,
                  #h = 1000
    ) 
  
    state &lt;- c(
              S = 5989900,
              E = 0,
              I = 0,
              Q = 0,
              D = 100,
              B = 0,
              C = 100,
              Y = 100,
              H = 100,
              R = 10,
              J = 10,
              h = 100,
              e = 0.1,
              r = 0.1
     )
  
   # Function will transition between 0 and 1 when h and Q are approximately 
   equal
   smooth.transition &lt;- function(h, Q, tune = 0.01){
   sigmoid((h/Q - 1)/tune)
   }
   Q &lt;- 1
   h &lt;- seq(0.001, 5, by = 0.001)
  
   plot(h/Q, j, type = "l")
  
  
   # set up the equations
  
   equation &lt;- (function(t, state, parameters)
    with(as.list(c(state, parameters)), {
      # rate of change
  
      dS &lt;- (-(a * S * I) / n) - (((1 / r) * S * D) / n)
      dE &lt;- (a * S * I) / n + (((1 / r) * S * D) / n) - i * E
      j &lt;- smooth.transition(h, Q)
      dI &lt;- i * (j) * E - (e) * I - c * I - d * I
      dQ &lt;- (j) * (e) * I - b * Q - k * Q
      dD &lt;- d * I - r * D
      dB &lt;- b * Q + r * D
      dC &lt;- c * I + k * Q
  
      dY &lt;- p * (b * Q + r * D)
      dR &lt;- j*(1 - x - y) * (p * (b * Q + r * D))  - j*t * (R)
      de &lt;- j*t * (s / R)
      dJ &lt;- (y) * (p * (b * Q + r * D))  - v * (J)
      dr &lt;- v * (s / J)
      dH &lt;- (x) * (p * (b * Q + r * D)) - u * (H)
      dh &lt;- u * (H / g)
  
  
      # return the rate of change
      list(c(dS, dE, dI, dQ, dD, dB, dC, dY, dR, de, dJ, dr, dH, dh))
    }))
  #
  
  # solve the equations for certain starting parameters
  
  
  library(deSolve)
  times &lt;- seq(0, 200, by = 1)
  
  out &lt;-
    ode(y = state,
      times = times,
      func = equation,
      parms = parameters,
      maxsteps = 1e5
    )
  # , method = "vode"
  head(out)
  tail(out)
  
  # graph the results
  
  par(oma = c(0, 0, 3, 0))
  plot(out, xlab = "Time", ylab = "People")
  #plot(out[, "X"], out[, "Z"], pch = ".")
  mtext(outer = TRUE, side = 3, "Ebola Model",cex = 1.5
  )
  </code></pre>
  
  <p>What I get in the initial iterations for R, e, J and r are:</p>
  
  <pre><code>   R: 10, 10.05540, 10.11050
     e: 0.1, 59, 138
  
     J: 10, 39, 79
     r: 0.1, 0.105, 0.11
  </code></pre>
  
  <p>J and r are acting like I expect them to act while R and e are not. Can anyone see a problem in my coding. I think my maths is solid.</p>