  A numerical method is proposed for computing time-periodic and relative
time-periodic solutions in dissipative wave systems. In such solutions, the
temporal period, and possibly other additional internal parameters such as the
propagation constant, are unknown priori and need to be determined along with
the solution itself. The main idea of the method is to first express those
unknown parameters in terms of the solution through quasi-Rayleigh quotients,
so that the resulting integro-differential equation is for the time-periodic
solution only. Then this equation is computed in the combined spatiotemporal
domain as a boundary value problem by Newton-conjugate-gradient iterations. The
proposed method applies to both stable and unstable time-periodic solutions;
its numerical accuracy is spectral; it is fast-converging; and its coding is
short and simple. As numerical examples, this method is applied to the
Kuramoto-Sivashinsky equation and the cubic-quintic Ginzburg-Landau equation,
whose time-periodic or relative time-periodic solutions with spatially-periodic
or spatially-localized profiles are computed. This method also applies to
systems of ordinary differential equations, as is illustrated by its simple
computation of periodic orbits in the Lorenz equations. MATLAB codes for all
numerical examples are provided in appendices to illustrate the simple
implementation of the proposed method.
