Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ABer

Pages: 1 [2] 3 4 ... 34
16
Astrobasic / Re: getradii and getplanet
« on: April 18, 2022, 08:37:49 PM »
Here is the final output - table and graph.

On the graph, the horizontal bars mark the point, in % terms, where the median value in AU lies for each planet. The median value is the distance in astronomical units that lies at the point at which the planet spends 50% of its orbit between perigee and the median value, and 50% of its orbit between the median value and apogee. You will see that the median value in AU is often more than the average value (the midpoint in distance between apogee and perigee). This is because orbits are not circular, the planets do not orbit around the Earth, and the apparent speed of the planet is not regular.

Thanks. Ed

17
Astrobasic / Re: getradii and getplanet
« on: April 18, 2022, 08:45:15 AM »
Hi Jean - I don't know any other way of sorting the values. I assumed that this variable had to be created to get the function to work. I don't need to use the variable as such. Is there another way to sort the values? The median is just the single value in the middle of all the sorted values.

18
Astrobasic / Re: getradii and getplanet
« on: April 17, 2022, 09:42:32 PM »
Hi Jean - it's to find the middle value. To find the median (middle) value, all the values need to be sorted from lowest to highest.The idea is that out of the 100001 days, the planet spends 50000 days (50%) at a distance less than the median AU distance, and 50000 (50%) days at a distance greater than the median AU distance. The median distance is the 50001st value in the array.

All the best. Ed

19
Astrobasic / Re: getradii and getplanet
« on: April 17, 2022, 07:14:23 PM »
Thanks Jean - that tip is helpful.

Here is the final code. The second part of the code gets the planetary distances from getplanet(), puts the distances into an array with 100001 slots, sorts them from lowest to highest, and then transfers the middle distance (50001) to the array medianDistances. The attached output adds the median distance of the planet from the Earth. Notice that the average value and the median value are not the same. The median value may be a more accurate reflection of the planet's 'average' distance from the Earth as it will take account of the orbits are not circular.

Code: [Select]
real planetData[6], pDistances[100001], planetRads[14], minMaxDistances[2][10], medianDistances[10];
int sortedPDistances[100001];

` for current date - transits
getsystemtime(now);

jdNow = timetojulian(now);
jdDir = jdNow;

` apogee
set(minMaxDistances[0], 2000);
` perigee
set(minMaxDistances[1], -1);

i = 0; for (i < 100001){
  calculate(1, jdNow - i, lon, lat, -2);
  getradii(1, planetRads);
  j = 0; for (j < 10){
    if (planetRads[j] < minMaxDistances[0][j])
       minMaxDistances[0][j] = planetRads[j];
    if (planetRads[j] > minMaxDistances[1][j])
       minMaxDistances[1][j] = planetRads[j];}}
       
i = 0; for (i < 10){
  j = 0; for (j < 100001){
    calculate(1, jdNow - i, lon, lat, -2);
    getplanet(i , 0, planetData);
    pDistances[j] = planetData[5];}
    sort(pDistances, sortedPDistances, 0);
    medianDistances[i] = pDistances[50001];}

This is an example of 'extreme' Astrobasic - calculating 200002 horoscopes to extract this data. Who would have thought you could have an array with 100001 values! It takes a little bit of time, but in reality it's a blink of an eye.

Ed

20
Astrobasic / Re: getradii and getplanet
« on: April 17, 2022, 07:44:26 AM »
Hi there - here is the code that finds the min and max distances from the Earth (if geocentric is set) by looking at the radii everyday for 100000 days prior to the current day. The output is attached. The first column is the values for the current day; the second column is minimum distance from the Earth (perigee); the third column is the maximum distance from the Earth over that period (apogee); the final column is the average distance.

Code: [Select]
i = 0; for (i < 100000){
  r = jdNow - i;
  ` calculate(char Index, real julianday, real placelongitude, real placelatitude, char housesystem);
  calculate(1, r, lon, lat, -2);
  getradii(1, planetRads);
  if (i = 0){
     j = 0; for (j < 14){
       minMaxDistances[0][j] = planetRads[j];
       minMaxDistances[1][j] = planetRads[j];}}
  else
      {j = 0; for (j < 14){
        if (planetRads[j] < minMaxDistances[0][j])
           minMaxDistances[0][j] = planetRads[j];
        if (planetRads[j] > minMaxDistances[1][j])
           minMaxDistances[1][j] = planetRads[j];}}}

21
Astrobasic / getradii and getplanet
« on: April 16, 2022, 10:12:21 PM »
Hi there - this function (getradii) calculates planetary distances. Depending on the settings within planetdance, it will either return geocentric or heliocentric distances in astronomical units. getplanet() can also be used to get the same data.

The following code is an example of how to use the functions:

real planetData[10][6], planetRads[14];

getradii(0, planetRads);

for (i < 10)
    getplanet(i , 0, planetData);

planetData is an array to hold data for the first 10 planets, with 6 items. Planetary distances are in the last field.

From the AB helpfile:

getplanet()

Syntax: getplanet(int planetnumber, int horoscopenumber, real result[6]);

Action: calculates a planet or body. Some results rely on a horoscope being calculated, for others only sethoroscopetime is needed. The array result will have these values:

0 longitude
1 latitude
2 speed (degree/day)
3 declination
4 rectascension
5 radius (astronomical units)

 More to follow!


22
Planetdance for windows / Re: Tyl Chart Synthesis
« on: April 12, 2022, 09:20:02 AM »
Hi there - I've been doing some further work on this module over the last few days. We're just testing the latest version. See attachments.

23
Planetdance for windows / Re: Tyl-Chart-Synthesis
« on: April 10, 2022, 07:27:09 AM »
Hi there - if you are a regular user of this module please update. I have released a bug fix.

v.2.03 - bug fix for Aries Midpoints routine.

Thanks Volker.

Ed

24
Classic, Medieval, Vedic / Re: New Horary Module
« on: April 07, 2022, 10:00:07 PM »
Thanks Jean - for reference its v.4.56 released today.

26
Classic, Medieval, Vedic / Re: New Horary Module
« on: April 07, 2022, 08:54:11 PM »
Hi Jeremy - I have fixed the bug you found. Jean will release the update soon. Thanks. Ed

27
Classic, Medieval, Vedic / Re: New Horary Module
« on: April 07, 2022, 08:01:05 PM »
Hi Jeremy - thanks for the feedback again. I'm not in a position to make major changes to this module at the moment.

I can look at the potential bug with the latitude calculation.

I don't quite understand whether you are interested in a separate election module or not. This is something I have planned to do but I don't see it happening for quite a while.

Ed

28
Classic, Medieval, Vedic / Re: New Horary Module
« on: April 06, 2022, 08:50:36 AM »
Hi Jeremy - thanks for the feedback. However I am not quite sure what you mean by your comments. I have been working on this significant update to the horary module for a long time. There has been a separate horary module in PD for a number of years now, but the original versions were always quite basic as the programming is complicated in some areas. I've now improved it, but recognise that there may be some further work to do.

Ed

29
Astrobasic / Re: getplanet
« on: April 01, 2022, 10:27:08 PM »
Hi Jean - I've got it working, but the script needs a lot of sorting out. Overly complicated really. Ed

30
Astrobasic / Re: getplanet
« on: April 01, 2022, 09:00:34 PM »
Thanks Jean - I'll take a look at it. Ed

Pages: 1 [2] 3 4 ... 34