It's state-dependent control flow that's an issue. function f(u) z = 0.0 while z < 10.0 z += u u += z^2 end return u end What's the program for computing the derivative? Automatic differentiation would give you: function f(_u) u = (_u,1.0) # seed the input derivative for the jvp in direction of basis e1 z = (0.0,0.0) while z[1] &...


The first step is to transform the second order equation to a set of two coupled first order equations. Define an auxiliary function $u(T) = \frac{dr(T)}{dT}$. This results in the system $$\begin{align} \frac{du}{dT} &= k-(1-\frac{5}{r})(3+\frac{2}{r^2}) \\ \frac{dr}{dT} &= u\\ \frac{d\phi}{dT} & = \frac{1}{r^2} \end{align} $$ Now you have a ...


The paper you linked answers the question. Autodiff (or hand differentiation) can differentiate branched program statements. For example, limiters, entropy fixes branching in flux statements, and the like. It can be rather helpful for min max statements as well. You can see an example below: Function(Vn_bar, a_bar, ul, cl, ur, cr) lambda1 = abs(...


Given that you are using center difference formula to to get second order derivatives in your domain. The common practice at the ends is to use forward and backward difference formula ( start and end ) . Again this strictly depends on the nature of your problem and what you consider as reasonable approximation


This is a system of first order differential equations, not second order. It models the geodesics in Schwarzchield geometry. In other words, this system represents the general relativistic motion of a test particle in static spherically symmetric gravitational field. In general, there is a third equation for how coordinate time is related to proper time. ...


Ok, here is the answer promised in the comment section. I thought I would have more time to elaborate, but as usual, that was not the case, so I'll just add some thoughts First of all, there is no obvious definition of the antiderivative matrix $A$, because the derivative matrix $D$ is one order short to full rank. This is akin to the fact that he ...


One useful application is the calculation of antiderivatives of nonelementary integrable functions. They are obviously only approximations. Error Integral: $\text{erf}(\tilde{x})=\int e^{-x^2}\,dx$ Trigonometric Integral: $\text{si}(\tilde{x})=\int \frac{\sin x}{x}\,dx$


Antiderivatives are considered through numerical integration. The following antiderivative $$\int f(x)\, dx = G(x) + C\, ,$$ can be rewritten as $$\frac{d G(x)}{dx} = f(x)\, .$$ And then solved numerically.


An automatic differentiation program could be refactored to output a symbolic representation, instead of a numerical one. Therefore the 2 forms would be equivalent. Please see the non-accepted answer here: https://stackoverflow.com/a/55607008/104910

Only top voted, non community-wiki answers of a minimum length are eligible