function dy=odestate(x,y)
%% TOPIC
% This is the function needed to solve the ODE
% Language : Matlab 2008a;
% Authors : Autar Kaw;
% Mfile available at
% http://numericalmethods.eng.usf.edu/blog/odestate.m;
% Last Revised : October 19, 2009;

% x is the independent variable
% y is the dependent variable
% y(1) stands for y
% y(2) stands for dy/dx
% the Original ODE 2y"+3y'+5y=7*exp(-x), y(0)=11, dy/dx(0)=13
% reduces by using dy/dx=z as
% 1) dy/dx=z y(0)=11
% 2) 2 dz/dx+ 3z+5y=7exp(-x), z(0)=13 OR 
%     dz/dx=(7exp(-x)-3z-5y)/2, z(0)=13

% So as needed by MATLAB, call y as y(1) and z as y(2)
% 1) dy(1)=y(2), y(1) at x=0 is 11
% 2) dy(2)=(7exp(-x)-3y(2)-5y(1))/2, y(2) at x=0 is 13
dy=zeros(2,1);
dy(1)=y(2);
dy(2)=(7*exp(-x)-3*y(2)-5*y(1))/2;
