scipyHow to write a Jacobian function for optimize.minimize


Syntax

  1. import numpy as np
  2. from scipy.optimize import _minimize
  3. from scipy import special
  4. import matplotlib.pyplot as plt

Remarks

Note the underscore before 'minimize' when importing from scipy.optimize; '_minimize' Also, i tested the functions from this link before doing this section, and found I had less trouble/it worked faster, if I imported 'special' separately. The Rosenbrock function on the linked page was incorrect - you have to configure the colorbar first; I've posted alternate code but think it could be better.

Further examples to come.

See here for an explanation of Hessian Matrix