• Perihelion advance of the moon

    From maxkeon887@gmail.com@21:1/5 to All on Tue Apr 20 21:24:36 2021
    My proposal that perihelion advance rates are proportional to m/M*180, gforce(m)/gforce(M)*180, orbitrad(M)/orbitrad(m)*180 (relative to the barycenter), etc. is reinforced by the attached Qbasic program.

    The program is designed to demonstrate the perihelion advance rate of
    the moon in orbit around the earth.

    According to m/M*180 the moon will advance by 2.217 degrees per orbit
    cycle. Since the observed advance is a little more than 3 degrees per
    cycle, the sun's influence on the earth/moon system must account for
    roughly .8 degrees per cycle. And that's exactly what it does.

    Setting the moon average orbit radius at 4e8 meters, with an orbit
    speed of 900 m/sec at aphelion, gives an orbit eccentricity of .12
    and an advance rate of .794 degrees per cycle.

    For obvious reasons the advance is orbit eccentricity dependent to
    some degree. It doesn't alter the outcome much though. i.e. For an
    eccentricity of .2 the advance rate is .82 degrees per cycle.

    With an aphelion speed of 300m/sec, eccentricity is greater than .9
    and the advance rate is 2.2 degrees per cycle.

    image here ---------

    ---------

    The program will run in Qbasic if inkey is replaced with INKEY$, time
    is changed to TIME$ and chr(??) is replaced with CHR$(??).
    No $ exists in FreeBasic.

    Compiling to an .exe file with FreeBasic
    (1)Copy the program off the screen.
    (2)Paste it into Notepad.
    (3)Save it with a .bas extension. e.g. peri.bas stored in the c: directory. (4)Download and instal FreeBasic.
    (5)Drag open-console.exe to desktop from c:\Program Files\FreeBasic
    and create shortcut.
    (6)Double click the icon.
    (7)At the prompt type fbc c:\peri.bas
    (8)Your .exe file will be stored in the c: directory.

    '---Program start---
    DIM c AS DOUBLE: DIM G AS DOUBLE: DIM AU AS DOUBLE
    DIM xE AS DOUBLE: DIM yE AS DOUBLE: DIM vxE AS DOUBLE
    DIM vyE AS DOUBLE: DIM ME AS DOUBLE: DIM mu3 AS DOUBLE
    DIM xM AS DOUBLE: DIM yM AS DOUBLE: DIM vxM AS DOUBLE
    DIM vyM AS DOUBLE: DIM MM AS DOUBLE: DIM lastrad AS DOUBLE
    DIM mu1 AS DOUBLE: DIM dt AS SINGLE: DIM radius AS DOUBLE
    DIM f2 AS SINGLE: DIM p AS SINGLE: DIM accME AS DOUBLE
    DIM accEM AS DOUBLE: DIM distMS AS DOUBLE: DIM accMS AS DOUBLE
    DIM distES AS DOUBLE: DIM accES AS DOUBLE: DIM axME AS DOUBLE
    DIM ayME AS DOUBLE: DIM axMS AS DOUBLE: DIM ayMS AS DOUBLE
    DIM axM AS DOUBLE: DIM ayM AS DOUBLE: DIM ayE AS DOUBLE
    DIM colr AS SINGLE: DIM xS AS DOUBLE: DIM yS AS DOUBLE
    DIM MS AS DOUBLE: DIM axE AS DOUBLE: DIM ayEM AS DOUBLE
    DIM axEM AS DOUBLE: DIM axES AS DOUBLE: DIM vxS AS DOUBLE
    DIM vyS AS DOUBLE: DIM accSM AS DOUBLE: DIM axSM AS DOUBLE
    DIM aySM AS DOUBLE: DIM ayES AS DOUBLE: DIM axSE AS DOUBLE
    DIM aySE AS DOUBLE: DIM accSE AS DOUBLE: DIM axS AS DOUBLE
    DIM ayS AS DOUBLE: DIM perirad AS DOUBLE: DIM aphrad AS DOUBLE
    DIM inc AS SINGLE: DIM ecc AS SINGLE: DIM ss AS STRING
    DIM rnew AS DOUBLE: DIM xE2 AS DOUBLE: DIM xS2 AS DOUBLE
    DIM yE2 AS DOUBLE: DIM yS2 AS DOUBLE: DIM su AS STRING
    DIM x AS SINGLE: DIM a AS DOUBLE: DIM st AS STRING
    DIM ti AS DOUBLE: DIM f1 AS SINGLE: DIM axMM AS DOUBLE
    DIM ayMM AS DOUBLE: DIM accMM AS DOUBLE: DIM sd AS DOUBLE
    DIM Mearth AS DOUBLE: DIM Mmoon AS DOUBLE: DIM Msun AS DOUBLE
    DIM dts AS SINGLE

    SCREEN 12

    PRINT " _Determining the program run speed_"
    xa:
    ss = time
    IF ss <> st THEN
    x = x + 1
    st = ss
    END IF
    IF x = 6 THEN mu3 = a: GOTO xb
    IF x > 1 THEN a = a + 1
    CIRCLE (10 + a / 6000, 20), 1
    GOTO xa
    xb:

    dt = INT(20000000 / mu3)

    CLS
    G = .0000000000667#
    AU = 150000000000#

    xE = AU
    yE = 0
    vxE = 0
    vyE = 29780
    Mearth = 5.97D+24 ' earth mass

    GOTO an
    am:

    LOCATE 26, 1
    rnew = 4E+08
    PRINT " Average orbit radius for the moon is 4e8 meters."
    PRINT " Press any key to continue, or 'c' to change radius."
    DO: ss = inkey: LOOP UNTIL ss <> ""
    CLS

    IF ss = "c" THEN
    LOCATE 25, 1
    INPUT " Enter new orbit radius (e.g. 8e8 with v = 500)"; rnew
    END IF

    LOCATE 26, 1
    IF rnew = 0 THEN END
    PRINT " Orbital speed for a concentric orbit is"; 4E+08 / rnew * 1000
    INPUT " Moon's orbital speed at aphelion (=< concentric)"; vyM
    IF vyM = 0 THEN END

    aphrad = rnew * 1000 / vyM

    xM = aphrad + AU
    yM = 0
    vxM = 0
    vyM = vyE - vyM ' Aphelion start
    Mmoon = 7.342D+22 ' moon mass

    xS = 0
    yS = 0
    vxS = 0
    vyS = 0
    Msun = 1.99D+30 ' sun mass

    PRINT " ____Escape exits____"

    CIRCLE (230, 240), 6, 11 'Earth
    colr = 1
    lastrad = 1D+26
    LOCATE 2, 1: PRINT " Press z to halve the graphics scale."
    mu1 = .0000003 'graphics multiplier

    aa:
    radius = SQR((xM - xE) ^ 2 + (yM - yE) ^ 2)
    'radius from moon to earth
    IF radius > 2E+11 THEN END
    '---

    'ME = moon to earth
    accME = -G * Mearth / radius ^ 2
    axME = accME * ((xM - xE) / radius)
    ayME = accME * ((yM - yE) / radius)
    '---

    'EM = earth to moon
    accEM = -G * Mmoon / radius ^ 2
    axEM = accMM * ((xE - xM) / radius)
    ayEM = accMM * ((yE - yM) / radius)
    '---

    distMS = SQR((xM - xS) ^ 2 + (yM - yS) ^ 2)

    'MS = moon to sun
    accMS = -G * Msun / distMS ^ 2
    axMS = accMS * ((xM - xS) / distMS)
    ayMS = accMS * ((yM - yS) / distMS)
    '---

    'SM = sun to moon
    accSM = -G * Mmoon / distMS ^ 2
    axSM = accSM * ((xS - xM) / distMS)
    aySM = accSM * ((yS - yM) / distMS)
    '---

    distES = SQR((xE - xS) ^ 2 + (yE - yS) ^ 2)

    'ES = earth to sun
    accES = -G * Msun / distES ^ 2
    axES = accES * (xE - xS) / distES
    ayES = accES * (yE - yS) / distES
    '---

    'SE = sun to earth
    accSE = -G * Mearth / distES ^ 2
    axSE = accSE * (xS - xE) / distES
    aySE = accSE * (yS - yE) / distES
    '---

    'M = moon
    axM = axME + axMS
    ayM = ayME + ayMS
    vxM = vxM + dt * axM
    vyM = vyM + dt * ayM
    xM = xM + dt * vxM
    yM = yM + dt * vyM
    '---

    'E = earth
    axE = axES + axEM
    ayE = ayES + ayEM
    vxE = vxE + dt * axE
    vyE = vyE + dt * ayE
    xE = xE + dt * vxE
    yE = yE + dt * vyE
    '---

    'S = sun
    axS = axSE + axSM
    ayS = aySE + aySM
    vxS = vxS + dt * axS
    vyS = vyS + dt * ayS
    xS = xS + dt * vxS
    yS = yS + dt * vyS
    '---

    inc = inc + 1
    dts = mu1 / 1.6E-09

    IF f2 = 0 AND radius < lastrad THEN
    f2 = 1: colr = colr + 1
    LOCATE 1, 1
    PRINT " Press 'f' for faster, 's' for slower "
    PRINT " Distance to sun is"; dts; " times greater than is shown "
    LOCATE 7, 35: PRINT "Press z to reduce the graph scale"

    LOCATE 4, 1: PRINT radius; " aphelion radius "
    LOCATE 8, 2: PRINT p; " cycles "
    p = p + 1
    IF ss = "f" THEN dt = INT(dt * 2)
    IF ss = "s" THEN dt = INT(dt * 10) / 20
    LOCATE 28, 23: PRINT " Program step size is"; dt; " seconds "
    END IF

    IF colr = 16 THEN colr = 1
    IF f2 = 1 AND radius >= lastrad THEN
    inc = 0
    perirad = radius

    LOCATE 5, 1:
    PRINT perirad; " perihelion radius "

    ecc = ((aphrad + perirad) / 2 - perirad) / ((aphrad + perirad) / 2)
    PRINT ecc; " orbit eccentricity "

    f2 = 3
    CIRCLE (230 + (xM - xE) * mu1, 240 - (yM - yE) * mu1), 6, 15
    END IF

    IF f2 = 3 AND radius <= lastrad THEN f2 = 0: LOCATE 17, 25
    CIRCLE (230 + (xM - xE) * mu1, 240 - (yM - yE) * mu1), 1, colr

    CIRCLE (230 + (xE2 - xS2) * 1.6E-09, 240 + (yE2 - yS2) * 1.6E-09), 10, 0
    CIRCLE (230 + (xE - xS) * 1.6E-09, 240 + (yE - yS) * 1.6E-09), 10, 14
    xE2 = xE: xS2 = xS: yE2 = yE: yS2 = yS

    lastrad = radius

    ss = inkey
    IF ss = chr(27) THEN GOTO ab
    IF ss = "z" THEN mu1 = mu1 / 2: LOCATE 2, 21: PRINT " "
    IF dts < 1 THEN mu1 = 1.6E-09 ' 1 to 1 graphics scale
    IF ss = "f" THEN dt = INT(dt * 2)
    IF ss = "s" THEN dt = INT(dt * 10) / 20
    GOTO aa

    ab:

    DO: LOOP UNTIL inkey <> ""
    END

    an:
    READ ss
    IF ss = "cls" THEN CLS : GOTO an
    IF ss = "" THEN GOTO ao
    IF ss = " " THEN sd = 0: READ ss: DO: LOOP UNTIL inkey <> "": GOTO an
    LOCATE sd + 4, 4: PRINT ss
    sd = sd + 1
    GOTO an
    ao:
    GOTO am

    DATA "This program is designed to demonstrate the perihelion advance rate " DATA "of the moon in orbit around the earth. The sun is of course " DATA "involved. The non rotating frame of the earth is the point of focus." DATA " " DATA "The extension of Euler's method used here is obviously common place " data "in the field of astrophysics, but it's still a most incredible " DATA "example of mathematical wizardry. The fact that I get the result I " DATA "require is testament to its precision. " DATA " " DATA "Setting the moon average orbit radius at 4e8 meters, with an orbit " DATA "speed of 900 m/sec at aphelion, gives an orbit eccentricity of .12 " DATA "and an advance rate of .794 degrees per cycle. The advance " DATA "attributable to m/M*180 is 2.217 degrees per cycle, so the total " DATA "advance is 3.011 degrees. Which is as observed. " DATA " " DATA "For obvious reasons the advance is orbit eccentricity dependent to " DATA "some degree. It doesn't alter the outcome much though. i.e. For an " DATA "eccentricity of .2 the advance rate is then .82 degrees per cycle. " DATA " " DATA "Variations in the perihelion position from one cycle to the next " DATA "becomes extreme for low eccentricities because a perihelion is " DATA "identified whenever the orbit trajectory shifts from pointing inward" DATA "to pointing outward, and that can happen anywhere because the sun is" DATA "involved. Nothing can be gleaned from this. " DATA " "
    DATA " " DATA "cls"
    DATA ""
    '---Program end---

    Linux users:
    (1) Create a new folder somewhere.
    (2) Download FreeBasic (linux version) from SourceForge.
    (3) Copy the downloaded file and paste it into the new folder.
    (4) Right mouse click the file and choose 'extract here'.
    (5) Double click the extracted folder.
    (6) Then double click the 'FreeBasic' folder.
    (7) Double click the 'bin' folder.
    (8) Right mouse click the 'fbc' file.
    (9) Choose 'properties', then 'permissions'.
    'Allow executing file as program' should be ticked. Otherwise it won't work. 'Open with' should be set to 'autorun prompt'.

    You may be required to download some support files that may not have
    been included in your version of Linux.

    Copy the program off this screen and paste it into a text editor.
    Save it in the 'examples' folder with a .bas extension.
    Right mouse click on the examples folder and select 'Open in terminal'.
    At the prompt, type, sudo fbc filename.bas . Filenames are case sensitive
    in Linux. You will need to enter your computer access password.

    Double click the newly created file, which will appear in the examples
    folder.

    Once this has been set up, the process of generating executable files
    from Qbasic programs from any source is very simple.

    -----

    Max Keon

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From maxkeon887@gmail.com@21:1/5 to maxke...@gmail.com on Tue Apr 20 23:54:14 2021
    On Wednesday, 21 April 2021 at 14:24:37 UTC+10, maxke...@gmail.com wrote:
    My proposal that perihelion advance rates are proportional to m/M*180, gforce(m)/gforce(M)*180, orbitrad(M)/orbitrad(m)*180 (relative to the barycenter), etc. is reinforced by the attached Qbasic program.

    The program is designed to demonstrate the perihelion advance rate of
    the moon in orbit around the earth.

    Variable width fonts and the removal of normally inconsequential spaces
    has caused a few problems in my program. The simple fix is, in all but
    the second last set of " ", place a dot between them where they appear
    in the data section ". "
    e.g.
    DATA "involved. Nothing can be gleaned from this. "
    DATA " "
    DATA ". "
    DATA "cls"

    My apologies. I should have remembered.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From maxkeon887@gmail.com@21:1/5 to maxke...@gmail.com on Wed Apr 21 02:00:29 2021
    On Wednesday, 21 April 2021 at 14:24:37 UTC+10, maxke...@gmail.com wrote:
    My proposal that perihelion advance rates are proportional to m/M*180, gforce(m)/gforce(M)*180, orbitrad(M)/orbitrad(m)*180 (relative to the barycenter), etc. is reinforced by the attached Qbasic program.

    The program is designed to demonstrate the perihelion advance rate of
    the moon in orbit around the earth.
    ---
    ---
    With an aphelion speed of 300m/sec, eccentricity is greater than .9
    and the advance rate is 2.2 degrees per cycle.

    A little belated, but here's the image.
    image here--------- https://drive.google.com/file/d/1OvX96g1GYsqtgVYsmk8arLcQ7gpxUyOi/view?usp=sharing
    ---------

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)