Congestion control (single source)

Clear[q, r]

Compute Impact Map

eq = 
      DSolve[{q'[t] == r[t] - B, r'[t] == a, 
          q[0] == q0, r[0] == r0}, {q, r}, t]

q  =  q //. eq[[1]]; r = r //. eq[[1]];

eq = 
      Solve[{q[t1] == qmax, q0 == qmax, r[t1] == r1}, {t1, 
          r1}]

Impact Map

F[{q_, r0_}] = {qmax, m  r1 //. eq[[1]]}

Plot impact point

Plot of impact points

sequence = 
      Map[(Nest[F, {1, 1}, #1] //. {qmax -> 1, m ->  .5, 
                a -> 1, B -> 1}) &, Range[0, 10]]

graph = 
        ListPlot[sequence, AxesOrigin -> {0, 0}, 
          AxesLabel -> {"q", "r"}, 
          PlotRange -> {{0, 2}, {0, 1}}, 
          Prolog -> AbsolutePointSize[6]];

Export["F.jpg", graph, ImageSize -> 600];

Find fixed points

Solve[F[{qq, rr}] == {qq, rr}, {qq, rr}]

Bouncing ball

Clear[q, r]

Compute Impact Map

eq = 
      DSolve[{x1'[t] == x2[t], x2'[t] == -g, 
          x1[0] == x10, x2[0] == x20}, {x1, x2}, t]

x1  =  x1 //. eq[[1]]; x2 = x2 //. eq[[1]];

eq = 
      Solve[{x1[t1] == 0, x10 == 0, x2[t1] == x21}, {t1, 
          x21}]

Impact Map

F[{x1_, x20_}] = {0, -c  x21 //. eq[[1]]}

Plot impact point

Plot of impact points

sequence = 
      Map[(Nest[F, {1, 1}, #1] //. {c ->  .5}) &, 
        Range[0, 10]]

graph = 
        ListPlot[sequence, AxesOrigin -> {0, 0}, 
          AxesLabel -> {"q", "r"}, 
          PlotRange -> {{0, 2}, {0, 1}}, 
          Prolog -> AbsolutePointSize[6]];

Export["F.jpg", graph, ImageSize -> 600];

Find fixed points

Solve[F[{qq, rr}] == {qq, rr}, {qq, rr}]