Comments (7)
Hi,
Please provide a Minimal Working Example, i.e., a code that can run and produce this error. This helps me produce the error.
from dynamicalsystems.jl.
(also, please do not ignore the issue template. It is there for a reason: to solve your bug faster. This means, you should also report the versions that you used)
from dynamicalsystems.jl.
Here is the code i'm using
using DataFrames, DifferentialEquations, DynamicalSystems, Plots
@inline @inbounds function vy0(C,p,v)
"""
Initial Velocity for cte jacobi conservation
in:
C = cte jacobi
v = position and velocities of the particle
cartesian coordinates
p = mass ratio parameter == μ2
out:
ydot = velocity in y
"""
x, y, x̂= v
μ = p
#distance vectors
r1 = sqrt((x+μ)^2 + y^2)
r2 = sqrt((x - (1-μ))^2 + y^2)
ŷ = sqrt(x^2 + y^2 - x̂^2 + 2*((1-μ)/r1 + μ/r2) - C)
if x > 0
return -ŷ
end
if x < 0
return ŷ
end
end
@inline @inbounds function eom!(du,u,p,t)
"""
Planar Circular Restricted 3body problem
Equations of motion in co-rotating frame
in:
u = position and velocities of the particle
cartesian coordinates
x = u[1]
y = u[2]
vx = u[3]
vy = u[4]
p = mass ratio parameter == μ2
t = time span
out:
du = integration of the acel. and vel.
"""
local μ = p
#cartesian coordinates
x = u[1]
y = u[2]
vx = u[3]
vy = u[4]
r1 = sqrt((x + μ)^2 + y^2)
r2 = sqrt((x - (1-μ))^2 + y^2)
du[1] = vx # F1
du[2] = vy # F2
du[3] = 2*vy + x - (1 - μ)*(μ + x)/(r1^3) - μ*(x -(1-μ))/(r2^3) # F3
du[4] = -2*vx + y - ((1 - μ)/(r1^3) + μ/(r2^3))*y # F4
return
end
p=0.07
x0=-1.24
y0=0.19
vx0=0
vyu = vy0(-1.2,p,[x0,y0,vx0])
u0 = [x0,y0,vx0,vyu]
plane = (3, 0.0)
ds = ContinuousDynamicalSystem(eom!, u0, p)
psos = poincaresos(ds, plane, 6000.0; u0 = u0,direction = 0,rootkw = (xrtol = 1e-9, atol = 1e-9),
diffeq = (alg = Vern9()))
scatter(psos[:, 1], psos[:, 2]; markersize = 2.0)
#code works fine until here
pvalues = collect(0.1:0.15:201)
i = Int(1)
plane = (3, 0.0)
tf = 200.0
p_index = 1
output = produce_orbitdiagram(ds, plane, i,pvalues;
tfinal = tf, Ttr = 200.0)
from dynamicalsystems.jl.
The call signature for produce_orbitdiagram
is:
You only provide 4 positional arguments, you miss p_index
.
from dynamicalsystems.jl.
Sorry i missed that part when i shared the code, however even setting p_index=1 in to the output
output = produce_orbitdiagram(ds, plane, i,p_index,pvalues;
tfinal = tf, Ttr = 200.0)
I still get an error
no method matching setindex!(::Float64, ::Float64, ::Int64)
from dynamicalsystems.jl.
I see. Well it's because your parameter "container" isn't a container, but a number, p=0.07
. Do p = [0.07]
instead. Numbers are not mutable, but vectors are.
from dynamicalsystems.jl.
Gotcha. Thank you.
from dynamicalsystems.jl.
Related Issues (20)
- Add a note on the package versioning in the docs
- DynamicalSystems.jl 3.0 redesign HOT 3
- Recurrence analysis does not work anymore HOT 2
- Support for Complex number equations? HOT 3
- need support for Interactive Trajectory Evolution in unpredefined systems HOT 1
- integrator-using functions should return NaN on non-successful integrator steps HOT 24
- FYI: font glitches - a very minor issue and probably slightly off-topic... HOT 2
- basins_of_attraction fails at simple system (easy fix) HOT 22
- Extreme events functionality /ies HOT 14
- Delayed Differential Equations HOT 1
- PSA: DynamicalSystems.jl will become a multirepo on v3.0 HOT 3
- Early Warning Signals / Resilience Indicators / Regime Shift Identifiers / Transition Identifiers and related resources HOT 5
- t0 definition leads to unexpected behaviour with trajectory() HOT 2
- Method `recursivecopy!(::Matrix{Float64}, ::Vector{SVector{2, Float64}})` does not exist HOT 2
- Yes: again: "Failed to precompile due to DiffEqBase #163" HOT 15
- reinit! error for parallel integrator and in-pace equations of motion HOT 2
- Unclear description of Joint recurrence plot functions (in RecurrenceAnalysis.jl) HOT 4
- GPU and FPGA support? HOT 4
- Passing a ModelingToolkit system to a ContinuousDynamicalSystem HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dynamicalsystems.jl.