4
$\begingroup$

I have a linear system $$Ax=b$$ which I'm solving approximately, and I need to take the frechet derivative of x with respect to z. Were I solving the problem exactly (either analytically or to machine 0) I'd simply say $$\frac{dx}{dz}\vec{v} = \frac{d A^{-1}b}{dz}\vec{v} = \left(\frac{dA}{dz}A^{-1}\frac{dA}{dz}b + A^{-1}\frac{db}{dz}\right)\vec{v}$$ Since I am not solving the system exactly (2 orders of accuracy say), I thought the best way to get the sensitivity, would be a complex perturbation to the linear system. I.e, solve the linear system, but where it is: $$A(z+i\epsilon {v})x = b(z+i\epsilon\vec{v})$$ And I could then take the imaginary part of x. Will this work the way I want it to? Then if I wanted the adjoint differentiation, of the linear solve, would I give a complex perturbation to the matrix and transpose it?

This is related to my previous question posted here: Derivatives of Approximate Matrix inverses

$\endgroup$
  • 1
    $\begingroup$ It would be useful to have more detail on how you are actually solving the system. The value of the derivative will surely depend on that. $\endgroup$ – Federico Poloni Jul 4 at 9:31
  • $\begingroup$ Also, have you tried automatic differentiation? $\endgroup$ – Federico Poloni Jul 4 at 9:31
  • $\begingroup$ I'm solving it approximately with a point block Jacobi iteration. AD is impractical, and not what I need, as I just need the derivative of the linear system unknown multiplied by a vector. Which is why I suggested the vector perturbation to the linear system solve. $\endgroup$ – EMP Jul 4 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.