function fval = mech_osc_fun(t,y)
%
% Evaluates the right-hand side of the mechanical oscillator 
% ode x'' = - Dx' - x, written as a first-order system  
%
%      y' = Ay, A = [0 1; -1 -D]
%
% Note: D is input as a global variable D_GL. 
%
% The inputs are 
%  t   = current t-value
%  y   = current y-value
%
% The output is the value of the right-hand side function. 
%

global D_GL; 

A = [0 1; -1 -D_GL];
fval = A*y;


