Application of inexact Newton method to the optimization of systems with distributed parameters