Menu

ADiGator and roots function

Help
nix87
2017-04-05
2017-04-05
  • nix87

    nix87 - 2017-04-05

    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.

     
  • Matthew J. Weinstein

    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

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.