In the paper the optimization problem described by some nonlinear hyperbolic equation being continuous counterpart of the Fornasini-Marchesini model is considered. A theorem on the existence of at least one solution to this hyperbolic PDE is proved and some properties of the set of all solutions are established. The existence of a solution to an optimization problem under appropriate assumptions is the main result of this paper. Some application of the obtained results to the process of gas filtration is also presented.Keywords Mayer problem · Continuous counterpart of the Fornasini-Marchesini model · Existence of optimal solutions