Analytic Jacobian Error

7 views
Skip to first unread message

Gideon Simpson

unread,
Jun 26, 2015, 1:14:01 PM6/26/15
to scikits-b...@googlegroups.com
I find, from time to time, that I get the following kind of error when using analytic Jacobians:

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scikits/bvp_solver/ProblemDefinition.pyc in test(self, test_solution)
    468                     if not  (numpy.round(bcB_derivative_calc - bcB_derivative_num, places) == 0).all():
    469                         raise ValueError("analytical derivative matrix for the right boundary condition does not match numerical derivative matrix.\n Analytical is:\n" + str(bcB_derivative_calc)
--> 470                                      + "\n Numerical is:\n" + str(bcB_derivative_num))
    471 
    472                     if not  (numpy.round(bcA_param_derivative_calc - bcA_param_derivative_num, places) == 0).all():

ValueError: analytical derivative matrix for the right boundary condition does not match numerical derivative matrix.
 Analytical is:
[[ 0.01457356  1.          0.          0.          0.        ]
 [ 0.          0.          0.01        1.          0.        ]
 [ 0.          0.          0.          0.          1.        ]]
 Numerical is:
[[  1.45735600e-02   1.00000000e+00   0.00000000e+00   0.00000000e+00
    7.43352591e-05]
 [  0.00000000e+00   0.00000000e+00   1.00000000e-02   1.00000000e+00
    0.00000000e+00]
 [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
    9.99999994e-01]]

It looks like it's getting a numerical approximation which is reasonable, but because it's not exactly equal, the package doesn't like it.  If I turn off analytic Jacobians, it goes away.  Any way around this?
Reply all
Reply to author
Forward
0 new messages