This paper presents the research of approaches to numerically compute the solution to an optimal control problem with phase constraints. Such models are typical for economic modeling, but can also be found in a variety of applications. The formal description of planning the assets and liabilities by the management of a bank within internal goals and regulatory requirements may be formalized as an optimal control problem with constraints. Solving such models analytically is rarely possible, but numerical experiments give the idea of the properties of the solution and the prospective dynamics of the bank’s balance sheet. Two types of methods are available to solve this problem numerically: indirect and direct methods. We present both approaches in this paper and test them on the example where the analytical solution is found explicitly. The indirect method in the form of the maximum principle, is used for the version of the model with penalty functions and for the version of the problem with one phase constraint. The corresponding system of ordinary differential equations combined with specific equations for the dual variables are solved by the shooting method. The direct method is applied to the model formulated in the discrete time. It is shown that such version of the model has the global solution if we reformulate it as the optimal control problem with mixed constraints. This paper provides the results of computation using both the direct and indirect methods and the results of numerical experiments.