3 Non-linear Dynamics in Accelerators
89
3.7.6.3 Automatic Differentiation: The Application
Of course (q, 0) is just the real number q and we define the “real” and the
“differential part”:
q 0 = R(q 0 , q 1 ) and q 1 = D(q 0 , q 1 )
(3.143)
For a function f (x) we have (without proof, see e.g. [21]):
D[f (x + d)] = D[f ((x, 0) + (0, 1))] = f
(x)
(3.144)
We use an example instead to demonstrate this with the function:
f (x) = x
2
+
1
x
(3.145)
Using school calculus we have for the derivative:
f
(x) = 2x −
1
x 2 and for x = 2 we get : f (2) =
9
2
, f
(2) =
15
4
(3.146)
We now apply Automatic Differentiation instead. For the variable x in (3.145)
we substitute x → (x, 1) = (2, 1) and using our rules:
f [(2, 1)] = (x, 1)
2
+ (x, 1)
−1
= (2, 1)
2
+ (2, 1)
−1
= (4, 4) + (
1
2
, −
1
4
) = (
9
2
,
15
4
) = (f (2), f
(2))
we arrive at a vector containing the differentials at x = 2. The computation of
derivatives becomes an algebraic problem, without need for small numbers. No
numerical difficulties are expected and the differential is exact.
3.7.6.4 Automatic Differentiation: Higher Orders
To obtain higher orders, we need higher derivatives, i.e. larger dimension for our
vectors:
1. The pair (q 0 , 1), becomes a vector of length N and with equivalent rules:
(q 0 , 1) ⇒ (q 0 , 1, 0, 0, . . . , 0)
(3.147)
(q 0 , q 1 , q 2 , . . . q N ) + (r 0 , r 1 , r 2 , . . . r N ) = (s 0 , s 1 , s 2 , . . . s N )
(3.148)
Précédent

- 99/867

Suivant