% congctrl_N(t, x, options, N, bmax, c)
%
% Congestion control dynamics using N identical sources
%
% RMM, 11 Jul 06

function dx = congctrl_N(t, x, options, N, bmax, c)

if (nargin < 4) N = 6; end;
if (nargin < 5) bmax = 100; end;
if (nargin < 6) c = 10; end;

% Initialize the derivative to have the right shape
dx = zeros(2, 1);

% Window dynamics
dx(1) = c / x(2) - (c / bmax) * (1 + (x(1)^2) / 2);

% Buffer dynamics
dx(2) = N * (x(1) * c / x(2)) - c;
