In this paper, we have improved the calculation of the relic gravitational waves (RGW) in two aspects. First, we investigate the transfer function by taking into consideration the redshift-suppression effect, the accelerating expansion effect, the damping effect of free-streaming relativistic particles, and the damping effect of cosmic phase transition, and give a simple approximate analytic expression, which clearly illustrates the dependence on the cosmological parameters.Second, we develop a numerical method to calculate the primordial power spectrum of RGW in a very wide frequency range, where the observed constraints on ns (the scalar spectral index) and Ps(ko) (the amplitude of primordial scalar spectrum) and the Hamilton-Jacobi equation are used. This method is applied to two kinds of inflationary models,which satisfy the current constraints on ns, α (the running of ns) and r (the tensor-scalar ratio). We plot them in the r - Ωg diagram, where Ωg is the strength of RGW, and study their measurements from the cosmic microwave background (CMB) experiments and laser interferometers.