function s = source(X,value)
% s = source(X,value)
% Defines source value to be used in equation. Should be constant
% in time but can be chosen as a MATLAB expression (i.e. 4*x+y).

x = X(:,1);
y = X(:,2);

st = input('Enter source term >> ','s');

if isempty(st)
    s = value*ones(size(y,1),1);
else
    if isempty(strfind(st,'x')) && isempty(strfind(st,'y'))
        s = str2double(st)*ones(size(x,1),1);
    else
        s = eval(st);
    end
end
