Problem about Orbital Period and Rotation Period

General discussion about Celestia that doesn't fit into other forums.
Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Problem about Orbital Period and Rotation Period

Post #1by Cham » 24.01.2007, 02:22

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
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #2by Cham » 24.01.2007, 04:30

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 ?
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #3by chris » 24.01.2007, 09:09

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

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #4by chris » 24.01.2007, 09:37

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

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #5by Cham » 24.01.2007, 15:57

Thanks, Chris. :D

I'll build a fresh Celestia from CVS today and make a report later.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #6by Cham » 24.01.2007, 16:15

Report :

Updated.

Recompiled.

Checked.

DONE !

:D
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

buggs_moran
Posts: 835
Joined: 27.09.2004
With us: 20 years 1 month
Location: Massachusetts, USA

Post #7by buggs_moran » 24.01.2007, 16:30

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!
Homebrew:
WinXP Pro SP2
Asus A7N8X-E Deluxe
AMD Athlon XP 3000/333 2.16 GHz
1 GB Crucial RAM
80 GB WD SATA drive
ATI AIW 9600XT 128M


Return to “Celestia Users”