Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to add a new method for Jacobians #19

Open
JoseRuedaRueda opened this issue Dec 16, 2024 · 0 comments
Open

Need to add a new method for Jacobians #19

JoseRuedaRueda opened this issue Dec 16, 2024 · 0 comments

Comments

@JoseRuedaRueda
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant