%
%
function [f1,f2]= bobs_dopc_b(th,s,dt,t,flg)
%
%  s = [u v y x]'
%
a = 1; yf = 0.2;
u = s(1); v = s(2); y = s(3); x = s(4);
c = cos(th); si = sin(th); 
%
if flg == 1
   f1 = [u+a*dt*c; v+a*dt*si; 
       y+v*dt+0.5*a*dt^2*si; x+dt*u+0.5*a*dt^2*c];  
elseif flg == 2
   f1 = [u; v; y-yf]; f2 = [1 0 0 0 ; 0 1 0 0; 0 0 1 0];
elseif flg == 3
    f1 = [1 0 0 0; 0 1 0 0; 0 dt  1 0; dt 0 0 1];
    f2 = [-a*dt*si; a*dt*c; 0.5*a*dt^2*c; -0.5*a*dt^2*si];
end;
      