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