Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "DiffEqPhysics"
uuid = "055956cb-9e8b-5191-98cc-73ae4a59e68a"
version = "3.16.0"
version = "3.17.0"
authors = ["Chris Rackauckas <accounts@chrisrackauckas.com>"]

[deps]
Expand All @@ -21,7 +21,7 @@ ForwardDiff = "0.10, 1"
RecipesBase = "0.7, 0.8, 1.0"
RecursiveArrayTools = "1, 2, 3, 4"
Reexport = "0.2, 1.0"
SciMLBase = "1.73, 2"
SciMLBase = "2, 3"
StaticArraysCore = "1.4"
julia = "1.6"

Expand Down
2 changes: 1 addition & 1 deletion src/DiffEqPhysics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using ForwardDiff: ForwardDiff
using StaticArraysCore: StaticArraysCore
using RecipesBase: RecipesBase, @recipe, @series
using SciMLBase: SciMLBase, NullParameters, ODEProblem, DynamicalODEFunction,
isinplace, AbstractDynamicalODEProblem, numargs, DESolution,
isinplace, AbstractDynamicalODEProblem, numargs, AbstractODESolution,
TooManyArgumentsError, TooFewArgumentsError, FunctionArgumentsError

include("hamiltonian.jl")
Expand Down
4 changes: 2 additions & 2 deletions src/plot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ end
Plot the orbits from an N-body simulation solution using Plots.jl recipes.

# Arguments
- `sol`: A `DESolution` from solving an N-body problem
- `sol`: A `SciMLBase.AbstractODESolution` from solving an N-body problem
- `body_names`: Optional vector of names for each body (defaults to "orbit 1", "orbit 2", etc.)
- `dim`: Dimension of the plot, either `2` or `3` (default: `3`)
- `kwargs...`: Additional keyword arguments passed to the plot recipe

# Returns
A plot object showing the trajectories of all bodies.
"""
function orbitplot(sol::DESolution; body_names = nothing, dim = 3, kwargs...)
function orbitplot(sol::AbstractODESolution; body_names = nothing, dim = 3, kwargs...)
return RecipesBase.plot(OrbitPlot(sol, body_names, dim); kwargs...)
end

Expand Down
4 changes: 2 additions & 2 deletions test/nbody_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ using RecursiveArrayTools

# Make sure the distances from the sun stay small enough
f = (x, y, z, j) -> sqrt((x[1] - x[j])^2 + (y[1] - y[j])^2 + (z[1] - z[j])^2)
for i in 1:length(sol)
x, y, z = sol[i].x[1].x
for i in 1:length(sol.u)
x, y, z = sol.u[i].x[1].x
@test f(x, y, z, 2) < 6
@test f(x, y, z, 3) < 10.5
@test f(x, y, z, 4) < 21
Expand Down
Loading