Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fd(func, x_to_diff, x_to_lambdify):
- fdx = func.diff(x_to_diff)
- return lambdify(x_to_lambdify, fdx, 'numpy')
- def gradient(func, x1, x2, point):
- fdx1 = fd(func, x1, (x1, x2))
- fdx2 = fd(func, x2, (x1, x2))
- return [fdx1(point[0], point[1]), fdx2(point[0], point[1])]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement