Skip to content

Need to add a new method for Jacobians #19

@JoseRuedaRueda

Description

@JoseRuedaRueda

New OrbitPath function needed

Problem description

When using the orbit_grid function from the OrbitTomography package, the code fails if you try to calculate the jacobians, because the OrbitTomography Package calls OrbitPath(o.path,jacdets), and there is no function ready to handle an Orbit Path and an array

Proposed solution

Modify lines 134 to 35 of src/orbit.jl as:

struct OrbitPath{T}
    vacuum::Bool
    drift::Bool
    energy::Vector{T}
    pitch::Vector{T}
    r::Vector{T}
    z::Vector{T}
    phi::Vector{T}
    dt::Vector{T}
    J::Vector{T}
end

function OrbitPath(T::DataType=Float64; vacuum=false,drift=false)
    OrbitPath(vacuum,drift,T[],T[],T[],T[],T[],T[])
end

function OrbitPath(path::OrbitPath; jac::Vector{T})
    path.J = jac
    return path
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions