%
%  Third example for dop0
%
%  set the initial parameters
%
  s0 = [1;0];
  tf = 4; 
  u = 0.3*ones(1,10);
  k = 0.2;
  tol = 1e-4;
  mxit = 500;
%
%  run the code
%
  [u,s,la0] = dop0('bobs_dop0_c',u,s0,tf,k,tol,mxit);
  fprintf(1,'Final cost is  %f \n', s(2,end))
  u
%
%  Now plot the results
%
  dt = tf/length(u);
  time = [0:length(u)]*dt;
  figure;
  orient tall
  subplot(2,1,1); plot(time(1:end-1),u); grid; ylabel('u(t)');
  subplot(2,1,2); plot(time,s(1,:)); grid; ylabel('r(t)');  xlabel('Time (sec)');
%
      