casadi / casadi

CasADi is a symbolic framework for numeric optimization implementing automatic differentiation in forward and reverse modes on sparse matrix-valued computational graphs. It supports self-contained C-code generation and interfaces state-of-the-art codes such as SUNDIALS, IPOPT etc. It can be used from C++, Python or Matlab/Octave.
http://casadi.org
GNU Lesser General Public License v3.0
1.67k stars 370 forks source link

Adjoint sensitivities of ImplicitFunction wrong #558

Closed jgillis closed 11 years ago

jgillis commented 11 years ago

The following code shows a sensitivity of 0, while it should be non-zero.

from casadi import *

x = ssym("x")
y = ssym("y")
f=SXFunction([y,x],[x-arcsin(y),sqrt(x),y**2])
f.init()
solver=NewtonImplicitSolver(f)
solver.setOption("linear_solver",CSparse)
solver.init()
solver.adjSeed(2).set(1)
solver.input().set(0.2)
solver.output().set(0.1)
solver.evaluate(0,1)

print solver.adjSens(0)
jaeandersson commented 11 years ago

Will probably be resolved by #669.