%  This function solves homework problem [H8.3]
%  --------------------------------------------
%
echo on
%
%  Set initial conditions
%
t = 0;
tf = 50e-6;
h = 0.5e-6;
x = [0;0];
y = out_eq2(x,t);
tvec = t;
yvec = y;
hvec = h;
%
%  Simulate using inlined Radau IIA(3)
%
echo off
while t < tf,
  if t + h > tf,
    h = tf - t;
  end,
  [x,hnew] = radau_stepv(x,t,h);
  t = t + h;
  y = out_eq2(x,t);
  tvec = [tvec,t];
  yvec = [yvec,y];
  hvec = [hvec,h];
  h = hnew;
end
echo on
%
%  Plot the results
%
subplot(3,1,1)
plot(tvec,yvec(1,:))
grid on
title('Homework [H8.3]')
xlabel('Time')
ylabel('u3')
subplot(3,1,2)
plot(tvec,yvec(2,:))
grid on
xlabel('Time')
ylabel('iC')
subplot(3,1,3)
plot(tvec,hvec)
grid on
xlabel('Time')
ylabel('h')
%
print -deps nsds_hw8_3.eps
echo off
%
return