Two methods for solving optimization problems arising in electronic measurements and electrical engineering