In order to obtain optimal control of a real object, it is necessary to know the precise mathematical model of this control object. In the present study an artificial neural network is used for building a mathematical model of the control object. First, some forms of control are defined, and with the help of these controls, the control object is modeled. The obtained values of the controls and the space state vector are stored to create a training sample. The artificial neural network is then trained on this training set. For a trained neural network, a set of optimal control problems is solved. The optimal control obtained by the trained artificial neural network is applied to a real control object. The accuracy of the approximation of the mathematical model by an artificial neural network can be estimated based on the proximity of the functional values of the control object and the trained neural network. © 2022 IEEE.