# How to perform local sensitivity analysis for partial differential equations

I am looking for a way to do local sensitivity analysis for PDEs, preferably in Python.

I get the impression that discretizing the equation then treating it as an ODE could work; however, would that be computationally tractable?

Wouldn't there be an efficiency gain in keeping the PDE structure rather than reverting to a (hard) ODE? Especially, allowing adaptive spatial grids (as in this paper that does adjoint sensitivity with adaptive mesh) seems like it would be a huge boost. Is this intuition correct? If yes, is there any prior existing implementation of PDE-specific sensitivity analysis, or should I tweak an ODE one or write from scratch?

• a procedure that does local sensitivity analysis for any PDE is a very tall order. can you give more details about what your particular problems may look like? the "ADDA" approach taken by Li and Petzold is interesting, but there is little in the way of a formal convergence proof. I don't believe their scheme is applicable to more general, non-linear PDEs. – GoHokies Jul 9 at 11:52
• @GoHokies I'm trying to build a function approximator / neural-network equivalent in the vein of Neural ODEs so I get to define what kind of equation the system is using. I was hoping to replicate the dynamics of a residual convolutional neural net with, for example, $\partial f_{t} = tanh(A\partial f_{xx} + B\partial f_{x} + Cf)$ – TVN Jul 16 at 13:54