{"id":31779,"date":"2019-10-31T21:43:00","date_gmt":"2019-10-31T18:43:00","guid":{"rendered":"https:\/\/prohoster.info\/blog\/scipy-optimizatsiya-s-usloviyami\/"},"modified":"2019-10-31T21:43:00","modified_gmt":"2019-10-31T18:43:00","slug":"scipy-optimizatsiya-s-usloviyami","status":"publish","type":"post","link":"https:\/\/prohoster.info\/de\/blog\/novosti-interneta\/scipy-optimizatsiya-s-usloviyami","title":{"rendered":"SciPy, Optimierung mit Bedingungen","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/7a5734da75ff0f5cd52fd6b81f8dabda.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<\/p>\n<p>SciPy (\u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0430\u0439 \u043f\u0430\u0439) \u2014 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 numpy \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u043a\u0435\u0442, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u044f \u0442\u0430\u043a\u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 C \u0438 Fortran. \u0421 SciPy \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0435\u0430\u043d\u0441 Python \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u0430\u043a MATLAB, IDL, Octave, R \u0438\u043b\u0438 SciLab. <\/p>\n<p><\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0435\u043c\u044b \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u0430 scipy.optimize. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0432 <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/439288\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a><\/noindex>. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u043f\u0440\u0430\u0432\u043a\u0443 \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c scipy \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b help(), Shift+Tab \u0438\u043b\u0438 \u0432 <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/optimize.html\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a><\/noindex>. <\/p>\n<p><noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h3 id=\"vvedenie\">\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p><\/p>\n<p>\u041e\u0431\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043a\u0430\u043a \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439, \u0442\u0430\u043a \u0438 \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 scipy.optimize \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>minimize()<\/code>. \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u0434\u0430\u0447 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u0431\u043e\u0440 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u043e\u0436\u0438\u0442\u0441\u044f \u043d\u0430 \u043f\u043b\u0435\u0447\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<br \/>\n\u041f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>minimize(..., method=\"\")<\/code>.<br \/>\n\u0414\u043b\u044f \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432: <\/p>\n<p><\/p>\n<ul>\n<li><code>trust-constr<\/code> \u2014 \u043f\u043e\u0438\u0441\u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0430 \u0432 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438. <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Trust_region\">\u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0430 wiki<\/a><\/noindex>, <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/335224\/\">\u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0445\u0430\u0431\u0440\u0435<\/a><\/noindex>; <\/li>\n<li><code>SLSQP<\/code> \u2014 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u043d\u044c\u044e\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u041b\u0430\u0433\u0440\u0430\u043d\u0436\u0430. <noindex><a rel=\"nofollow\" href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D0%BE%D1%81%D0%BB%D0%B5%D0%B4%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D0%BE%D0%B5_%D0%BA%D0%B2%D0%B0%D0%B4%D1%80%D0%B0%D1%82%D0%B8%D1%87%D0%BD%D0%BE%D0%B5_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5\">\u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0432\u0438\u043a\u0438<\/a><\/noindex>.<\/li>\n<li><code>TNC<\/code> \u2014 Truncated Newton Constrained, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439, \u0445\u043e\u0440\u043e\u0448 \u0434\u043b\u044f \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Truncated_Newton_method\">\u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0430 wiki<\/a><\/noindex>.<\/li>\n<li><code>L-BFGS-B<\/code> \u2014 \u043c\u0435\u0442\u043e\u0434 \u043e\u0442 \u0447\u0435\u0442\u0432\u0435\u0440\u043a\u0438 Broyden\u2013Fletcher\u2013Goldfarb\u2013Shanno, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0438\u0437 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0413\u0435\u0441\u0441\u0435. <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Limited-memory_BFGS\">\u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0430 wiki<\/a><\/noindex>, <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/333356\/\">\u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0445\u0430\u0431\u0440\u0435<\/a><\/noindex>.<\/li>\n<li><code>COBYLA<\/code> \u2014 \u041a\u041e\u0411\u042b\u041b\u0410 Constrained Optimization By Linear Approximation, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0435\u0439 (\u0431\u0435\u0437 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430). <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/COBYLA\">\u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0430 wiki<\/a><\/noindex>. <\/li>\n<\/ul>\n<p><\/p>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438: <\/p>\n<p><\/p>\n<ul>\n<li>\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0430 <code>Bounds<\/code> \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 L-BFGS-B, TNC, SLSQP, trust-constr;<\/li>\n<li>\u0441\u043f\u0438\u0441\u043a\u043e\u043c <code>(min, max)<\/code> \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 L-BFGS-B, TNC, SLSQP, trust-constr; <\/li>\n<li>\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0438\u043b\u0438 \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 <code>LinearConstraint<\/code>, <code>NonlinearConstraint<\/code> \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 COBYLA, SLSQP, trust-constr; <\/li>\n<li>\u0441\u043b\u043e\u0432\u0430\u0440\u0435\u043c \u0438\u043b\u0438 \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 <code>{'type':str, 'fun':callable, 'jac':callable,opt, 'args':sequence,opt}<\/code> \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 COBYLA, SLSQP.<\/li>\n<\/ul>\n<p><\/p>\n<p>\u041f\u043b\u0430\u043d \u0441\u0442\u0430\u0442\u044c\u0438:<br \/>\n1) \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 (method=&#187;trust-constr&#187;) \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 <code>Bounds<\/code>, <code>LinearConstraint<\/code>, <code>NonlinearConstraint<\/code> ;<br \/>\n2) \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432 (method=&#187;SLSQP&#187;) \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f <code>{'type', 'fun', 'jac', 'args'}<\/code>;<br \/>\n3) \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u043e\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0438 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u0435\u0431-\u0441\u0442\u0443\u0434\u0438\u0438. <\/p>\n<p><\/p>\n<h3 id=\"uslovnaya-optimizaciya-methodtrust-constr\">\u0423\u0441\u043b\u043e\u0432\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f method=&#187;trust-constr&#187;<\/h3>\n<p><\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 <code>trust-constr<\/code> \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 <noindex><a rel=\"nofollow\" href=\"https:\/\/epubs.siam.org\/doi\/10.1137\/S1052623493262993\">EQSQP<\/a><\/noindex> \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u0438\u0434\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430 \u0438 \u043d\u0430 <noindex><a rel=\"nofollow\" href=\"https:\/\/epubs.siam.org\/doi\/10.1137\/S1052623497325107\">TRIP<\/a><\/noindex> \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0432\u0438\u0434\u0435 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432. \u041e\u0431\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0430 \u0432 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u043a\u0440\u0443\u043f\u043d\u043e\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<p><\/p>\n<p>\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0430 \u0432 \u043e\u0431\u0449\u0435\u043c \u0432\u0438\u0434\u0435:<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/4b6d97878e110bcad521dc0642fa85ba.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/52ec5d8bc7e3c9b1224441bb864582dc.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/af0c4a9afe8ab01c16e6ff0332926d37.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>\u0414\u043b\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0441\u0442\u0440\u043e\u0433\u043e\u0433\u043e \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430 \u043d\u0438\u0436\u043d\u044f\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0432\u043d\u043e\u0439 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 <img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/97a3fe3f53ccb55b38b47f1cf22df727.jpg\" style=\"display:block;margin: 0 auto;\" \/>.<br \/>\n\u0414\u043b\u044f \u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u0445\u043d\u044f\u044f \u0438\u043b\u0438 \u043d\u0438\u0436\u043d\u044f\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f <code>np.inf<\/code> \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0437\u043d\u0430\u043a\u043e\u043c.<br \/>\n\u041f\u0443\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0439\u0442\u0438 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0420\u043e\u0437\u0435\u043d\u0431\u0440\u043e\u043a\u0430 \u043e\u0442 \u0434\u0432\u0443\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/d251006b37d876ab906a10d092ed1e03.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0437\u0430\u0434\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0435\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f:<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/2a4cedde7260f7aa71b9464a0a07b339.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/d6ff48c0400fb55b932e2c0ae4b1e816.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/f61f0e95486e41bf7ae2b882cf78259d.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/1881d18f1b5818d46ea23f4c54525576.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/949c53bf1022eb805c32e1343fdefe61.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/bd8404d84fa8efb00fa91bbcd973ee23.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u0442\u043e\u0447\u043a\u0435 <img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/74dfe30ffd7313f2f6074514b646a0e8.jpg\" style=\"display:block;margin: 0 auto;\" \/>, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u043e\u0435 \u0438 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f.<br \/>\n\u041f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c \u0441\u043d\u0438\u0437\u0443 \u0432\u0432\u0435\u0440\u0445 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0445 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 scipy.<br \/>\n\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f <img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/4a8ec747cbeb70aaffc1bb87306d7f2b.jpg\" style=\"display:block;margin: 0 auto;\" \/> \u0438 <img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/b72dd1160e444d006a07533004fbf0ed.jpg\" style=\"display:block;margin: 0 auto;\" \/> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Bounds.<\/p>\n<p><\/p>\n<pre><code class=\"python\">from scipy.optimize import Bounds\nbounds = Bounds ([0, -0.5], [1.0, 2.0])<\/code><\/pre>\n<p><\/p>\n<p>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f <img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/da62ecb9d7faa399babf93a56d2895ff.jpg\" style=\"display:block;margin: 0 auto;\" \/> \u0438 <img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/4f7e89904656f4ef5ef901b72536b20e.jpg\" style=\"display:block;margin: 0 auto;\" \/> \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435:<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/4174e72d3f28a0333d652e9f92f99fca.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u044d\u0442\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 LinearConstraint:<\/p>\n<p><\/p>\n<pre><code class=\"python\">import numpy as np\nfrom scipy.optimize import LinearConstraint\nlinear_constraint = LinearConstraint ([[1, 2], [2, 1]], [-np.inf, 1], [1, 1])<\/code><\/pre>\n<p><\/p>\n<p>\u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0432 \u043c\u0430\u0442\u0440\u0438\u0447\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435:<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/4250c98ab688960dc4d9b5a363b72568.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u042f\u043a\u043e\u0431\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u0443\u044e \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0413\u0435\u0441\u0441\u0435 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u043c \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u043c <img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/853f9b34a6cc08850fbd7b9a7a39d6a5.jpg\" style=\"display:block;margin: 0 auto;\" \/>:<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/6fdcd519b238329ebf2c40c26eff9a4b.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/0832a4b16575e378acd386c54069d381.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442 <code>NonlinearConstraint<\/code>:<\/p>\n<p><\/p>\n<pre><code class=\"python\">from scipy.optimize import NonlinearConstraint\n\ndef cons_f(x):\n     return [x[0]**2 + x[1], x[0]**2 - x[1]]\n\ndef cons_J(x):\n     return [[2*x[0], 1], [2*x[0], -1]]\n\ndef cons_H(x, v):\n     return v[0]*np.array([[2, 0], [0, 0]]) + v[1]*np.array([[2, 0], [0, 0]])\n\nnonlinear_constraint = NonlinearConstraint(cons_f, -np.inf, 1, jac=cons_J, hess=cons_H)<\/code><\/pre>\n<p><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u0435\u043b\u0438\u043a, \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u0432 \u0440\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435:<\/p>\n<p><\/p>\n<pre><code class=\"python\">from scipy.sparse import csc_matrix\n\ndef cons_H_sparse(x, v):\n     return v[0]*csc_matrix([[2, 0], [0, 0]]) + v[1]*csc_matrix([[2, 0], [0, 0]])\n\nnonlinear_constraint = NonlinearConstraint(cons_f, -np.inf, 1,\n                                            jac=cons_J, hess=cons_H_sparse)<\/code><\/pre>\n<p><\/p>\n<p>\u0438\u043b\u0438 \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442 <code>LinearOperator<\/code>:<\/p>\n<p><\/p>\n<pre><code class=\"python\">from scipy.sparse.linalg import LinearOperator\n\ndef cons_H_linear_operator(x, v):\n    def matvec(p):\n        return np.array([p[0]*2*(v[0]+v[1]), 0])\n    return LinearOperator((2, 2), matvec=matvec)\n\nnonlinear_constraint = NonlinearConstraint(cons_f, -np.inf, 1,\n                                jac=cons_J, hess=cons_H_linear_operator)<\/code><\/pre>\n<p><\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0413\u0435\u0441\u0441\u0435 <img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/bdc1436ef4f79209cc4e60d856364927.jpg\" style=\"display:block;margin: 0 auto;\" \/> \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0437\u0430\u0442\u0440\u0430\u0442, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.HessianUpdateStrategy.html#scipy.optimize.HessianUpdateStrategy\"><code>HessianUpdateStrategy<\/code><\/a><\/noindex>. \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438: <code>BFGS<\/code> \u0438 <code>SR1<\/code>.<\/p>\n<p><\/p>\n<pre><code class=\"python\">from scipy.optimize import BFGS\n\nnonlinear_constraint = NonlinearConstraint(cons_f, -np.inf, 1, jac=cons_J, hess=BFGS())<\/code><\/pre>\n<p><\/p>\n<p>\u0413\u0435\u0441\u0441\u0438\u0430\u043d \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0435\u0439:<\/p>\n<p><\/p>\n<pre><code class=\"python\">nonlinear_constraint = NonlinearConstraint (cons_f, -np.inf, 1, jac = cons_J, hess = '2-point')<\/code><\/pre>\n<p><\/p>\n<p>\u041c\u0430\u0442\u0440\u0438\u0446\u0443 \u042f\u043a\u043e\u0431\u0438 \u0434\u043b\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0435\u0439. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0413\u0435\u0441\u0441\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0435\u0439 \u0443\u0436\u0435 \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c. \u0413\u0435\u0441\u0441\u0438\u0430\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0432 \u0432\u0438\u0434\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 HessianUpdateStrategy.<\/p>\n<p><\/p>\n<pre><code class=\"python\">nonlinear_constraint = NonlinearConstraint (cons_f, -np.inf, 1, jac = '2-point', hess = BFGS ())<\/code><\/pre>\n<p><\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p><\/p>\n<pre><code class=\"python\">from scipy.optimize import minimize\nfrom scipy.optimize import rosen, rosen_der, rosen_hess, rosen_hess_prod\n\nx0 = np.array([0.5, 0])\nres = minimize(rosen, x0, method='trust-constr', jac=rosen_der, hess=rosen_hess,\n                constraints=[linear_constraint, nonlinear_constraint],\n                options={'verbose': 1}, bounds=bounds)\nprint(res.x)<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">`gtol` termination condition is satisfied.\nNumber of iterations: 12, function evaluations: 8, CG iterations: 7, optimality: 2.99e-09, constraint violation: 1.11e-16, execution time: 0.033 s.\n[0.41494531 0.17010937]<\/code><\/pre>\n<p><\/p>\n<p>\u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0433\u0435\u0441\u0441\u0438\u0430\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 LinearOperator<\/p>\n<p><\/p>\n<pre><code class=\"python\">def rosen_hess_linop(x):\n    def matvec(p):\n        return rosen_hess_prod(x, p)\n    return LinearOperator((2, 2), matvec=matvec)\n\nres = minimize(rosen, x0, method='trust-constr', jac=rosen_der, hess=rosen_hess_linop,\n                 constraints=[linear_constraint, nonlinear_constraint],\n                 options={'verbose': 1}, bounds=bounds)\n\nprint(res.x)<\/code><\/pre>\n<p><\/p>\n<p>\u0438\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0413\u0435\u0441\u0441\u0438\u0430\u043d\u0430 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>hessp<\/code>:<\/p>\n<p><\/p>\n<pre><code class=\"python\">res = minimize(rosen, x0, method='trust-constr', jac=rosen_der, hessp=rosen_hess_prod,\n                constraints=[linear_constraint, nonlinear_constraint],\n                options={'verbose': 1}, bounds=bounds)\nprint(res.x)<\/code><\/pre>\n<p><\/p>\n<p>\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e, \u043f\u0435\u0440\u0432\u0430\u044f \u0438 \u0432\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0433\u0435\u0441\u0441\u0438\u0430\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>SR1<\/code> (\u043a\u0432\u0430\u0437\u0438-\u041d\u044c\u044e\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f). \u0413\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c\u0438 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<p><\/p>\n<pre><code class=\"python\">from scipy.optimize import SR1\nres = minimize(rosen, x0, method='trust-constr',  jac=\"2-point\", hess=SR1(),\n               constraints=[linear_constraint, nonlinear_constraint],\n               options={'verbose': 1}, bounds=bounds)\nprint(res.x)<\/code><\/pre>\n<p><\/p>\n<h3 id=\"uslovnaya-optimizaciya-methodslsqp\">\u0423\u0441\u043b\u043e\u0432\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f method=&#187;SLSQP&#187;<\/h3>\n<p><\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 SLSQP \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0432\u0438\u0434\u0435:<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/2dfa215eade8e4a3961a3d8421ea0033.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/fc4a8bf0d4e0e79f3c9c5657ef998554.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/423358665513f132d1b718ca96d09d21.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/1e6087fae99c13b377f48cc71d5cbb0d.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>\u0413\u0434\u0435 <img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/edd2594c0fb15277d2c0102360a0c04f.jpg\" style=\"display:block;margin: 0 auto;\" \/> \u0438 <img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/31f49445cb1daa4fd7a438402fb1f2ae.jpg\" style=\"display:block;margin: 0 auto;\" \/> \u2014 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432 \u0438\u043b\u0438 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432. <img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/eb5c03c44c7ac2d6fa3eb103a0332f36.jpg\" style=\"display:block;margin: 0 auto;\" \/> \u2014 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043d\u0438\u0436\u043d\u0438\u0445 \u0438 \u0432\u0435\u0440\u0445\u043d\u0438\u0445 \u0433\u0440\u0430\u043d\u0438\u0446 \u0434\u043b\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p><\/p>\n<p>\u041b\u0438\u043d\u0435\u0439\u043d\u044b\u0435 \u0438 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 <code>type<\/code>, <code>fun<\/code> \u0438 <code>jac<\/code>.<\/p>\n<p><\/p>\n<pre><code class=\"python\">ineq_cons = {'type': 'ineq',\n             'fun': lambda x: np.array ([1 - x [0] - 2 * x [1],\n                                          1 - x [0] ** 2 - x [1],\n                                          1 - x [0] ** 2 + x [1]]),\n             'jac': lambda x: np.array ([[- 1.0, -2.0],\n                                          [-2 * x [0], -1.0],\n                                          [-2 * x [0], 1.0]])\n            }\n\neq_cons = {'type': 'eq',\n           'fun': lambda x: np.array ([2 * x [0] + x [1] - 1]),\n           'jac': lambda x: np.array ([2.0, 1.0])\n          }<\/code><\/pre>\n<p><\/p>\n<p>\u041f\u043e\u0438\u0441\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p><\/p>\n<pre><code class=\"python\">x0 = np.array([0.5, 0])\nres = minimize(rosen, x0, method='SLSQP', jac=rosen_der,\n               constraints=[eq_cons, ineq_cons], options={'ftol': 1e-9, 'disp': True},\n               bounds=bounds)\n\nprint(res.x)<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">Optimization terminated successfully.    (Exit mode 0)\n            Current function value: 0.34271757499419825\n            Iterations: 4\n            Function evaluations: 5\n            Gradient evaluations: 4\n[0.41494475 0.1701105 ]<\/code><\/pre>\n<p><\/p>\n<h3 id=\"primer-optimizacii\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438<\/h3>\n<p><\/p>\n<p>\u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c \u043a \u043f\u044f\u0442\u043e\u043c\u0443 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0443\u043a\u043b\u0430\u0434\u0443, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u0435\u0431-\u0441\u0442\u0443\u0434\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442 \u043d\u0430\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u043d\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0434\u043e\u0445\u043e\u0434. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0435\u0431\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u043e\u043c \u0433\u0430\u043b\u0435\u0440\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0440\u0438 \u0432\u0438\u0434\u0430 \u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0438: <\/p>\n<p><\/p>\n<ul>\n<li>x0 \u2014 \u043f\u0440\u043e\u0434\u0430\u044e\u0449\u0438\u0435 \u043b\u044d\u043d\u0434\u0438\u043d\u0433\u0438, \u043e\u0442 10 \u0442.\u0440.<\/li>\n<li>x1 \u2014 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u0430\u0439\u0442\u044b, \u043e\u0442 20 \u0442.\u0440.<\/li>\n<li>x2 \u2014 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u044b, \u043e\u0442 30 \u0442.\u0440. <\/li>\n<\/ul>\n<p><\/p>\n<p>\u041d\u0430\u0448 \u0434\u0440\u0443\u0436\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u0438\u0432 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0434\u0436\u0443\u043d\u043e\u0432, \u0434\u0432\u0443\u0445 \u043c\u0438\u0434\u043b\u043e\u0432 \u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0435\u043d\u044c\u043e\u0440\u0430. \u0424\u043e\u043d\u0434 \u0438\u0445 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043c\u0435\u0441\u044f\u0446:<\/p>\n<p><\/p>\n<ul>\n<li>\u0434\u0436\u0443\u043d\u044b: <code>4 * 150 = 600 \u0447\u0435\u043b * \u0447\u0430\u0441<\/code>,<\/li>\n<li>\u043c\u0438\u0434\u043b\u044b: <code>2 * 150 = 300 \u0447\u0435\u043b * \u0447\u0430\u0441<\/code>,<\/li>\n<li>\u0441\u0435\u043d\u044c\u043e\u0440: <code>150 \u0447\u0435\u043b * \u0447\u0430\u0441<\/code>. <\/li>\n<\/ul>\n<p><\/p>\n<p>\u041f\u0443\u0441\u0442\u044c \u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u0434\u0435\u043f\u043b\u043e\u0439 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u0442\u0438\u043f\u0430 (x0, x1, x2) \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0439\u0441\u044f \u0434\u0436\u0443\u043d\u0438\u043e\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c (10, 20, 30) \u0447\u0430\u0441\u043e\u0432, \u043c\u0438\u0434\u043b \u2014 (7, 15, 20), \u0441\u0435\u043d\u044c\u043e\u0440 \u2014 (5, 10, 15) \u0447\u0430\u0441\u043e\u0432 \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0432\u043e\u0435\u0439 \u0436\u0438\u0437\u043d\u0438. <\/p>\n<p><\/p>\n<p>\u041a\u0430\u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0443, \u043d\u0430\u043c \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u0443\u044e \u043f\u0440\u0438\u0431\u044b\u043b\u044c. \u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u043a \u0443\u0441\u043f\u0435\u0445\u0443 \u2014 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>value<\/code> \u043a\u0430\u043a \u0441\u0443\u043c\u043c\u0443 \u0434\u043e\u0445\u043e\u0434\u043e\u0432 \u043e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0437\u0430 \u043c\u0435\u0441\u044f\u0446 \u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0438:<\/p>\n<p><\/p>\n<pre><code class=\"python\">def value(x):\n    return - 10*x[0] - 20*x[1] - 30*x[2]<\/code><\/pre>\n<p><\/p>\n<p>\u042d\u0442\u043e \u043d\u0435 \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430 \u0446\u0435\u043b\u0435\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u043c \u0437\u043d\u0430\u043a\u043e\u043c. <\/p>\n<p><\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u2014 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438\u043c \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0430\u043c \u0438 \u0432\u0432\u043e\u0434\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0444\u043e\u043d\u0434 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438: <\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/9fa0005f1d7faef67d84b323e4259ced.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>\u0427\u0442\u043e \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e: <\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438\" src=\"\/wp-content\/uploads\/2019\/04\/4377fe4cdea4eabd4449e7f0dc0821b5.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<pre><code class=\"python\">ineq_cons = {'type': 'ineq',\n             'fun': lambda x: np.array ([600 - 10 * x [0] - 20 * x [1] - 30 * x[2],\n                                         300 - 7  * x [0] - 15 * x [1] - 20 * x[2],\n                                         150 - 5  * x [0] - 10 * x [1] - 15 * x[2]])\n            }<\/code><\/pre>\n<p><\/p>\n<p>\u0424\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u2014 \u0432\u044b\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c:<\/p>\n<p><\/p>\n<pre><code class=\"python\">bnds = Bounds ([0, 0, 0], [np.inf, np.inf, np.inf])<\/code><\/pre>\n<p><\/p>\n<p>\u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0441\u0430\u043c\u043e\u0435 \u0440\u0430\u0434\u0443\u0436\u043d\u043e\u0435 \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u0435 \u2014 \u0438\u0437-\u0437\u0430 \u043d\u0438\u0437\u043a\u043e\u0439 \u0446\u0435\u043d\u044b \u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043a \u043d\u0430\u043c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438\u0437 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0430\u043c\u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0435\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043c\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0438, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 <code>scipy.optimize<\/code>: <\/p>\n<p><\/p>\n<pre><code class=\"python\">x0 = np.array([10, 10, 10])\nres = minimize(value, x0, method='SLSQP', constraints=ineq_cons, bounds=bnds)\nprint(res.x)<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">[7.85714286 5.71428571 3.57142857]<\/code><\/pre>\n<p><\/p>\n<p>\u041d\u0435\u0441\u0442\u0440\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0433\u043b\u0438\u043c \u0434\u043e \u0446\u0435\u043b\u044b\u0445 \u0438 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043c\u0435\u0441\u044f\u0447\u043d\u0443\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0433\u0440\u0435\u0431\u0446\u043e\u0432 \u043f\u0440\u0438 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0438 <code>x = (8, 6, 3)<\/code> :<\/p>\n<p><\/p>\n<ul>\n<li>\u0434\u0436\u0443\u043d\u044b: <code>8 * 10 + 6 * 20 + 3 * 30 = 290 \u0447\u0435\u043b * \u0447\u0430\u0441<\/code>;<\/li>\n<li>\u043c\u0438\u0434\u043b\u044b: <code>8 * 7 + 6 * 15 + 3 * 20 = 206 \u0447\u0435\u043b * \u0447\u0430\u0441<\/code>;<\/li>\n<li>\u0441\u0435\u043d\u044c\u043e\u0440: <code>8 * 5 + 6 * 10 + 3 * 15 = 145 \u0447\u0435\u043b * \u0447\u0430\u0441<\/code>. <\/li>\n<\/ul>\n<p><\/p>\n<p>\u0412\u044b\u0432\u043e\u0434: \u0447\u0442\u043e\u0431\u044b \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u0441\u0432\u043e\u0439 \u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c, \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u043c\u0435\u0441\u044f\u0446 \u043f\u043e 8 \u043b\u044d\u043d\u0434\u0438\u043d\u0433\u043e\u0432, 6 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0441\u0430\u0439\u0442\u043e\u0432 \u0438 3 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430. \u0421\u0435\u043d\u044c\u043e\u0440 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0430\u0445\u0430\u0442\u044c \u043d\u0435 \u043e\u0442\u0440\u044b\u0432\u0430\u044f\u0441\u044c \u043e\u0442 \u0441\u0442\u0430\u043d\u043a\u0430, \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u0438\u0434\u043b\u043e\u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 2\/3, \u0434\u0436\u0443\u043d\u043e\u0432 \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b.<\/p>\n<p><\/p>\n<h3 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p><\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0435\u043c\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0430\u043a\u0435\u0442\u043e\u043c <code>scipy.optimize<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u041b\u0438\u0447\u043d\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <code>scipy<\/code> \u0447\u0438\u0441\u0442\u043e \u0432 \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0446\u0435\u043b\u044f\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u043e\u0441\u0438\u0442 \u0442\u0430\u043a\u043e\u0439 \u0448\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440. <\/p>\n<p><\/p>\n<p>\u041c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438 \u0438 \u0432\u0438\u043d\u0440\u0430\u0440\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u043d\u0438\u0433\u0435 \u0418.\u041b.\u0410\u043a\u0443\u043b\u0438\u0447\u0430 &#171;\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u0445&#187;. \u0411\u043e\u043b\u0435\u0435 \u0445\u0430\u0440\u0434\u043a\u043e\u0440\u043d\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 <code>scipy.optimize<\/code> \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f 3D \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u043e \u043d\u0430\u0431\u043e\u0440\u0443 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 (<noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/228525\/\">\u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0445\u0430\u0431\u0440\u0435<\/a><\/noindex>) \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 <noindex><a rel=\"nofollow\" href=\"https:\/\/scipy-cookbook.readthedocs.io\/items\/bundle_adjustment.html\">scipy-cookbook<\/a><\/noindex>.<\/p>\n<p><\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u2014 <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/tutorial\/optimize.html\">docs.scipy.org<\/a><\/noindex>, \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0435 \u043f\u043e\u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u0438\u0442\u044c \u0432 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u044d\u0442\u043e\u0433\u043e \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432 <code>scipy<\/code> \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043d\u0430 <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/balezz\/scipy-tutorial\">GitHub<\/a><\/noindex>.<\/p>\n<p><\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/users\/mephistopheies\/\" class=\"user_link\">mephistopheies<\/a><\/noindex> \u0437\u0430 \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/ods\/blog\/448054\/\">habr.com<\/a><\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>SciPy (\u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0430\u0439 \u043f\u0430\u0439) \u2014 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 numpy \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u043a\u0435\u0442, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u044f \u0442\u0430\u043a\u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 C \u0438 Fortran. \u0421 SciPy \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0435\u0430\u043d\u0441 Python \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u0430\u043a MATLAB, IDL, Octave, R \u0438\u043b\u0438 SciLab. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0435\u043c\u044b \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":23663,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-31779","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-novosti-interneta"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"SciPy (\u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0430\u0439 \u043f\u0430\u0439) \u2014 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 numpy \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u043a\u0435\u0442, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u044f \u0442\u0430\u043a\u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 C \u0438 Fortran. \u0421 SciPy \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0435\u0430\u043d\u0441 Python \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u0430\u043a MATLAB, IDL, Octave, R \u0438\u043b\u0438 SciLab. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0435\u043c\u044b \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/de\/blog\/novosti-interneta\/scipy-optimizatsiya-s-usloviyami\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"de_DE\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"SciPy (\u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0430\u0439 \u043f\u0430\u0439) \u2014 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 numpy \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u043a\u0435\u0442, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u044f \u0442\u0430\u043a\u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 C \u0438 Fortran. \u0421 SciPy \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0435\u0430\u043d\u0441 Python \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u0430\u043a MATLAB, IDL, Octave, R \u0438\u043b\u0438 SciLab. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0435\u043c\u044b \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/de\/blog\/novosti-interneta\/scipy-optimizatsiya-s-usloviyami\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T18:43:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T18:43:00+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47SciPy, Optimierung mit Bedingungen | ProHoster","description":"SciPy (ausgesprochen wie \u201esai pai\u201c) ist ein mathematisches Paket, das auf NumPy basiert und auch Bibliotheken in C und Fortran umfasst. Mit SciPy wird eine interaktive Python-Sitzung zu einer vollwertigen Umgebung f\u00fcr Datenverarbeitung, \u00e4hnlich wie MATLAB, IDL, Octave, R oder SciLab. In diesem Artikel betrachten wir grundlegende Techniken der mathematischen Programmierung \u2013 die L\u00f6sung von Problemen der Bedingungsoptimierung f\u00fcr","canonical_url":"https:\/\/prohoster.info\/de\/blog\/novosti-interneta\/scipy-optimizatsiya-s-usloviyami","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"de_DE","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47SciPy, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438 | ProHoster","og:description":"SciPy (\u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0430\u0439 \u043f\u0430\u0439) \u2014 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 numpy \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u043a\u0435\u0442, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u044f \u0442\u0430\u043a\u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 C \u0438 Fortran. \u0421 SciPy \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0435\u0430\u043d\u0441 Python \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u0430\u043a MATLAB, IDL, Octave, R \u0438\u043b\u0438 SciLab. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0435\u043c\u044b \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f","og:url":"https:\/\/prohoster.info\/de\/blog\/novosti-interneta\/scipy-optimizatsiya-s-usloviyami","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T18:43:00+00:00","article:modified_time":"2019-10-31T18:43:00+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"31779","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-21 07:47:23","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 03:11:22","updated":"2026-01-21 07:47:23"},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/posts\/31779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/comments?post=31779"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/posts\/31779\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/media\/23663"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/media?parent=31779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/categories?post=31779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/tags?post=31779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}