% predprey_rh.m - feedback function for predator prey system
% RMM, 13 Sep 06
%
% This function computes a simple linear control law, with saturation, for
% the predator prey system

function rh=predprey_rh(t, x, rnom)
global predprey_K predprey_xd predprey_ud;

% Compute the feedback control law
rh = -predprey_K * ([x(1); x(2)] - predprey_xd) + predprey_ud;

% Saturate the control input between 0 and 4*rnom
if (rh < 0) rh = 0; end;
if (rh > 4*rnom) rh = 4*rnom; end;
