NaN detected for output jac_g_x

1,055 views
Skip to first unread message

Nakul Randad

unread,
Jan 14, 2022, 2:50:41 AM1/14/22
to CasADi
Any suggestions on interpreting this warning message and solutions to the same -
CasADi -  WARNING("solver:nlp_jac_g failed: NaN detected for output jac_g_x, at nonzero index 1 (row 1, col 1).") [.../casadi/core/oracle_function.cpp:265]
Error evaluating Jacobian of equality constraints at user provided starting point.
  No scaling factors for equality constraints computed!
CasADi -  WARNING("solver:nlp_jac_g failed: NaN detected for output jac_g_x, at nonzero index 1 (row 1, col 1).") [.../casadi/core/oracle_function.cpp:265]

Also, I have encountered an error message -
Error in Opti::solve [OptiNode] at .../casadi/core/optistack.cpp:159:
.../casadi/core/optistack_internal.cpp:999: Assertion "return_success(accept_limit)" failed:
Solver failed. You may use opti.debug.value to investigate the latest values of variables. return_status is 'Invalid_Number_Detected'

Any sort of help is highly appreciated.

Thanks,
Nakul

Joel Andersson

unread,
Jan 20, 2022, 4:54:49 PM1/20/22
to CasADi
The Jacobian of the constraint function is NaN at the initial guess.
Maybe your equations contain something like sqrt(x) which has a undefined derivative at x=0?

Joel
Reply all
Reply to author
Forward
0 new messages