BE Department Beams 33 Laurent Deniau, CERN BE/ABP, 1211 Geneva, - - PDF document

be
SMART_READER_LITE
LIVE PREVIEW

BE Department Beams 33 Laurent Deniau, CERN BE/ABP, 1211 Geneva, - - PDF document

Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch Quadrupole example BE Department Beams 33 Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch Quad: Quadrupole example x k 1 > 0 y z x k 1 < 0 y z


slide-1
SLIDE 1

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Quadrupole example

33

slide-2
SLIDE 2

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Quadrupole example

33

Quad: x y z x y z k1 > 0 k1 < 0

slide-3
SLIDE 3

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Quadrupole example

33

Quad: x y z x y z k1 > 0 k1 < 0 Skew Quad: x y z x y z k1s > 0 k1s < 0 x’ y’ x’ y’

slide-4
SLIDE 4

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Quadrupole example

33

k1 = ∂By ∂x B−1

ρ

k1s = 1 2 ✓∂Bx ∂x − ∂By ∂y ◆ B−1

ρ

<latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit>

Quad: x y z x y z k1 > 0 k1 < 0 Skew Quad: x y z x y z k1s > 0 k1s < 0 x’ y’ x’ y’

slide-5
SLIDE 5

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Quadrupole example

33

k1 = ∂By ∂x B−1

ρ

k1s = 1 2 ✓∂Bx ∂x − ∂By ∂y ◆ B−1

ρ

<latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit>

Quad: x y z x y z k1 > 0 k1 < 0 x,y: magnet frame x’,y’: map frame Skew Quad: x y z x y z k1s > 0 k1s < 0 x’ y’ x’ y’

slide-6
SLIDE 6

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Quadrupole example

33

k1 = ∂By ∂x B−1

ρ

k1s = 1 2 ✓∂Bx ∂x − ∂By ∂y ◆ B−1

ρ

<latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit>

Quad: x y z x y z k1 > 0 k1 < 0 x,y: magnet frame x’,y’: map frame Skew Quad: x y z x y z k1s > 0 k1s < 0 x’ y’ x’ y’ Rz(ψ)

<latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit>

Quad tilt = x y z k1 > 0 k1 < 0 x y z x’ y’ x’ y’ − π 4

slide-7
SLIDE 7

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Quadrupole example

33

k1 = ∂By ∂x B−1

ρ

k1s = 1 2 ✓∂Bx ∂x − ∂By ∂y ◆ B−1

ρ

<latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit>

Quad: x y z x y z k1 > 0 k1 < 0 x,y: magnet frame x’,y’: map frame Skew Quad: x y z x y z k1s > 0 k1s < 0 x’ y’ x’ y’

Aperture checks are in tilted frame.

Rz(ψ)

<latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit>

Quad tilt = x y z k1 > 0 k1 < 0 x y z x’ y’ x’ y’ − π 4

slide-8
SLIDE 8

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Quadrupole example

33

k1 = ∂By ∂x B−1

ρ

k1s = 1 2 ✓∂Bx ∂x − ∂By ∂y ◆ B−1

ρ

<latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit>

Quad: x y z x y z k1 > 0 k1 < 0 x,y: magnet frame x’,y’: map frame Skew Quad: x y z x y z k1s > 0 k1s < 0 x’ y’ x’ y’

Aperture checks are in tilted frame.

Rz(ψ)

<latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit><latexit sha1_base64="(nul)">(nul)</latexit>

Quad tilt = x y z k1 > 0 k1 < 0 x y z x’ y’ x’ y’ − π 4

TKT model tilts “thick” map if k1s≠0

slide-9
SLIDE 9

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Survey: sbend tilted by 90º — dphi 15º dy 0.1m

34

slide-10
SLIDE 10

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Survey: sbend tilted by 90º — dphi 15º dy 0.1m

34

x, y with misalignments, xr, yr reference frame without misalignment

slide-11
SLIDE 11

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Survey: sbend tilted by 90º — dphi 15º dy 0.1m

34

x, y with misalignments, xr, yr reference frame without misalignment nslice = 3

slide-12
SLIDE 12

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Survey: sbend tilted by 90º — dphi 15º dy 0.1m

34 reference frame

W

s y x x1

x2 x′

1

x′

2

R T V ¯ T

x, y with misalignments, xr, yr reference frame without misalignment nslice = 3

slide-13
SLIDE 13

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Survey: sbend tilted by 90º — dphi 15º dy 0.1m

34 reference frame

W

s y x x1

x2 x′

1

x′

2

R T V ¯ T

x, y with misalignments, xr, yr reference frame without misalignment nslice = 3

slide-14
SLIDE 14

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch 35

DA Package

slide-15
SLIDE 15

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

slide-16
SLIDE 16

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra

slide-17
SLIDE 17

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ.

slide-18
SLIDE 18

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

slide-19
SLIDE 19

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

slide-20
SLIDE 20

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

slide-21
SLIDE 21

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

convergence of the remainder (i.e. truncation error):

lim

n→∞ Rn f (x; a) = lim n→∞ f(x) − Tn f (x; a) = 0

slide-22
SLIDE 22

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

convergence of the remainder (i.e. truncation error):

lim

n→∞ Rn f (x; a) = lim n→∞ f(x) − Tn f (x; a) = 0

f(x) is an analytic function, is a polynomial approximation

nearby a with radius of convergence h: Tn

f (x; a)

min

h>0 lim n→∞ Rn f (a ± h; a) ≠ 0.

slide-23
SLIDE 23

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

convergence of the remainder (i.e. truncation error):

lim

n→∞ Rn f (x; a) = lim n→∞ f(x) − Tn f (x; a) = 0

f(x) is an analytic function, is a polynomial approximation

nearby a with radius of convergence h: Tn

f (x; a)

min

h>0 lim n→∞ Rn f (a ± h; a) ≠ 0.

2 variables (x,y) at order 2 nearby (a,b):

T2

f (x, y; a, b) = f(a, b) + ∂f

∂x

(a,b)

(x − a) + ∂f ∂y

(a,b)

(y − b) + …

slide-24
SLIDE 24

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

convergence of the remainder (i.e. truncation error):

lim

n→∞ Rn f (x; a) = lim n→∞ f(x) − Tn f (x; a) = 0

f(x) is an analytic function, is a polynomial approximation

nearby a with radius of convergence h: Tn

f (x; a)

min

h>0 lim n→∞ Rn f (a ± h; a) ≠ 0.

2 variables (x,y) at order 2 nearby (a,b):

T2

f (x, y; a, b) = f(a, b) + ∂f

∂x

(a,b)

(x − a) + ∂f ∂y

(a,b)

(y − b) + … = f (1)

(a,b)(x − a, y − b)

slide-25
SLIDE 25

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

convergence of the remainder (i.e. truncation error):

lim

n→∞ Rn f (x; a) = lim n→∞ f(x) − Tn f (x; a) = 0

f(x) is an analytic function, is a polynomial approximation

nearby a with radius of convergence h: Tn

f (x; a)

min

h>0 lim n→∞ Rn f (a ± h; a) ≠ 0.

2 variables (x,y) at order 2 nearby (a,b):

T2

f (x, y; a, b) = f(a, b) + ∂f

∂x

(a,b)

(x − a) + ∂f ∂y

(a,b)

(y − b) + … = f (1)

(a,b)(x − a, y − b)

+ 1 2! ∂2f ∂x2

(a,b)

(x − a)2 + 2 ∂2f ∂x∂y

(a,b)

(x − a)(y − b) + ∂2f ∂y2

(a,b)

(y − b)2

slide-26
SLIDE 26

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

convergence of the remainder (i.e. truncation error):

lim

n→∞ Rn f (x; a) = lim n→∞ f(x) − Tn f (x; a) = 0

f(x) is an analytic function, is a polynomial approximation

nearby a with radius of convergence h: Tn

f (x; a)

min

h>0 lim n→∞ Rn f (a ± h; a) ≠ 0.

2 variables (x,y) at order 2 nearby (a,b):

T2

f (x, y; a, b) = f(a, b) + ∂f

∂x

(a,b)

(x − a) + ∂f ∂y

(a,b)

(y − b) + … = f (1)

(a,b)(x − a, y − b)

+ 1 2! ∂2f ∂x2

(a,b)

(x − a)2 + 2 ∂2f ∂x∂y

(a,b)

(x − a)(y − b) + ∂2f ∂y2

(a,b)

(y − b)2 = f (2)

(a,b)(x − a, y − b)

slide-27
SLIDE 27

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

convergence of the remainder (i.e. truncation error):

lim

n→∞ Rn f (x; a) = lim n→∞ f(x) − Tn f (x; a) = 0

f(x) is an analytic function, is a polynomial approximation

nearby a with radius of convergence h: Tn

f (x; a)

min

h>0 lim n→∞ Rn f (a ± h; a) ≠ 0.

2 variables (x,y) at order 2 nearby (a,b):

T2

f (x, y; a, b) = f(a, b) + ∂f

∂x

(a,b)

(x − a) + ∂f ∂y

(a,b)

(y − b) + … = f (1)

(a,b)(x − a, y − b)

+ 1 2! ∂2f ∂x2

(a,b)

(x − a)2 + 2 ∂2f ∂x∂y

(a,b)

(x − a)(y − b) + ∂2f ∂y2

(a,b)

(y − b)2 = f (2)

(a,b)(x − a, y − b)

homogeneous polynomials

slide-28
SLIDE 28

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

convergence of the remainder (i.e. truncation error):

lim

n→∞ Rn f (x; a) = lim n→∞ f(x) − Tn f (x; a) = 0

f(x) is an analytic function, is a polynomial approximation

nearby a with radius of convergence h: Tn

f (x; a)

min

h>0 lim n→∞ Rn f (a ± h; a) ≠ 0.

2 variables (x,y) at order 2 nearby (a,b):

T2

f (x, y; a, b) = f(a, b) + ∂f

∂x

(a,b)

(x − a) + ∂f ∂y

(a,b)

(y − b) + … = f (1)

(a,b)(x − a, y − b)

+ 1 2! ∂2f ∂x2

(a,b)

(x − a)2 + 2 ∂2f ∂x∂y

(a,b)

(x − a)(y − b) + ∂2f ∂y2

(a,b)

(y − b)2 = f (2)

(a,b)(x − a, y − b)

homogeneous polynomials f must not depend on the integration path, i.e. must derive from a potential!

slide-29
SLIDE 29

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

convergence of the remainder (i.e. truncation error):

lim

n→∞ Rn f (x; a) = lim n→∞ f(x) − Tn f (x; a) = 0

f(x) is an analytic function, is a polynomial approximation

nearby a with radius of convergence h: Tn

f (x; a)

min

h>0 lim n→∞ Rn f (a ± h; a) ≠ 0.

2 variables (x,y) at order 2 nearby (a,b):

T2

f (x, y; a, b) = f(a, b) + ∂f

∂x

(a,b)

(x − a) + ∂f ∂y

(a,b)

(y − b) + … = f (1)

(a,b)(x − a, y − b)

+ 1 2! ∂2f ∂x2

(a,b)

(x − a)2 + 2 ∂2f ∂x∂y

(a,b)

(x − a)(y − b) + ∂2f ∂y2

(a,b)

(y − b)2 = f (2)

(a,b)(x − a, y − b)

homogeneous polynomials f must not depend on the integration path, i.e. must derive from a potential!

v variables X at order n nearby A: Tn

f (X; A) = n

k=0

f (k)

A

k! (X; A)k =

n

k=0

1 k! ∑

| ⃗ m|=k (

k ⃗ m) ∂kf ∂X

⃗ m A

(X; A)

⃗ m with (

k ⃗ m) = k! c1! c2! . . . cv!

slide-30
SLIDE 30

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

convergence of the remainder (i.e. truncation error):

lim

n→∞ Rn f (x; a) = lim n→∞ f(x) − Tn f (x; a) = 0

f(x) is an analytic function, is a polynomial approximation

nearby a with radius of convergence h: Tn

f (x; a)

min

h>0 lim n→∞ Rn f (a ± h; a) ≠ 0.

2 variables (x,y) at order 2 nearby (a,b):

T2

f (x, y; a, b) = f(a, b) + ∂f

∂x

(a,b)

(x − a) + ∂f ∂y

(a,b)

(y − b) + … = f (1)

(a,b)(x − a, y − b)

+ 1 2! ∂2f ∂x2

(a,b)

(x − a)2 + 2 ∂2f ∂x∂y

(a,b)

(x − a)(y − b) + ∂2f ∂y2

(a,b)

(y − b)2 = f (2)

(a,b)(x − a, y − b)

homogeneous polynomials f must not depend on the integration path, i.e. must derive from a potential!

v variables X at order n nearby A: Tn

f (X; A) = n

k=0

f (k)

A

k! (X; A)k =

n

k=0

1 k! ∑

| ⃗ m|=k (

k ⃗ m) ∂kf ∂X

⃗ m A

(X; A)

⃗ m with (

k ⃗ m) = k! c1! c2! . . . cv!

monomials of order k

slide-31
SLIDE 31

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

convergence of the remainder (i.e. truncation error):

lim

n→∞ Rn f (x; a) = lim n→∞ f(x) − Tn f (x; a) = 0

f(x) is an analytic function, is a polynomial approximation

nearby a with radius of convergence h: Tn

f (x; a)

min

h>0 lim n→∞ Rn f (a ± h; a) ≠ 0.

2 variables (x,y) at order 2 nearby (a,b):

T2

f (x, y; a, b) = f(a, b) + ∂f

∂x

(a,b)

(x − a) + ∂f ∂y

(a,b)

(y − b) + … = f (1)

(a,b)(x − a, y − b)

+ 1 2! ∂2f ∂x2

(a,b)

(x − a)2 + 2 ∂2f ∂x∂y

(a,b)

(x − a)(y − b) + ∂2f ∂y2

(a,b)

(y − b)2 = f (2)

(a,b)(x − a, y − b)

homogeneous polynomials f must not depend on the integration path, i.e. must derive from a potential!

v variables X at order n nearby A: Tn

f (X; A) = n

k=0

f (k)

A

k! (X; A)k =

n

k=0

1 k! ∑

| ⃗ m|=k (

k ⃗ m) ∂kf ∂X

⃗ m A

(X; A)

⃗ m with (

k ⃗ m) = k! c1! c2! . . . cv!

monomials of order k multinomial

slide-32
SLIDE 32

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

convergence of the remainder (i.e. truncation error):

lim

n→∞ Rn f (x; a) = lim n→∞ f(x) − Tn f (x; a) = 0

f(x) is an analytic function, is a polynomial approximation

nearby a with radius of convergence h: Tn

f (x; a)

min

h>0 lim n→∞ Rn f (a ± h; a) ≠ 0.

2 variables (x,y) at order 2 nearby (a,b):

T2

f (x, y; a, b) = f(a, b) + ∂f

∂x

(a,b)

(x − a) + ∂f ∂y

(a,b)

(y − b) + … = f (1)

(a,b)(x − a, y − b)

+ 1 2! ∂2f ∂x2

(a,b)

(x − a)2 + 2 ∂2f ∂x∂y

(a,b)

(x − a)(y − b) + ∂2f ∂y2

(a,b)

(y − b)2 = f (2)

(a,b)(x − a, y − b)

homogeneous polynomials f must not depend on the integration path, i.e. must derive from a potential!

v variables X at order n nearby A: Tn

f (X; A) = n

k=0

f (k)

A

k! (X; A)k =

n

k=0

1 k! ∑

| ⃗ m|=k (

k ⃗ m) ∂kf ∂X

⃗ m A

(X; A)

⃗ m with (

k ⃗ m) = k! c1! c2! . . . cv!

monomials of order k multinomial TPSA coefficients

slide-33
SLIDE 33

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

convergence of the remainder (i.e. truncation error):

lim

n→∞ Rn f (x; a) = lim n→∞ f(x) − Tn f (x; a) = 0

f(x) is an analytic function, is a polynomial approximation

nearby a with radius of convergence h: Tn

f (x; a)

min

h>0 lim n→∞ Rn f (a ± h; a) ≠ 0.

2 variables (x,y) at order 2 nearby (a,b):

T2

f (x, y; a, b) = f(a, b) + ∂f

∂x

(a,b)

(x − a) + ∂f ∂y

(a,b)

(y − b) + … = f (1)

(a,b)(x − a, y − b)

+ 1 2! ∂2f ∂x2

(a,b)

(x − a)2 + 2 ∂2f ∂x∂y

(a,b)

(x − a)(y − b) + ∂2f ∂y2

(a,b)

(y − b)2 = f (2)

(a,b)(x − a, y − b)

homogeneous polynomials f must not depend on the integration path, i.e. must derive from a potential!

v variables X at order n nearby A: Tn

f (X; A) = n

k=0

f (k)

A

k! (X; A)k =

n

k=0

1 k! ∑

| ⃗ m|=k (

k ⃗ m) ∂kf ∂X

⃗ m A

(X; A)

⃗ m with (

k ⃗ m) = k! c1! c2! . . . cv!

monomials of order k multinomial TPSA coefficients IPAC 2015

slide-34
SLIDE 34

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

convergence of the remainder (i.e. truncation error):

lim

n→∞ Rn f (x; a) = lim n→∞ f(x) − Tn f (x; a) = 0

f(x) is an analytic function, is a polynomial approximation

nearby a with radius of convergence h: Tn

f (x; a)

min

h>0 lim n→∞ Rn f (a ± h; a) ≠ 0.

2 variables (x,y) at order 2 nearby (a,b):

T2

f (x, y; a, b) = f(a, b) + ∂f

∂x

(a,b)

(x − a) + ∂f ∂y

(a,b)

(y − b) + … = f (1)

(a,b)(x − a, y − b)

+ 1 2! ∂2f ∂x2

(a,b)

(x − a)2 + 2 ∂2f ∂x∂y

(a,b)

(x − a)(y − b) + ∂2f ∂y2

(a,b)

(y − b)2 = f (2)

(a,b)(x − a, y − b)

homogeneous polynomials f must not depend on the integration path, i.e. must derive from a potential!

v variables X at order n nearby A: Tn

f (X; A) = n

k=0

f (k)

A

k! (X; A)k =

n

k=0

1 k! ∑

| ⃗ m|=k (

k ⃗ m) ∂kf ∂X

⃗ m A

(X; A)

⃗ m with (

k ⃗ m) = k! c1! c2! . . . cv!

monomials of order k multinomial TPSA coefficients IPAC 2015 Github MAD

slide-35
SLIDE 35

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA in a nutshell

36

๏ Generalised Truncated Power Series Algebra ➡ Multivariate Taylor polynomials of order n in ℝ & ℂ. ➡ Powerful tool for solving differential equations (e.g. motion equations).

Tn

f (x; a) = f(a) + f′(a)(x − a) + f′′(a)

2! (x − a)2 + … + f (n)(a) n! (x − a)n =

n

k=0

f (k)

a

k! (x − a)k

1 variable x at order n in the neighbourhood of the point a in the domain of the function f :

TPSA coefficients

convergence of the remainder (i.e. truncation error):

lim

n→∞ Rn f (x; a) = lim n→∞ f(x) − Tn f (x; a) = 0

f(x) is an analytic function, is a polynomial approximation

nearby a with radius of convergence h: Tn

f (x; a)

min

h>0 lim n→∞ Rn f (a ± h; a) ≠ 0.

2 variables (x,y) at order 2 nearby (a,b):

T2

f (x, y; a, b) = f(a, b) + ∂f

∂x

(a,b)

(x − a) + ∂f ∂y

(a,b)

(y − b) + … = f (1)

(a,b)(x − a, y − b)

+ 1 2! ∂2f ∂x2

(a,b)

(x − a)2 + 2 ∂2f ∂x∂y

(a,b)

(x − a)(y − b) + ∂2f ∂y2

(a,b)

(y − b)2 = f (2)

(a,b)(x − a, y − b)

homogeneous polynomials f must not depend on the integration path, i.e. must derive from a potential!

v variables X at order n nearby A: Tn

f (X; A) = n

k=0

f (k)

A

k! (X; A)k =

n

k=0

1 k! ∑

| ⃗ m|=k (

k ⃗ m) ∂kf ∂X

⃗ m A

(X; A)

⃗ m with (

k ⃗ m) = k! c1! c2! . . . cv!

monomials of order k multinomial TPSA coefficients IPAC 2015 Github MAD 2017-2018

slide-36
SLIDE 36

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

slide-37
SLIDE 37

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n

slide-38
SLIDE 38

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD).

slide-39
SLIDE 39

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD).

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

slide-40
SLIDE 40

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD). ๏ MAD-NG includes a complete toolbox (i.e. module) to handle DA using AD… ➡ users have full access to GTPSA and DAmaps from the scripting language.

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

slide-41
SLIDE 41

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD). ๏ MAD-NG includes a complete toolbox (i.e. module) to handle DA using AD… ➡ users have full access to GTPSA and DAmaps from the scripting language. ➡ users can manipulate DAmaps stored in the MTable or the MFlow returned by Track.

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

slide-42
SLIDE 42

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD). ๏ MAD-NG includes a complete toolbox (i.e. module) to handle DA using AD… ➡ users have full access to GTPSA and DAmaps from the scripting language. ➡ users can manipulate DAmaps stored in the MTable or the MFlow returned by Track. ๏ So when DAmap/TPSA introduce errors?

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

slide-43
SLIDE 43

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD). ๏ MAD-NG includes a complete toolbox (i.e. module) to handle DA using AD… ➡ users have full access to GTPSA and DAmaps from the scripting language. ➡ users can manipulate DAmaps stored in the MTable or the MFlow returned by Track. ๏ So when DAmap/TPSA introduce errors? ➡ If they are used as functions (e.g. evaluated), instead of DA (e.g. track, twiss).

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

slide-44
SLIDE 44

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD). ๏ MAD-NG includes a complete toolbox (i.e. module) to handle DA using AD… ➡ users have full access to GTPSA and DAmaps from the scripting language. ➡ users can manipulate DAmaps stored in the MTable or the MFlow returned by Track. ๏ So when DAmap/TPSA introduce errors? ➡ If they are used as functions (e.g. evaluated), instead of DA (e.g. track, twiss). ➡ High orders of are used to interpolate at the new position by substitution.

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

Tn

f (x; a)

slide-45
SLIDE 45

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD). ๏ MAD-NG includes a complete toolbox (i.e. module) to handle DA using AD… ➡ users have full access to GTPSA and DAmaps from the scripting language. ➡ users can manipulate DAmaps stored in the MTable or the MFlow returned by Track. ๏ So when DAmap/TPSA introduce errors? ➡ If they are used as functions (e.g. evaluated), instead of DA (e.g. track, twiss). ➡ High orders of are used to interpolate at the new position by substitution.

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

Tn

f (x; a + h) = n

k=0

f (k)

a+h

k! (x − a − h)k

Tn

f (x; a)

slide-46
SLIDE 46

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD). ๏ MAD-NG includes a complete toolbox (i.e. module) to handle DA using AD… ➡ users have full access to GTPSA and DAmaps from the scripting language. ➡ users can manipulate DAmaps stored in the MTable or the MFlow returned by Track. ๏ So when DAmap/TPSA introduce errors? ➡ If they are used as functions (e.g. evaluated), instead of DA (e.g. track, twiss). ➡ High orders of are used to interpolate at the new position by substitution.

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

Tn

f (x; a + h) = n

k=0

f (k)

a+h

k! (x − a − h)k ; f(a + h) ≈

n

k=0

f (k)

a

k! hk

Tn

f (x; a)

slide-47
SLIDE 47

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD). ๏ MAD-NG includes a complete toolbox (i.e. module) to handle DA using AD… ➡ users have full access to GTPSA and DAmaps from the scripting language. ➡ users can manipulate DAmaps stored in the MTable or the MFlow returned by Track. ๏ So when DAmap/TPSA introduce errors? ➡ If they are used as functions (e.g. evaluated), instead of DA (e.g. track, twiss). ➡ High orders of are used to interpolate at the new position by substitution.

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

Tn

f (x; a + h) = n

k=0

f (k)

a+h

k! (x − a − h)k ; f(a + h) ≈

n

k=0

f (k)

a

k! hk Tn

f (a + h; a)

Tn

f (x; a)

slide-48
SLIDE 48

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD). ๏ MAD-NG includes a complete toolbox (i.e. module) to handle DA using AD… ➡ users have full access to GTPSA and DAmaps from the scripting language. ➡ users can manipulate DAmaps stored in the MTable or the MFlow returned by Track. ๏ So when DAmap/TPSA introduce errors? ➡ If they are used as functions (e.g. evaluated), instead of DA (e.g. track, twiss). ➡ High orders of are used to interpolate at the new position by substitution.

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

Tn

f (x; a + h) = n

k=0

f (k)

a+h

k! (x − a − h)k ; f(a + h) ≈

n

k=0

f (k)

a

k! hk Tn

f (a + h; a)

Tn

f (x; a)

slide-49
SLIDE 49

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD). ๏ MAD-NG includes a complete toolbox (i.e. module) to handle DA using AD… ➡ users have full access to GTPSA and DAmaps from the scripting language. ➡ users can manipulate DAmaps stored in the MTable or the MFlow returned by Track. ๏ So when DAmap/TPSA introduce errors? ➡ If they are used as functions (e.g. evaluated), instead of DA (e.g. track, twiss). ➡ High orders of are used to interpolate at the new position by substitution.

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

Tn

f (x; a + h) = n

k=0

f (k)

a+h

k! (x − a − h)k ; f(a + h) ≈

n

k=0

f (k)

a

k! hk ; f (k)

a+h ≈

dkTn

f (x; a)

dxk (a + h) Tn

f (a + h; a)

Tn

f (x; a)

slide-50
SLIDE 50

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD). ๏ MAD-NG includes a complete toolbox (i.e. module) to handle DA using AD… ➡ users have full access to GTPSA and DAmaps from the scripting language. ➡ users can manipulate DAmaps stored in the MTable or the MFlow returned by Track. ๏ So when DAmap/TPSA introduce errors? ➡ If they are used as functions (e.g. evaluated), instead of DA (e.g. track, twiss). ➡ High orders of are used to interpolate at the new position by substitution.

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

Tn

f (x; a + h) = n

k=0

f (k)

a+h

k! (x − a − h)k ; f(a + h) ≈

n

k=0

f (k)

a

k! hk ; f (k)

a+h ≈

dkTn

f (x; a)

dxk (a + h) Tn

f (a + h; a)

Tn

f (x; a)

slide-51
SLIDE 51

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD). ๏ MAD-NG includes a complete toolbox (i.e. module) to handle DA using AD… ➡ users have full access to GTPSA and DAmaps from the scripting language. ➡ users can manipulate DAmaps stored in the MTable or the MFlow returned by Track. ๏ So when DAmap/TPSA introduce errors? ➡ If they are used as functions (e.g. evaluated), instead of DA (e.g. track, twiss). ➡ High orders of are used to interpolate at the new position by substitution.

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

Tn

f (x; a + h) = n

k=0

f (k)

a+h

k! (x − a − h)k ; f(a + h) ≈

n

k=0

f (k)

a

k! hk ; f (k)

a+h ≈

dkTn

f (x; a)

dxk (a + h) Tn

f (a + h; a)

Tn

f (x; a)

  • rder n is constant
  • rder n-1 is linear in h
slide-52
SLIDE 52

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD). ๏ MAD-NG includes a complete toolbox (i.e. module) to handle DA using AD… ➡ users have full access to GTPSA and DAmaps from the scripting language. ➡ users can manipulate DAmaps stored in the MTable or the MFlow returned by Track. ๏ So when DAmap/TPSA introduce errors? ➡ If they are used as functions (e.g. evaluated), instead of DA (e.g. track, twiss). ➡ High orders of are used to interpolate at the new position by substitution.

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

Tn

f (x; a + h) = n

k=0

f (k)

a+h

k! (x − a − h)k ; f(a + h) ≈

n

k=0

f (k)

a

k! hk ; f (k)

a+h ≈

dkTn

f (x; a)

dxk (a + h) Tn

f (a + h; a)

Tn

f (x; a) Matrix codes don’t do better!

  • rder n is constant
  • rder n-1 is linear in h
slide-53
SLIDE 53

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD). ๏ MAD-NG includes a complete toolbox (i.e. module) to handle DA using AD… ➡ users have full access to GTPSA and DAmaps from the scripting language. ➡ users can manipulate DAmaps stored in the MTable or the MFlow returned by Track. ๏ So when DAmap/TPSA introduce errors? ➡ If they are used as functions (e.g. evaluated), instead of DA (e.g. track, twiss). ➡ High orders of are used to interpolate at the new position by substitution.

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

Tn

f (x; a + h) = n

k=0

f (k)

a+h

k! (x − a − h)k ; f(a + h) ≈

n

k=0

f (k)

a

k! hk ; f (k)

a+h ≈

dkTn

f (x; a)

dxk (a + h) Tn

f (a + h; a)

Tn

f (x; a) Matrix codes don’t do better!

  • rder n is constant
  • rder n-1 is linear in h

sin x and its Taylor approximations nearby 0 by

polynomials of degree 1, 3, 5, 7, 9, 11 and 13.

slide-54
SLIDE 54

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

Accuracy of TPSA (myths and legends)

37

๏ GTPSA are exact to machine precision, no approximation for orders 0..n ➡ derivatives are computed using automatic differentiation (AD). ๏ MAD-NG includes a complete toolbox (i.e. module) to handle DA using AD… ➡ users have full access to GTPSA and DAmaps from the scripting language. ➡ users can manipulate DAmaps stored in the MTable or the MFlow returned by Track. ๏ So when DAmap/TPSA introduce errors? ➡ If they are used as functions (e.g. evaluated), instead of DA (e.g. track, twiss). ➡ High orders of are used to interpolate at the new position by substitution.

AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives

  • f arbitrary order can be computed automatically, accurately to working precision, and using at

most a small constant factor more arithmetic operations than the original program. Symbolic differentiation can lead to inefficient code and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where complexity and errors increase.

from Wikipedia

Tn

f (x; a + h) = n

k=0

f (k)

a+h

k! (x − a − h)k ; f(a + h) ≈

n

k=0

f (k)

a

k! hk ; f (k)

a+h ≈

dkTn

f (x; a)

dxk (a + h) Tn

f (a + h; a)

Tn

f (x; a) Matrix codes don’t do better!

  • rder n is constant
  • rder n-1 is linear in h

sin x and its Taylor approximations nearby 0 by

polynomials of degree 1, 3, 5, 7, 9, 11 and 13. Functions of TPSAs ≠ TPSAs as functions exact ≠ approximate

slide-55
SLIDE 55

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

slide-56
SLIDE 56

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps

slide-57
SLIDE 57

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps ➡ Tuple of GTPSA, e.g. 6D phase space uses 6 GTPSA.

slide-58
SLIDE 58

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps ➡ Tuple of GTPSA, e.g. 6D phase space uses 6 GTPSA. ➡ Handles user defined knobs.

slide-59
SLIDE 59

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps ➡ Tuple of GTPSA, e.g. 6D phase space uses 6 GTPSA. ➡ Handles user defined knobs. ➡ Behaves like particles for the scalar part (orbit).

slide-60
SLIDE 60

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps ➡ Tuple of GTPSA, e.g. 6D phase space uses 6 GTPSA. ➡ Handles user defined knobs. ➡ Behaves like particles for the scalar part (orbit).

x px y py t pt

DA map of 6 variables at order 2 (e.g. MAD-X twiss)

slide-61
SLIDE 61

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps ➡ Tuple of GTPSA, e.g. 6D phase space uses 6 GTPSA. ➡ Handles user defined knobs. ➡ Behaves like particles for the scalar part (orbit).

x px y py t pt

DA map of 6 variables at order 2 (e.g. MAD-X twiss)

GTPSA

slide-62
SLIDE 62

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps ➡ Tuple of GTPSA, e.g. 6D phase space uses 6 GTPSA. ➡ Handles user defined knobs. ➡ Behaves like particles for the scalar part (orbit).

x px y py t pt

DA map of 6 variables at order 2 (e.g. MAD-X twiss)

GTPSA

slide-63
SLIDE 63

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps ➡ Tuple of GTPSA, e.g. 6D phase space uses 6 GTPSA. ➡ Handles user defined knobs. ➡ Behaves like particles for the scalar part (orbit).

x px y py t pt

DA map of 6 variables at order 2 (e.g. MAD-X twiss)

GTPSA

f (0)

A : E (orbit)

slide-64
SLIDE 64

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps ➡ Tuple of GTPSA, e.g. 6D phase space uses 6 GTPSA. ➡ Handles user defined knobs. ➡ Behaves like particles for the scalar part (orbit).

x px y py t pt

DA map of 6 variables at order 2 (e.g. MAD-X twiss)

GTPSA

f (0)

A : E (orbit)

slide-65
SLIDE 65

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps ➡ Tuple of GTPSA, e.g. 6D phase space uses 6 GTPSA. ➡ Handles user defined knobs. ➡ Behaves like particles for the scalar part (orbit).

x px y py t pt

DA map of 6 variables at order 2 (e.g. MAD-X twiss)

GTPSA

f (0)

A : E (orbit)

f (1)

A : R (matrix)

slide-66
SLIDE 66

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps ➡ Tuple of GTPSA, e.g. 6D phase space uses 6 GTPSA. ➡ Handles user defined knobs. ➡ Behaves like particles for the scalar part (orbit).

x px y py t pt

DA map of 6 variables at order 2 (e.g. MAD-X twiss)

GTPSA

f (0)

A : E (orbit)

f (1)

A : R (matrix)

slide-67
SLIDE 67

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps ➡ Tuple of GTPSA, e.g. 6D phase space uses 6 GTPSA. ➡ Handles user defined knobs. ➡ Behaves like particles for the scalar part (orbit).

x px y py t pt

DA map of 6 variables at order 2 (e.g. MAD-X twiss)

GTPSA

f (0)

A : E (orbit)

f (1)

A : R (matrix)

f (2)

A : T* (folded tensor)

slide-68
SLIDE 68

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps ➡ Tuple of GTPSA, e.g. 6D phase space uses 6 GTPSA. ➡ Handles user defined knobs. ➡ Behaves like particles for the scalar part (orbit).

x px y py t pt

DA map of 6 variables at order 2 (e.g. MAD-X twiss)

GTPSA

f (0)

A : E (orbit)

f (1)

A : R (matrix)

f (2)

A : T* (folded tensor)

knobs

∂px ∂k1

slide-69
SLIDE 69

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps ➡ Tuple of GTPSA, e.g. 6D phase space uses 6 GTPSA. ➡ Handles user defined knobs. ➡ Behaves like particles for the scalar part (orbit).

x px y py t pt

DA map of 6 variables at order 2 (e.g. MAD-X twiss)

GTPSA

f (0)

A : E (orbit)

f (1)

A : R (matrix)

f (2)

A : T* (folded tensor)

knobs

∂px ∂k1 ∂2px ∂k2

1

∂2px ∂x∂k1

slide-70
SLIDE 70

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps ➡ Tuple of GTPSA, e.g. 6D phase space uses 6 GTPSA. ➡ Handles user defined knobs. ➡ Behaves like particles for the scalar part (orbit).

x px y py t pt

DA map of 6 variables at order 2 (e.g. MAD-X twiss)

GTPSA

f (0)

A : E (orbit)

f (1)

A : R (matrix)

f (2)

A : T* (folded tensor)

knobs

∂px ∂k1 ∂2px ∂k2

1

∂2px ∂x∂k1

0 0 0 0 0 0 1 knob k1 in “user scope”

k1

slide-71
SLIDE 71

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DA map

38

๏ Differential Algebra maps ➡ Tuple of GTPSA, e.g. 6D phase space uses 6 GTPSA. ➡ Handles user defined knobs. ➡ Behaves like particles for the scalar part (orbit).

x px y py t pt

DA map of 6 variables at order 2 (e.g. MAD-X twiss)

GTPSA

f (0)

A : E (orbit)

f (1)

A : R (matrix)

f (2)

A : T* (folded tensor)

knobs

∂px ∂k1 ∂2px ∂k2

1

∂2px ∂x∂k1

0 0 0 0 0 0 1 knob k1 in “user scope”

k1

TPSA: homogeneous polynomials are dense (i.e. R is squared) GTPSA: homogeneous polynomials are NOT dense or include knobs

slide-72
SLIDE 72

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DAmap vs. Matrix sizes

39

slide-73
SLIDE 73

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DAmap vs. Matrix sizes

39

TPSA: homogeneous polynomials are dense with coefficients

( n + v v ) = (n + v)! n! v!

slide-74
SLIDE 74

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DAmap vs. Matrix sizes

39

TPSA: homogeneous polynomials are dense with coefficients

( n + v v ) = (n + v)! n! v!

GTPSA: homogeneous polynomials are NOT dense (no direct formula, only upper bound)

slide-75
SLIDE 75

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DAmap vs. Matrix sizes

39

TPSA: homogeneous polynomials are dense with coefficients

( n + v v ) = (n + v)! n! v!

GTPSA: homogeneous polynomials are NOT dense (no direct formula, only upper bound)

v \ n 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 2 6 12 20 30 42 56 72 90 110 132 156 182 3 12 30 60 105 168 252 360 495 660 858 1092 1365 4 20 60 140 280 504 840 1320 1980 2860 4004 5460 7280 5 30 105 280 630 1260 2310 3960 6435 10010 15015 21840 30940 6 42 168 504 1260 2772 5544 10296 18018 30030 48048 74256 111384 7 56 252 840 2310 5544 12012 24024 45045 80080 136136 222768 352716 8 72 360 1320 3960 10296 24024 51480 102960 194480 350064 604656 1007760

slide-76
SLIDE 76

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DAmap vs. Matrix sizes

39

TPSA: homogeneous polynomials are dense with coefficients

( n + v v ) = (n + v)! n! v!

GTPSA: homogeneous polynomials are NOT dense (no direct formula, only upper bound)

v \ n 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 2 6 12 20 30 42 56 72 90 110 132 156 182 3 12 30 60 105 168 252 360 495 660 858 1092 1365 4 20 60 140 280 504 840 1320 1980 2860 4004 5460 7280 5 30 105 280 630 1260 2310 3960 6435 10010 15015 21840 30940 6 42 168 504 1260 2772 5544 10296 18018 30030 48048 74256 111384 7 56 252 840 2310 5544 12012 24024 45045 80080 136136 222768 352716 8 72 360 1320 3960 10296 24024 51480 102960 194480 350064 604656 1007760

DA map: v (

n + v v )

slide-77
SLIDE 77

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DAmap vs. Matrix sizes

39

TPSA: homogeneous polynomials are dense with coefficients

( n + v v ) = (n + v)! n! v!

GTPSA: homogeneous polynomials are NOT dense (no direct formula, only upper bound)

v \ n 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 2 6 12 20 30 42 56 72 90 110 132 156 182 3 12 30 60 105 168 252 360 495 660 858 1092 1365 4 20 60 140 280 504 840 1320 1980 2860 4004 5460 7280 5 30 105 280 630 1260 2310 3960 6435 10010 15015 21840 30940 6 42 168 504 1260 2772 5544 10296 18018 30030 48048 74256 111384 7 56 252 840 2310 5544 12012 24024 45045 80080 136136 222768 352716 8 72 360 1320 3960 10296 24024 51480 102960 194480 350064 604656 1007760

DA map: v (

n + v v )

v \ n 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 2 6 14 30 62 126 254 510 1022 2046 4094 8190 16382 3 12 39 120 363 1092 3279 9840 29523 88572 265719 797160 2391483 4 20 84 340 1364 5460 21844 87380 349524 1398100 5592404 22369620 89478484 5 30 155 780 3905 19530 97655 488280 2441405 12207030 61035155 305175780 1525878905 6 42 258 1554 9330 55986 335922 2015538 12093234 72559410 435356466 2612138802 15672832818 7 56 399 2800 19607 137256 960799 6725600 47079207 329554456 2306881199 16148168400 113037178807 8 72 584 4680 37448 299592 2396744 19173960 153391688 1227133512 9817068104 78536544840 628292358728

slide-78
SLIDE 78

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DAmap vs. Matrix sizes

39

TPSA: homogeneous polynomials are dense with coefficients

( n + v v ) = (n + v)! n! v!

GTPSA: homogeneous polynomials are NOT dense (no direct formula, only upper bound)

v \ n 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 2 6 12 20 30 42 56 72 90 110 132 156 182 3 12 30 60 105 168 252 360 495 660 858 1092 1365 4 20 60 140 280 504 840 1320 1980 2860 4004 5460 7280 5 30 105 280 630 1260 2310 3960 6435 10010 15015 21840 30940 6 42 168 504 1260 2772 5544 10296 18018 30030 48048 74256 111384 7 56 252 840 2310 5544 12012 24024 45045 80080 136136 222768 352716 8 72 360 1320 3960 10296 24024 51480 102960 194480 350064 604656 1007760

DA map: v (

n + v v )

v \ n 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 2 6 14 30 62 126 254 510 1022 2046 4094 8190 16382 3 12 39 120 363 1092 3279 9840 29523 88572 265719 797160 2391483 4 20 84 340 1364 5460 21844 87380 349524 1398100 5592404 22369620 89478484 5 30 155 780 3905 19530 97655 488280 2441405 12207030 61035155 305175780 1525878905 6 42 258 1554 9330 55986 335922 2015538 12093234 72559410 435356466 2612138802 15672832818 7 56 399 2800 19607 137256 960799 6725600 47079207 329554456 2306881199 16148168400 113037178807 8 72 584 4680 37448 299592 2396744 19173960 153391688 1227133512 9817068104 78536544840 628292358728

Matrix:

n

k=0

vk+1 = v(vn+1 − 1)

v − 1

slide-79
SLIDE 79

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DAmap vs. Matrix sizes

39

TPSA: homogeneous polynomials are dense with coefficients

( n + v v ) = (n + v)! n! v!

GTPSA: homogeneous polynomials are NOT dense (no direct formula, only upper bound)

v \ n 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 2 6 12 20 30 42 56 72 90 110 132 156 182 3 12 30 60 105 168 252 360 495 660 858 1092 1365 4 20 60 140 280 504 840 1320 1980 2860 4004 5460 7280 5 30 105 280 630 1260 2310 3960 6435 10010 15015 21840 30940 6 42 168 504 1260 2772 5544 10296 18018 30030 48048 74256 111384 7 56 252 840 2310 5544 12012 24024 45045 80080 136136 222768 352716 8 72 360 1320 3960 10296 24024 51480 102960 194480 350064 604656 1007760

DA map: v (

n + v v )

v \ n 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 2 6 14 30 62 126 254 510 1022 2046 4094 8190 16382 3 12 39 120 363 1092 3279 9840 29523 88572 265719 797160 2391483 4 20 84 340 1364 5460 21844 87380 349524 1398100 5592404 22369620 89478484 5 30 155 780 3905 19530 97655 488280 2441405 12207030 61035155 305175780 1525878905 6 42 258 1554 9330 55986 335922 2015538 12093234 72559410 435356466 2612138802 15672832818 7 56 399 2800 19607 137256 960799 6725600 47079207 329554456 2306881199 16148168400 113037178807 8 72 584 4680 37448 299592 2396744 19173960 153391688 1227133512 9817068104 78536544840 628292358728

Matrix:

n

k=0

vk+1 = v(vn+1 − 1)

v − 1

slide-80
SLIDE 80

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DAmap vs. Matrix sizes

39

TPSA: homogeneous polynomials are dense with coefficients

( n + v v ) = (n + v)! n! v!

GTPSA: homogeneous polynomials are NOT dense (no direct formula, only upper bound)

v \ n 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 2 6 12 20 30 42 56 72 90 110 132 156 182 3 12 30 60 105 168 252 360 495 660 858 1092 1365 4 20 60 140 280 504 840 1320 1980 2860 4004 5460 7280 5 30 105 280 630 1260 2310 3960 6435 10010 15015 21840 30940 6 42 168 504 1260 2772 5544 10296 18018 30030 48048 74256 111384 7 56 252 840 2310 5544 12012 24024 45045 80080 136136 222768 352716 8 72 360 1320 3960 10296 24024 51480 102960 194480 350064 604656 1007760

DA map: v (

n + v v )

v \ n 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 2 6 14 30 62 126 254 510 1022 2046 4094 8190 16382 3 12 39 120 363 1092 3279 9840 29523 88572 265719 797160 2391483 4 20 84 340 1364 5460 21844 87380 349524 1398100 5592404 22369620 89478484 5 30 155 780 3905 19530 97655 488280 2441405 12207030 61035155 305175780 1525878905 6 42 258 1554 9330 55986 335922 2015538 12093234 72559410 435356466 2612138802 15672832818 7 56 399 2800 19607 137256 960799 6725600 47079207 329554456 2306881199 16148168400 113037178807 8 72 584 4680 37448 299592 2396744 19173960 153391688 1227133512 9817068104 78536544840 628292358728

Matrix:

n

k=0

vk+1 = v(vn+1 − 1)

v − 1

slide-81
SLIDE 81

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DAmap vs. Matrix sizes

39

TPSA: homogeneous polynomials are dense with coefficients

( n + v v ) = (n + v)! n! v!

GTPSA: homogeneous polynomials are NOT dense (no direct formula, only upper bound)

v \ n 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 2 6 12 20 30 42 56 72 90 110 132 156 182 3 12 30 60 105 168 252 360 495 660 858 1092 1365 4 20 60 140 280 504 840 1320 1980 2860 4004 5460 7280 5 30 105 280 630 1260 2310 3960 6435 10010 15015 21840 30940 6 42 168 504 1260 2772 5544 10296 18018 30030 48048 74256 111384 7 56 252 840 2310 5544 12012 24024 45045 80080 136136 222768 352716 8 72 360 1320 3960 10296 24024 51480 102960 194480 350064 604656 1007760

DA map: v (

n + v v )

v \ n 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 2 6 14 30 62 126 254 510 1022 2046 4094 8190 16382 3 12 39 120 363 1092 3279 9840 29523 88572 265719 797160 2391483 4 20 84 340 1364 5460 21844 87380 349524 1398100 5592404 22369620 89478484 5 30 155 780 3905 19530 97655 488280 2441405 12207030 61035155 305175780 1525878905 6 42 258 1554 9330 55986 335922 2015538 12093234 72559410 435356466 2612138802 15672832818 7 56 399 2800 19607 137256 960799 6725600 47079207 329554456 2306881199 16148168400 113037178807 8 72 584 4680 37448 299592 2396744 19173960 153391688 1227133512 9817068104 78536544840 628292358728

Matrix:

n

k=0

vk+1 = v(vn+1 − 1)

v − 1 TPSA manipulate

  • nly numbers!
slide-82
SLIDE 82

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DAmap vs. Matrix sizes

39

TPSA: homogeneous polynomials are dense with coefficients

( n + v v ) = (n + v)! n! v!

GTPSA: homogeneous polynomials are NOT dense (no direct formula, only upper bound)

v \ n 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 2 6 12 20 30 42 56 72 90 110 132 156 182 3 12 30 60 105 168 252 360 495 660 858 1092 1365 4 20 60 140 280 504 840 1320 1980 2860 4004 5460 7280 5 30 105 280 630 1260 2310 3960 6435 10010 15015 21840 30940 6 42 168 504 1260 2772 5544 10296 18018 30030 48048 74256 111384 7 56 252 840 2310 5544 12012 24024 45045 80080 136136 222768 352716 8 72 360 1320 3960 10296 24024 51480 102960 194480 350064 604656 1007760

DA map: v (

n + v v )

v \ n 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 2 6 14 30 62 126 254 510 1022 2046 4094 8190 16382 3 12 39 120 363 1092 3279 9840 29523 88572 265719 797160 2391483 4 20 84 340 1364 5460 21844 87380 349524 1398100 5592404 22369620 89478484 5 30 155 780 3905 19530 97655 488280 2441405 12207030 61035155 305175780 1525878905 6 42 258 1554 9330 55986 335922 2015538 12093234 72559410 435356466 2612138802 15672832818 7 56 399 2800 19607 137256 960799 6725600 47079207 329554456 2306881199 16148168400 113037178807 8 72 584 4680 37448 299592 2396744 19173960 153391688 1227133512 9817068104 78536544840 628292358728 TPSA are the only suitable solutions for high orders!

Matrix:

n

k=0

vk+1 = v(vn+1 − 1)

v − 1 TPSA manipulate

  • nly numbers!
slide-83
SLIDE 83

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DAmap settings

40

slide-84
SLIDE 84

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DAmap settings

40 damap { .nv=nv or 6, -- number of map variables .xy=no or 2, -- order for xy planes .pt=no or xy, -- order for pt plane .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’}

  • - variables names

} damap{ } ⟺ damap{.nv=6, .xy=2, .pt=2} damap{.xy=3} ⟺ damap{.nv=6, .xy=3, .pt=3} damap{.pt=5} ⟺ damap{.nv=6, .xy=2, .pt=5} .nv=6 ⟺ .mo={xy,xy,xy,xy,pt,pt} .nv=5 ⟺ .mo={xy,xy,xy,xy}, .ko={pt} .nv=4 ⟺ .mo={xy,xy,xy,xy}

damap with planes settings

slide-85
SLIDE 85

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

DAmap settings

40 damap { .nv=nv or 6, -- number of map variables .xy=no or 2, -- order for xy planes .pt=no or xy, -- order for pt plane .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’}

  • - variables names

} damap{ } ⟺ damap{.nv=6, .xy=2, .pt=2} damap{.xy=3} ⟺ damap{.nv=6, .xy=3, .pt=3} damap{.pt=5} ⟺ damap{.nv=6, .xy=2, .pt=5} .nv=6 ⟺ .mo={xy,xy,xy,xy,pt,pt} .nv=5 ⟺ .mo={xy,xy,xy,xy}, .ko={pt} .nv=4 ⟺ .mo={xy,xy,xy,xy}

damap with planes settings

damap { .nv=nv -- number of mvars (replaced by #mo if array or string) .mo=mo -- mvars orders (number, string or array) .nk=nk -- number of knobs (replaced by #ko if array or string) .ko=ko -- knobs orders (number, string or array) .dk=dk -- knobs max Xorder (number) .vo=vo -- variables orders (string or array, variables orders) .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’} -- variables names } .mo={3,4} .ko={1,2} .dk=2 .vn={‘x’,’y’,’k1’,’k2’} .vo={2,3}

damap with variables settings

slide-86
SLIDE 86

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

NV+NK NV

x px y py t pt

GTPSA

f (0)

A

f (1)

A

f (2)

A

knobs

0 0 0 0 0 0 1

k1

MO NV

DAmap settings

40 damap { .nv=nv or 6, -- number of map variables .xy=no or 2, -- order for xy planes .pt=no or xy, -- order for pt plane .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’}

  • - variables names

} damap{ } ⟺ damap{.nv=6, .xy=2, .pt=2} damap{.xy=3} ⟺ damap{.nv=6, .xy=3, .pt=3} damap{.pt=5} ⟺ damap{.nv=6, .xy=2, .pt=5} .nv=6 ⟺ .mo={xy,xy,xy,xy,pt,pt} .nv=5 ⟺ .mo={xy,xy,xy,xy}, .ko={pt} .nv=4 ⟺ .mo={xy,xy,xy,xy}

damap with planes settings

damap { .nv=nv -- number of mvars (replaced by #mo if array or string) .mo=mo -- mvars orders (number, string or array) .nk=nk -- number of knobs (replaced by #ko if array or string) .ko=ko -- knobs orders (number, string or array) .dk=dk -- knobs max Xorder (number) .vo=vo -- variables orders (string or array, variables orders) .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’} -- variables names } .mo={3,4} .ko={1,2} .dk=2 .vn={‘x’,’y’,’k1’,’k2’} .vo={2,3}

damap with variables settings

slide-87
SLIDE 87

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

NV+NK NV

x px y py t pt

GTPSA

f (0)

A

f (1)

A

f (2)

A

knobs

0 0 0 0 0 0 1

k1

MO NV

DAmap settings

40 damap { .nv=nv or 6, -- number of map variables .xy=no or 2, -- order for xy planes .pt=no or xy, -- order for pt plane .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’}

  • - variables names

} damap{ } ⟺ damap{.nv=6, .xy=2, .pt=2} damap{.xy=3} ⟺ damap{.nv=6, .xy=3, .pt=3} damap{.pt=5} ⟺ damap{.nv=6, .xy=2, .pt=5} .nv=6 ⟺ .mo={xy,xy,xy,xy,pt,pt} .nv=5 ⟺ .mo={xy,xy,xy,xy}, .ko={pt} .nv=4 ⟺ .mo={xy,xy,xy,xy}

damap with planes settings

damap { .nv=nv -- number of mvars (replaced by #mo if array or string) .mo=mo -- mvars orders (number, string or array) .nk=nk -- number of knobs (replaced by #ko if array or string) .ko=ko -- knobs orders (number, string or array) .dk=dk -- knobs max Xorder (number) .vo=vo -- variables orders (string or array, variables orders) .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’} -- variables names } .mo={3,4} .ko={1,2} .dk=2 .vn={‘x’,’y’,’k1’,’k2’} .vo={2,3}

damap with variables settings yes: no:

∂3fx ∂y3 , ∂3fx ∂x2∂k1 , ∂4fy ∂x2∂k2

2

, ∂3fx ∂x∂k1∂k2 ; ∂3fy ∂x3 , ∂2fx ∂k2

1

, ∂3fx ∂k1∂k2

2

, ∂fx ∂a .

.mo .ko

slide-88
SLIDE 88

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

NV+NK NV

x px y py t pt

GTPSA

f (0)

A

f (1)

A

f (2)

A

knobs

0 0 0 0 0 0 1

k1

MO NV

DAmap settings

40 damap { .nv=nv or 6, -- number of map variables .xy=no or 2, -- order for xy planes .pt=no or xy, -- order for pt plane .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’}

  • - variables names

} damap{ } ⟺ damap{.nv=6, .xy=2, .pt=2} damap{.xy=3} ⟺ damap{.nv=6, .xy=3, .pt=3} damap{.pt=5} ⟺ damap{.nv=6, .xy=2, .pt=5} .nv=6 ⟺ .mo={xy,xy,xy,xy,pt,pt} .nv=5 ⟺ .mo={xy,xy,xy,xy}, .ko={pt} .nv=4 ⟺ .mo={xy,xy,xy,xy}

damap with planes settings

damap { .nv=nv -- number of mvars (replaced by #mo if array or string) .mo=mo -- mvars orders (number, string or array) .nk=nk -- number of knobs (replaced by #ko if array or string) .ko=ko -- knobs orders (number, string or array) .dk=dk -- knobs max Xorder (number) .vo=vo -- variables orders (string or array, variables orders) .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’} -- variables names } .mo={3,4} .ko={1,2} .dk=2 .vn={‘x’,’y’,’k1’,’k2’} .vo={2,3}

damap with variables settings yes: no:

∂3fx ∂y3 , ∂3fx ∂x2∂k1 , ∂4fy ∂x2∂k2

2

, ∂3fx ∂x∂k1∂k2 ; ∂3fy ∂x3 , ∂2fx ∂k2

1

, ∂3fx ∂k1∂k2

2

, ∂fx ∂a .

.mo .ko

slide-89
SLIDE 89

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

NV+NK NV

x px y py t pt

GTPSA

f (0)

A

f (1)

A

f (2)

A

knobs

0 0 0 0 0 0 1

k1

MO NV

DAmap settings

40 damap { .nv=nv or 6, -- number of map variables .xy=no or 2, -- order for xy planes .pt=no or xy, -- order for pt plane .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’}

  • - variables names

} damap{ } ⟺ damap{.nv=6, .xy=2, .pt=2} damap{.xy=3} ⟺ damap{.nv=6, .xy=3, .pt=3} damap{.pt=5} ⟺ damap{.nv=6, .xy=2, .pt=5} .nv=6 ⟺ .mo={xy,xy,xy,xy,pt,pt} .nv=5 ⟺ .mo={xy,xy,xy,xy}, .ko={pt} .nv=4 ⟺ .mo={xy,xy,xy,xy}

damap with planes settings

damap { .nv=nv -- number of mvars (replaced by #mo if array or string) .mo=mo -- mvars orders (number, string or array) .nk=nk -- number of knobs (replaced by #ko if array or string) .ko=ko -- knobs orders (number, string or array) .dk=dk -- knobs max Xorder (number) .vo=vo -- variables orders (string or array, variables orders) .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’} -- variables names } .mo={3,4} .ko={1,2} .dk=2 .vn={‘x’,’y’,’k1’,’k2’} .vo={2,3}

damap with variables settings yes: no:

∂3fx ∂y3 , ∂3fx ∂x2∂k1 , ∂4fy ∂x2∂k2

2

, ∂3fx ∂x∂k1∂k2 ; ∂3fy ∂x3 , ∂2fx ∂k2

1

, ∂3fx ∂k1∂k2

2

, ∂fx ∂a .

.mo .ko

slide-90
SLIDE 90

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

NV+NK NV

x px y py t pt

GTPSA

f (0)

A

f (1)

A

f (2)

A

knobs

0 0 0 0 0 0 1

k1

MO NV

DAmap settings

40 damap { .nv=nv or 6, -- number of map variables .xy=no or 2, -- order for xy planes .pt=no or xy, -- order for pt plane .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’}

  • - variables names

} damap{ } ⟺ damap{.nv=6, .xy=2, .pt=2} damap{.xy=3} ⟺ damap{.nv=6, .xy=3, .pt=3} damap{.pt=5} ⟺ damap{.nv=6, .xy=2, .pt=5} .nv=6 ⟺ .mo={xy,xy,xy,xy,pt,pt} .nv=5 ⟺ .mo={xy,xy,xy,xy}, .ko={pt} .nv=4 ⟺ .mo={xy,xy,xy,xy}

damap with planes settings

damap { .nv=nv -- number of mvars (replaced by #mo if array or string) .mo=mo -- mvars orders (number, string or array) .nk=nk -- number of knobs (replaced by #ko if array or string) .ko=ko -- knobs orders (number, string or array) .dk=dk -- knobs max Xorder (number) .vo=vo -- variables orders (string or array, variables orders) .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’} -- variables names } .mo={3,4} .ko={1,2} .dk=2 .vn={‘x’,’y’,’k1’,’k2’} .vo={2,3}

damap with variables settings yes: no:

∂3fx ∂y3 , ∂3fx ∂x2∂k1 , ∂4fy ∂x2∂k2

2

, ∂3fx ∂x∂k1∂k2 ; ∂3fy ∂x3 , ∂2fx ∂k2

1

, ∂3fx ∂k1∂k2

2

, ∂fx ∂a .

.mo .ko

slide-91
SLIDE 91

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

NV+NK NV

x px y py t pt

GTPSA

f (0)

A

f (1)

A

f (2)

A

knobs

0 0 0 0 0 0 1

k1

MO NV

DAmap settings

40 damap { .nv=nv or 6, -- number of map variables .xy=no or 2, -- order for xy planes .pt=no or xy, -- order for pt plane .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’}

  • - variables names

} damap{ } ⟺ damap{.nv=6, .xy=2, .pt=2} damap{.xy=3} ⟺ damap{.nv=6, .xy=3, .pt=3} damap{.pt=5} ⟺ damap{.nv=6, .xy=2, .pt=5} .nv=6 ⟺ .mo={xy,xy,xy,xy,pt,pt} .nv=5 ⟺ .mo={xy,xy,xy,xy}, .ko={pt} .nv=4 ⟺ .mo={xy,xy,xy,xy}

damap with planes settings

damap { .nv=nv -- number of mvars (replaced by #mo if array or string) .mo=mo -- mvars orders (number, string or array) .nk=nk -- number of knobs (replaced by #ko if array or string) .ko=ko -- knobs orders (number, string or array) .dk=dk -- knobs max Xorder (number) .vo=vo -- variables orders (string or array, variables orders) .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’} -- variables names } .mo={3,4} .ko={1,2} .dk=2 .vn={‘x’,’y’,’k1’,’k2’} .vo={2,3}

damap with variables settings yes: no:

∂3fx ∂y3 , ∂3fx ∂x2∂k1 , ∂4fy ∂x2∂k2

2

, ∂3fx ∂x∂k1∂k2 ; ∂3fy ∂x3 , ∂2fx ∂k2

1

, ∂3fx ∂k1∂k2

2

, ∂fx ∂a .

.mo .ko

slide-92
SLIDE 92

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

NV+NK NV

x px y py t pt

GTPSA

f (0)

A

f (1)

A

f (2)

A

knobs

0 0 0 0 0 0 1

k1

MO NV

DAmap settings

40 damap { .nv=nv or 6, -- number of map variables .xy=no or 2, -- order for xy planes .pt=no or xy, -- order for pt plane .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’}

  • - variables names

} damap{ } ⟺ damap{.nv=6, .xy=2, .pt=2} damap{.xy=3} ⟺ damap{.nv=6, .xy=3, .pt=3} damap{.pt=5} ⟺ damap{.nv=6, .xy=2, .pt=5} .nv=6 ⟺ .mo={xy,xy,xy,xy,pt,pt} .nv=5 ⟺ .mo={xy,xy,xy,xy}, .ko={pt} .nv=4 ⟺ .mo={xy,xy,xy,xy}

damap with planes settings

damap { .nv=nv -- number of mvars (replaced by #mo if array or string) .mo=mo -- mvars orders (number, string or array) .nk=nk -- number of knobs (replaced by #ko if array or string) .ko=ko -- knobs orders (number, string or array) .dk=dk -- knobs max Xorder (number) .vo=vo -- variables orders (string or array, variables orders) .vn=vn or {‘x’,’px’,’y’,’py’,’t’,’pt’} -- variables names } .mo={3,4} .ko={1,2} .dk=2 .vn={‘x’,’y’,’k1’,’k2’} .vo={2,3}

damap with variables settings yes: no:

∂3fx ∂y3 , ∂3fx ∂x2∂k1 , ∂4fy ∂x2∂k2

2

, ∂3fx ∂x∂k1∂k2 ; ∂3fy ∂x3 , ∂2fx ∂k2

1

, ∂3fx ∂k1∂k2

2

, ∂fx ∂a .

.mo .ko

slide-93
SLIDE 93

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA and DAmap operations

41

slide-94
SLIDE 94

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA and DAmap operations

41

๏ GTPSA operations in ℝ & ℂ ➡ getter/setter: get0/set0, get/set, get_sparse/set_sparse, getvec/setvec, clear, etc… ➡ operators: +, −, ×, ÷, ^, add, sub, mul, div, pow. ➡ linear: add, sub, real, imag, conj, abs, arg, nrm, acc, scl. ➡ functions: inv, sqrt, invsqrt, exp, log, pow, (a)cos(h), (a)sin(h), (a)tan(h), (a)cot(h), erf(c). ➡ special: scalar, eval, deriv(atives), poisson ➡ high-level: axpb, axpbypc, axypb, axypbzpc, ax2pby2pcz2, axypbvwpc,
 axpsqrtbpcx2, logaxpsqrtbpcx2 logxdy ➡ I/O: read, write, print. ➡ monomial ⟺ index: get_idx, get_idx_sparse, get_mono. ✓monomial module to manipulate monomials.

= log (ax + b + cx2), = log (

x y) .

= [x, y] = ∑n

i=1 ∂x ∂qi ∂y ∂pi − ∂x ∂pi ∂y ∂qi .

slide-95
SLIDE 95

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA and DAmap operations

41

๏ GTPSA operations in ℝ & ℂ ➡ getter/setter: get0/set0, get/set, get_sparse/set_sparse, getvec/setvec, clear, etc… ➡ operators: +, −, ×, ÷, ^, add, sub, mul, div, pow. ➡ linear: add, sub, real, imag, conj, abs, arg, nrm, acc, scl. ➡ functions: inv, sqrt, invsqrt, exp, log, pow, (a)cos(h), (a)sin(h), (a)tan(h), (a)cot(h), erf(c). ➡ special: scalar, eval, deriv(atives), poisson ➡ high-level: axpb, axpbypc, axypb, axypbzpc, ax2pby2pcz2, axypbvwpc,
 axpsqrtbpcx2, logaxpsqrtbpcx2 logxdy ➡ I/O: read, write, print. ➡ monomial ⟺ index: get_idx, get_idx_sparse, get_mono. ✓monomial module to manipulate monomials. ๏ DAmap operations in ℝ & ℂ ➡ getter/setter: get0/set0 (vector), get1/set1 (matrix). ➡ operators: +, −, ×, ÷, ^, add, sub, mul, div, pow(n). ➡ special: setvar (vector+Id), eval, translate (+, −), compose (×), inv (÷), pinv (partial ÷). ➡ I/O: read, write, print.

= log (ax + b + cx2), = log (

x y) .

= [x, y] = ∑n

i=1 ∂x ∂qi ∂y ∂pi − ∂x ∂pi ∂y ∂qi .

slide-96
SLIDE 96

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA and DAmap operations

41

๏ GTPSA operations in ℝ & ℂ ➡ getter/setter: get0/set0, get/set, get_sparse/set_sparse, getvec/setvec, clear, etc… ➡ operators: +, −, ×, ÷, ^, add, sub, mul, div, pow. ➡ linear: add, sub, real, imag, conj, abs, arg, nrm, acc, scl. ➡ functions: inv, sqrt, invsqrt, exp, log, pow, (a)cos(h), (a)sin(h), (a)tan(h), (a)cot(h), erf(c). ➡ special: scalar, eval, deriv(atives), poisson ➡ high-level: axpb, axpbypc, axypb, axypbzpc, ax2pby2pcz2, axypbvwpc,
 axpsqrtbpcx2, logaxpsqrtbpcx2 logxdy ➡ I/O: read, write, print. ➡ monomial ⟺ index: get_idx, get_idx_sparse, get_mono. ✓monomial module to manipulate monomials. ๏ DAmap operations in ℝ & ℂ ➡ getter/setter: get0/set0 (vector), get1/set1 (matrix). ➡ operators: +, −, ×, ÷, ^, add, sub, mul, div, pow(n). ➡ special: setvar (vector+Id), eval, translate (+, −), compose (×), inv (÷), pinv (partial ÷). ➡ I/O: read, write, print.

= log (ax + b + cx2), = log (

x y) .

= [x, y] = ∑n

i=1 ∂x ∂qi ∂y ∂pi − ∂x ∂pi ∂y ∂qi .

~6000 lines in C ~2500 lines in MAD

slide-97
SLIDE 97

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA performance (vs. Berz and Yang)

42

  • Fig. 5: Relative performance of the multiplications.
  • Fig. 4: Relative performance of multiplication at or-

der 2 when using GTPSA with 6 variables and many knobs vs. homogeneous TPSA.

  • Fig. 2: Relative performance of indexing functions.
  • Fig. 6: Relative performance of the compositions.
slide-98
SLIDE 98

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva 23, laurent.deniau@cern.ch

GTPSA performance (vs. Berz and Yang)

42

  • Fig. 5: Relative performance of the multiplications.
  • Fig. 4: Relative performance of multiplication at or-

der 2 when using GTPSA with 6 variables and many knobs vs. homogeneous TPSA.

  • Fig. 2: Relative performance of indexing functions.
  • Fig. 6: Relative performance of the compositions.

The smaller the better!

slide-99
SLIDE 99

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

MAD ecosystem

43 MAD-NG Core (VM+JIT+FFI) Linear ToolBox Real & Complex Vector & Matrix Algorithms Solvers, Eigen, FFT, Optimisers DA Toolbox Real & Complex GTPSA MADX Env Elements Sequence Beam Object Model MTable Plot Commands Survey Track COFind Twiss Match DA Map Geometric 3D Maps Symplectic Integrators Unit Tests Dynamic 6D Maps Emit

2020

IBS

2020

COCorrect

2019

Spin Maps

2020?

Radiation

2019?

Normal form Optical Funs

2019

Aperture A uses B A B A exposes B A B A is-a B A B Geo/LinAlg Dyn/DiffAlg Objects

Legend

Todo Done Dev Commands

slide-100
SLIDE 100

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch 44 MAD-NG Core (VM+JIT+FFI) Linear ToolBox Real & Complex Vector & Matrix Algorithms Solvers, Eigen, FFT, Optimisers DA Toolbox Real & Complex GTPSA MADX Env Elements Sequence Beam Object Model MTable Plot Commands Survey Track COFind Twiss Match DA Map Geometric 3D Maps Symplectic Integrators Unit Tests Dynamic 6D Maps Emit

2020

IBS

2020

COCorrect

2019

Spin Maps

2020?

Radiation

2019?

Normal form Optical Funs

2019

Aperture A uses B A B A exposes B A B A is-a B A B Geo/LinAlg Dyn/DiffAlg Objects

Legend

Todo Done Dev Commands

THE END

slide-101
SLIDE 101

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch 45

Extra slides

slide-102
SLIDE 102

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Hamiltonian splitting overview

46

slide-103
SLIDE 103

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Hamiltonian splitting overview

46

Elements Infos Selection Thick Kick Fringe Attributes DRIFT l>0, thick

  • strex_drift

none none none MULTIPOLE l=0, thin h=0 none strex_kick none angle, knl, ksl h≠0 none strex_kickh none +lrad SBEND l>0, h≠0 DKD curex_drift curex_kick curex_fringe angle, k0, k0s, k1, k1s, k2, k2s, knl, ksl TKT sbend_thick sbend_kick curex_fringe RBEND (true) l>0, h=0 DKD strex_drift strex_kick strex_fringe k0, k0s, k1, k1s, k2, k2s, knl, ksl TKT rbend_thick rbend_kick strex_fringe QUADRUPOLE l>0, h=0 DKD strex_drift strex_kick strex_fringe angle, k0, k0s, k1, k1s, k2, k2s, knl, ksl MKM TKT quad_thick quad_kick strex_fringe MKM TKT, k1s≠0 quad_thicks quad_kicks strex_fringe MKM TKT, h≠0 quad_thickh quad_kickh strex_fringe SEXTUPOLE l>0, h=0 DKD strex_drift strex_kick strex_fringe k2, k2s, knl, ksl MKM TKT quad_thick quad_kick strex_fringe OCTUPOLE l>0, h=0 DKD strex_drift strex_kick strex_fringe k3, k3s, knl, ksl MKM TKT quad_thick quad_kick strex_fringe DECAPOLE l>0, h=0 DKD strex_drift strex_kick strex_fringe k4, k4s, knl, ksl MKM TKT quad_thick quad_kick strex_fringe DODECAPOLE l>0, h=0 DKD strex_drift strex_kick strex_fringe k5, k5s, knl, ksl MKM TKT quad_thick quad_kick strex_fringe KICKERS l>0, h=0 DKD strex_drift strex_kick strex_fringe hkick, vkick, kick, knl, ksl MKM TKT quad_thick quad_kick strex_fringe SOLENOID l>0 TKT, ksi=0 strex_drift strex_kick strex_fringe ks, ksi, knl, ksl TKT, ksi≠0 solen_thick strex_kick strex_fringe ELSEPARATOR l>0 TKT, exl,eyl=0 strex_drift strex_kick strex_fringe ex, ey, exl, eyl, knl, ksl TKT, exl,eyl≠0 esept_thick strex_kick strex_fringe RFCAVITY l>0, DKD V=0 strex_drift strex_kick strex_fringe volt, freq, lag, harmon, knl, ksl V≠0 strex_drift rfcav_kick rfcav_fringe nmul≠0, nbsl≠0 strex_drift rfcav_kickn rfcav_fringe +n_bessel

slide-104
SLIDE 104

BE

Beams Department Laurent Deniau, CERN BE/ABP, 1211 Geneva, laurent.deniau@cern.ch

Hamiltonian splitting overview

46

Elements Infos Selection Thick Kick Fringe Attributes DRIFT l>0, thick

  • strex_drift

none none none MULTIPOLE l=0, thin h=0 none strex_kick none angle, knl, ksl h≠0 none strex_kickh none +lrad SBEND l>0, h≠0 DKD curex_drift curex_kick curex_fringe angle, k0, k0s, k1, k1s, k2, k2s, knl, ksl TKT sbend_thick sbend_kick curex_fringe RBEND (true) l>0, h=0 DKD strex_drift strex_kick strex_fringe k0, k0s, k1, k1s, k2, k2s, knl, ksl TKT rbend_thick rbend_kick strex_fringe QUADRUPOLE l>0, h=0 DKD strex_drift strex_kick strex_fringe angle, k0, k0s, k1, k1s, k2, k2s, knl, ksl MKM TKT quad_thick quad_kick strex_fringe MKM TKT, k1s≠0 quad_thicks quad_kicks strex_fringe MKM TKT, h≠0 quad_thickh quad_kickh strex_fringe SEXTUPOLE l>0, h=0 DKD strex_drift strex_kick strex_fringe k2, k2s, knl, ksl MKM TKT quad_thick quad_kick strex_fringe OCTUPOLE l>0, h=0 DKD strex_drift strex_kick strex_fringe k3, k3s, knl, ksl MKM TKT quad_thick quad_kick strex_fringe DECAPOLE l>0, h=0 DKD strex_drift strex_kick strex_fringe k4, k4s, knl, ksl MKM TKT quad_thick quad_kick strex_fringe DODECAPOLE l>0, h=0 DKD strex_drift strex_kick strex_fringe k5, k5s, knl, ksl MKM TKT quad_thick quad_kick strex_fringe KICKERS l>0, h=0 DKD strex_drift strex_kick strex_fringe hkick, vkick, kick, knl, ksl MKM TKT quad_thick quad_kick strex_fringe SOLENOID l>0 TKT, ksi=0 strex_drift strex_kick strex_fringe ks, ksi, knl, ksl TKT, ksi≠0 solen_thick strex_kick strex_fringe ELSEPARATOR l>0 TKT, exl,eyl=0 strex_drift strex_kick strex_fringe ex, ey, exl, eyl, knl, ksl TKT, exl,eyl≠0 esept_thick strex_kick strex_fringe RFCAVITY l>0, DKD V=0 strex_drift strex_kick strex_fringe volt, freq, lag, harmon, knl, ksl V≠0 strex_drift rfcav_kick rfcav_fringe nmul≠0, nbsl≠0 strex_drift rfcav_kickn rfcav_fringe +n_bessel

Reviewed to improve PTC compatibility (ptcmodel),
 writing test suites (~million of tests), adding missing physics. MAD-NG has now ~3000 lines of physics and will continue to grow…