%
% Initial value problem - damped oscillator
%

aminit;					% MATLAB initialization

m = 1; b = 0.2; k = 1;			% underdamped oscillator
[t,x] = ode45('oscillator', [0 20], [1 0], [], m, b, k);

figure(1); clf; subplot(211);
plot(t, x(:,1), 'b-', t, x(:,2), 'b--', 'LineWidth', AM_data_linewidth);
hold on; plot([0 20], [0 0], 'k-', 'LineWidth', AM_ref_linewidth);

amaxis;
xlabel('Time {\itt} [s]'); ylabel('States {\itx}_1, {\itx}_2');
lgh = legend('{\itx}_1', '{\itx}_2', 'Orientation', 'horizontal');
legend(lgh, 'boxoff');

amprint('doscivp.eps');
