See my gist for what I'm trying to achieve.
I'm using NLsolve to find the cartesian coordinates given curvilinear coordinates and a function that returns curvilinear coordinates given cartesian coordinates (the reciprocal function is not usually easy / possible to write down). I want to be able to perform multiple AD passes through the solver function as though I had written down the complicated forward transform. I hope that makes sense - the gist should help.
I can't think of a good way of manipulating the values inside a Dual to acheive the desired outcome. Is there a good way?
See my gist for what I'm trying to achieve.
I'm using NLsolve to find the cartesian coordinates given curvilinear coordinates and a function that returns curvilinear coordinates given cartesian coordinates (the reciprocal function is not usually easy / possible to write down). I want to be able to perform multiple AD passes through the solver function as though I had written down the complicated forward transform. I hope that makes sense - the gist should help.
I can't think of a good way of manipulating the values inside a Dual to acheive the desired outcome. Is there a good way?