function f = weeks(F, t, N, sig, b)

%  The function f = weeks(F,t,N,sig,b) computes the inverse Laplace
%  transform f(t) of the transform F(s) by the method of Weeks.

%  Input:
%  F -- symbolic function of s.
%  t -- ordinate(s) where f(t) are to be computed (scalar or vector).
%  N -- number of terms in the Laguerre expansion.
%  sig, b -- free parameters in Weeks method.  b > 0, sig > sig_0.
%  Note: sig and b may be estimated by wpar1.m and wpar2.m.

%  Output:
%  f   -- function values at t.

%  Example of usage: >>F = '1./sqrt(s.^2+1)'; t = [0 1 2]; 
%                    >>f  = weeks(F, t, 16, 1, 1)

a   = real(wcoef(F,N,sig,b));        % Compute the coefficients.
a   = a(N+1:2*N);                    % Extract a_n, n = 0,...,N-1.
t   = t(:);                          % Make sure t is a column vector.
L   = laguer(a,2*b*t);               % Evaluate the Laguerre series. 
f   = L.*exp((sig-b)*t);             % Evaluate Weeks expansion.




