Page 1 of 1

Problem about Orbital Period and Rotation Period

Posted: 24.01.2007, 02:22
by Cham
I'm setting a white dwarf binary to place some of my recent magnetic field models, and I'm experiencing an old problem again with the orbital Period and the RotationPeriod. Whatever what I'm doing, after few years, I get a major misalignment between the stars and their bulges, and also with the CMOD object which should be rotating rigidly with the stars. Here's the STC code I'm using :

Code: Select all

# Two fictious white dwarfs of mass M_A = 1.2 Sol and M_B = 0.8 Sol, rotating around their
# barycenter with a period of 13 min.
# White dwarfs are stars which could have a very strong dipolar magnetic field.

Barycenter "Magnetic Dwarfs 1"
{
   RA  120.1064444      # 08h 06min 23.20sec
   Dec  15.4583888889   # 15deg 27min 30.20
   Distance  1000      # arbitrary
}

"Magnetic Dwarf 1A" # component A
{
   SpectralType "WC"
   AbsMag  8.9
   SemiAxes [1 0.9 0.9]

   OrbitBarycenter "Magnetic Dwarfs 1"
        EllipticalOrbit {
      Period             0.0000247325     # 13 min
      SemiMajorAxis      8.5561497326e-4  # 128000 km, mass ratio 3:2
      MeanAnomaly        0
   }

   RotationPeriod 0.216805095  # 13 min
}

"Magnetic Dwarf 1B" # component B
{
   SpectralType "WC"
   AbsMag 8.9
   SemiAxes [1 0.9 0.9]

   OrbitBarycenter "Magnetic Dwarfs 1"
        EllipticalOrbit {
      Period             0.0000247325  # 13 min
      SemiMajorAxis      0.0012834225  # 192000 km, mass ratio 3:2
      MeanAnomaly        180
   }

   RotationPeriod 0.216805095  # 13 min
}


Here's the SSC code :

Code: Select all

"Magnetic field lines" "Magnetic Dwarfs 1"
{
   Class "spacecraft"
   Mesh "antidipoles.cmod"
   Emissive true
   Albedo 0
   Radius 640000

   EllipticalOrbit {
      Period   9E12
      SemiMajorAxis   0
   }

   Orientation [-90 1 0 0]
   Obliquity 0
   RotationPeriod 0.216805095
}


If I accelerate time for some years, the SSC model gets a misalignment relative to the stars, like what is shown below. How can I correct that ?

Image

I'm tired of these kind of problems with Celestia. Something has to be done ! :x

Posted: 24.01.2007, 04:30
by Cham
Chris,

there's something I don't understand here. My orbital period is set to 0.0000247325 years. The RotationPeriod is then EXACTLY

RotationPeriod = (0.0000247325)*(365.25)*(24) == 0.216805095 hrs.

There is no roundings here. So why the rotating model doesn't keep up with the moving stars ? Internally, is Celestia using 1 year = 365.25 days or what ?

Posted: 24.01.2007, 09:09
by chris
I think that I've found the problem . . . Celestia is using double precision values for the orbital period, but only single precision for rotation periods. This drift shown up before because orbital periods are normally considerably longer than 13 minutes and so it takes a long time to notice it. I think that using double precision for the rotation period should fix the problem.

--Chris

Posted: 24.01.2007, 09:37
by chris
The problem was in fact that rotation periods were stored internally as single precision floats. I modified some files so that doubles are used instead and the misalignment no longer appears when I accelerate time. I've committed the fix to CVS; if you're able to build the CVS version, please verify the fix when you get a chance.

Thanks for reporting this one. It's subtle, and I confirmed that prior to the fix, the orientation of synchronous rotators in the solar system would drift slowly over long time spans (albeit long outside the span when the orbital theories were valid.)

--Chris

Posted: 24.01.2007, 15:57
by Cham
Thanks, Chris. :D

I'll build a fresh Celestia from CVS today and make a report later.

Posted: 24.01.2007, 16:15
by Cham
Report :

Updated.

Recompiled.

Checked.

DONE !

:D

Posted: 24.01.2007, 16:30
by buggs_moran
chris wrote:I think that I've found the problem . . . Celestia is using double precision values for the orbital period, but only single precision for rotation periods. This drift shown up before because orbital periods are normally considerably longer than 13 minutes and so it takes a long time to notice it. I think that using double precision for the rotation period should fix the problem.

--Chris


Well, that should solve some of my problems on my accretion disk/gas streams that I was having a while ago... Awesome!