Estimate the Jacobian of a vector-valued function f:Rn→Rm at a point, one column at a time, with centered finite differences.
Implement solve(f, x, h=1e-5).
Returns. Return an m×n NumPy array whose entry (i,j) approximates ∂fi/∂xj.
Example 1
Input:
solve(lambda z: np.array([z[0]**2, z[0]*z[1]]), [1.0, 2.0])
Output:
[[2.0, 0.0], [2.0, 1.0]]
Example 2
Input:
solve(lambda z: np.array([np.sin(z[0])]), [0.0])
Output:
[[1.0]]
No results yet
Run your code to check it against the examples, or submit to run every test.