Skip to content

Tracking with wrong sign for R_ref gives NaN with no message #223

@DavidSagan

Description

@DavidSagan

Test program:

using BeamTracking
using Beamlines

@eles begin
  q = Drift(L = 1, tracking_method = Exact())
end

bb = Beamline([q], R_ref = -1e7, species_ref = Species("electron"))

v1 = [0.0  0.0  0.0  0.0  0.0  0.0]

b1 = Bunch(deepcopy(v1), species=Species("electron"), R_ref = -1e7)
track!(b1, q)
println(b1.coords.v)

b2 = Bunch(deepcopy(v1), species=Species("electron"), R_ref = 1e7)
track!(b2, q)
println(b2.coords.v)

Output is:

julia> include("local/z.jl")
[0.0 0.0 0.0 0.0 0.0 0.0]
[0.0 0.0 0.0 0.0 NaN 0.0]

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions