I'm trying to find a method to detect from orbital parameters (period, eccentricity, semi-major axis...) planets that are in resonance.
I know that if the ratio between two planets is commensurable, this means that they are in resonance, but suppose I want to know IN WHICH resonance they are, how can I do it?
For instance, I have my matrix of N planets and periods. How can I create a loop to check if and in which resonance the planets are?
Something like:
for i=1, N
P(i)/P(i-1)=m
if m (check the resonance condition) then
write (planets parameters)
end if
end for
Thanks a lot.
I make this program, I have a 2xN matrix in which the columns are the ID of planets and their period, the rows are the number of planets, for instance something like that:
1 0.44
1 0.8
1 0.9
2 0.9
2 1.2
3 2.0
3 3.0
The trick to change from one system of planet to the other is to rename all the planets of a system with the same number and the planets of other system with another number so, I can be able to change the resonance condition from one system to another one.
The program is simple:
- read the file and save the columns and rows numbers,
- create and save a matrix of col*row objects,
- save as a vector the `name` and `period` of planets,
- start the cycle:
for r=1,row <--- THIS MUST READ all the file
if (difference in name = 0.) then start the resonance find criterion
for l = 0,4 (number of planet in each system: THIS MUST BE MODIFIED !!)
for i = 1,5
for j = 1,5
if (i*period(l)-j*period(l+1) eq 0) <- RESONANCE CONDITION !!!
then write on file
end for
end for
end for
else write a separation between the first set and second set of planets !
end for
This is the IDL code I wrote:
pro resfind
file = "data.dat"
rows =File_Lines(file) ; per le righe
openr,lun,file,/Get_lun ; per le colonne
line=""
readf,lun,line
cols = n_elements(StrSplit(line, /RegEx, /extract))
openr,1,"data.dat"
data = dblarr(cols,rows)
readf,1,data
close,1
name = data(0,*)
period = data(1,*)
openw,2,"find.dat"
for r = 0, rows-2 DO BEGIN ;
if (name(r)-name(r+1) EQ 0) then begin
for l = 0,rows-2 do begin
for j = 1,4 do begin
for i = 1,4 do begin
if (abs(i*period(l)-j*period(l+1)) EQ 0.) then begin
printf,2, 'i resonance:', i , ' j resonance:',j,' planet ID:',l,' planet ID:',l+1
endif
endfor
endfor
endfor
endif else begin
printf,2, ' '
endfor
close,2
end
PROBLEMS:
- I can't understand how to eliminate the multiply of resonance (2:4, 3:6 and so on);
- in the second for loop (the one with the planet) the number of planets must be change every time but I don't understand how to change this.