Skip to content

Commit

Permalink
Merge pull request #7 from jared711/patch-1
Browse files Browse the repository at this point in the history
Make V and W initialization more general
  • Loading branch information
duncaneddy authored Mar 31, 2020
2 parents b69a50f + 8898c1a commit 2f78993
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/orbit_dynamics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ function spherical_harmonic_gravity(r::Array{<:Real, 1}, coef::Array{<:Real, 2},
z0 = r_ref * r[3] / r_sqr

# Initialize Intermediary Matrices
V = zeros(Float64, n_max+2, n_max+2)
W = zeros(Float64, n_max+2, n_max+2)
V = zeros(eltype(r), n_max+2, n_max+2)
W = zeros(eltype(r), n_max+2, n_max+2)

# Calculate zonal terms V(n, 0). Set W(n,0)=0.0
V[0+1, 0+1] = r_ref /sqrt(r_sqr)
Expand Down Expand Up @@ -727,4 +727,4 @@ function accel_relativity(x::Array{<:Real, 1})
a_rel = GM_EARTH/r2 * ( (4*GM_EARTH/(c2*norm_r) - v2/c2)*er + 4*v2/c2*dot(er, ev)*ev)

return a_rel
end
end

0 comments on commit 2f78993

Please sign in to comment.