bifurcationkit / BifurcationKit.jl

A Julia package to perform Bifurcation Analysis
https://bifurcationkit.github.io/BifurcationKitDocs.jl/stable
Other
288 stars 34 forks source link

BK question #144

Open gacarita opened 3 months ago

gacarita commented 3 months ago

Hi there,

I would like to ask if it is possible to use this library to find periodic orbits based on a set of initial conditions for fixed parameters. My problem is quite simple ... planar dynamics of the restricted circular 3body problem (4 odes). I have found a few examples, but not exactly what I want. In my case, instead of obtaining those solutions for a given parameter, I want to fix this parameter and vary the initial conditions such as x, y, vx, vy in order to obtain those families. is it possible by BK ?

rveltz commented 3 months ago

I am not sure I understand your problem. If you have a dynamical systems du/dt = F(u,p), the periodic orbits are not functions of initial conditions. Translating your questions to equilibria, your questions is a bit like "how the zeros of F(u,p) depend on initial conditions of the ODE?" : they do not.

gacarita commented 3 months ago

Hi,

I apologize for any confusion. I am new to the field of bifurcation analyses. Let me attempt to explain this in another way.

Suppose I have four ordinary differential equations that, when numerically solved, provide the position and velocity of my particle (x, y, vx, vy). In this scenario, I aim to compute the periodic orbits of this system in terms of position and velocity. My specific question is whether the BifurcationKit can address the following inquiry: For a given position x, which velocity vy results in a periodic orbit?

rveltz commented 3 months ago

Yes, if you give a velocity vy close to the solution, BK will be able to find the locally unique vy which gives a periodic solution. You can use shooting or collocation for this. You will then be able to continue the periodic orbit as function of x

gacarita commented 3 months ago

Ok. Thank you.

I couldn't find any examples similar to this. Could you assist me in creating a relatively simple case just to understand how this works for this case?

@inline @inbounds function cr3bp_rhs(du,u,p,t)

μ = p

x = u[1]
y = u[2]
vx = u[3]
vy = u[4]

r1 = ((x + μ)^2 + y^2)^(1/2)
  r2 = ((-1 + x + μ)^2 + y^2)^(1/2)

du[1] = vx
  du[2] = vy
  du[3] =  2*vy  + x - (1 - μ)*(μ + x)/(r1^3) - μ*(-1 + μ + x)/(r2^3) 
  du[4] = -2*vx  + y - (1 - μ)*y/(r1^3)       - μ*y/(r2^3)
end

# parameter values
par_tm = (μ=0.01,)

Do I need to create BifurcationProblem for collocation ? For shooting just the flow ?

rveltz commented 3 months ago

Your problem is a bit specific (you have energy conservation, etc). Do you have a paper where your method is explained?

gacarita commented 3 months ago

The paper on the link below is a recent one which describe some of the methods used. In general they are based on the monodromy matrix. In this case we can compute the velocity vy in function of one of the integrals of motion of the problem which is the jacobi cte.

https://link.springer.com/article/10.1007/s10569-021-10020-0

rveltz commented 3 months ago

Did you find a way to use BifurcationKit?

gacarita commented 3 months ago

Hi there,

I'm giving some attention to it but not so much progress yet. That might be possible to use it ... but at first glance I thought it could be easier, I'm not a JULIA expert so sometimes the language sounds a little bit too complex to me.

I'll keep trying a few hours every week to see if I can do it.