%  This function solves homework problem [H8.2]
%  --------------------------------------------
%
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;
%
%  Simulate using inlined Radau IIA(3)
%
echo off
while t < tf,
  x = radau_step(x,t,h);
  t = t + h;
  y = out_eq2(x,t);
  tvec = [tvec,t];
  yvec = [yvec,y];
end
echo on
%
%  Plot the results
%
subplot(2,1,1)
plot(tvec,yvec(1,:))
grid on
title('Homework [H8.2]')
xlabel('Time')
ylabel('u3')
subplot(2,1,2)
plot(tvec,yvec(2,:))
grid on
xlabel('Time')
ylabel('iC')
%
print -deps nsds_hw8_2.eps
echo off
%
return