Calculation of discrete relaxation modulus and creep compliance