I'm trying to use ADiGator to differentiate a function that computes inside the roots of a 6th order polynomial (with real coefficients). Since no analytical solutions exist, I can only find the roots numerically, by means of the Matlab roots function. However, I noticed that the roots function has not been overloaded.
My main question is: is it possible to differentiate the Matlab roots function?
If so, is this function missing in the @cada folder because still not overloaded yet?
Thanks in advance for your help! :)
Cheers,
Nicola.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The roots function is not overloaded, I did, however, sketch out what I believe to be the analytic derivative, but I didn't spend much time proving/testing. I think if you consider
p = sum_(i=1)^n a_i*y^(i-1)
then at the roots, y = x(a),
p = p(a,x(a)) = 0,
where a is a vector, x is a scalar equal to one of the roots, then
dp/da + (dp/dx)*(dx/da) = 0
which implies
dx/da = -(dp/dx)^-1 * (dp/da),
so given the value of each root, one can presumably do the above to get its derivative wrt the polynomial coefficients? This would, however, take a bit of work to overload in adigator as it has a fairly different form from most of the other overloaded routines. It would also need to be tested, presumably with a finite difference, which seems to be a pain as the roots() function seems to re-order the output when perturbed.
Matt W.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello!
I'm trying to use ADiGator to differentiate a function that computes inside the roots of a 6th order polynomial (with real coefficients). Since no analytical solutions exist, I can only find the roots numerically, by means of the Matlab roots function. However, I noticed that the roots function has not been overloaded.
My main question is: is it possible to differentiate the Matlab roots function?
If so, is this function missing in the @cada folder because still not overloaded yet?
Thanks in advance for your help! :)
Cheers,
Nicola.
Nicola,
The roots function is not overloaded, I did, however, sketch out what I believe to be the analytic derivative, but I didn't spend much time proving/testing. I think if you consider
then at the roots, y = x(a),
where a is a vector, x is a scalar equal to one of the roots, then
which implies
so given the value of each root, one can presumably do the above to get its derivative wrt the polynomial coefficients? This would, however, take a bit of work to overload in adigator as it has a fairly different form from most of the other overloaded routines. It would also need to be tested, presumably with a finite difference, which seems to be a pain as the roots() function seems to re-order the output when perturbed.
Matt W.