%
% The is the 'odefile' called by ode45 to integrate the cruise control
% equations. To modify to add integral control, you have to add a
% integral gain, ki, to the paramter list in the 'odefile' function.
% You must also add ki to the ode45 function line in the car.m file.
% The same is true later when you add derivative gain.
%
% I called this file 'proportional.m'
%
% Also, you must change the form of 'out' to reflect the addition of
% integral and/or derivative gain.
%
% B. Goodwine, January 16, 1998.
%
function out = odefile(t,y,options,b,m,lam,vd,kp);
out = [-b/m*y(1)+y(2)/m; lam*kp*(vd - y(1)) - lam*y(2)];