Jump to content

Stargazer: program for inteplanetary transfer calculation


Recommended Posts

Hello!

I want introduce the first beta-version of the program for interplanetary transfer trajectory calculation. It can:

1. Orbital position of the panet or moon for any time moment

2. Elliptic (parabolic and hyperbolic for external planets or moons) transfer trajectory between planets or two moons

3. Eject manuever from departure planet/moon from low orbit

4. Low orbit parameters (inclination, longtitude of ascending node, argument of periapsis)

Today all calculation are executed for celestial bodies with same reference body

Screenshot

h_1444880796_4884443_1f14370a8d.png

You can dowload this utility here

Source code awayable at GitHub

Short manual

1. Change depature and arrival celestial bodies. Warning: both bodies must have same reference body (from Kerbin to Duna, or from Mun to Minmus, for example). Transfer from planet to it's moon is imposible now.

2. Change time interval for transfer window search.

3. Set low orbit altitude near departure body.

4. Click "Search" button.

5. Set Psi angle for reach minimal delta V. You can increment and decrement Psi by "+" and "-" buttons with custom step. You trajectory is recalculated automaticaly

Scheme of interpanetary trajectory calculation

h_1444909271_5534653_cf00245f0b.png

Green plane - departure planet orbit

Yellow plane - arrival planet orbit

Red plane - transfer orbit

Lambda_err - error of ecliptic longtiture at arrival time. If transref orbit is good, Lambda_err = 0

vK - departure planet velocity veclor

vA - transfer trajectory velocity vector at departure time

v_rho - departure body SOI escape velocity

It is only beta-version for first testing. Today it is a external program, but it will be developed as mode for KSP.

P.S.: Sorry my very bad english :(

Edited by maisvendoo
Link to comment
Share on other sites

  • 2 weeks later...

Today I can introduce new version of Strargazer interplanetary calculator.

Changes in version 0.1.0

1. Greek letters in user interface

2. Calculation of launch data and launch azimuth for assent to low orbit. You can set coordinates of launchpad (KSC launchpad as default)

3. Fixed some small bugs in user interface and calculation algorithm

You can download it here

Screenshot

s_1445805993_1729589_a08e86f14e.png

Edited by maisvendoo
Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...
On 11.01.2016 at 8:01 AM, Wcmille said:

Will this tool work with any starting eccentricity and inclination, or do you need to have circular orbit, with starting inclination of 0? If not, may I ask how do you solve for that?

Which orbit you mean?

On 13.01.2016 at 6:40 AM, skYman said:

Is this hard-coded or do you pull the bodies-info off the game somehow?

i.e. would this work with modded installs?

All bodies data are in file cfg/kerbal.xml. You can change it, if you want manualy. This file is generated from game by my small plugin, because there are no config file with bodies data in game. 

Link to comment
Share on other sites

5 hours ago, White Owl said:

This looks like the ideal tool for finding transfer windows in the Harder Solar System mod.

This is a good idea, it'll work with Solar System, if kerbal.xml to edit. But this program work with Kerbal's calendar only: 6 hours in day and 426 days in year are hard-coded in current version. 

This code

Calendar.cs

public class KCalendar
    {
        public const int Days = 426;
        public const int Hours = 6;
        public const int Mins = 60;
        public const int Secs = 60;

        public static double  date_to_sec(int year, int day, int hour, int min, int sec)
        {
            return 9201600.0 * (year - 1) + 21600.0 * (day - 1) + 3600.0 * hour + 60.0 * min + sec;
        }

        public static void sec_to_date(double t, ref KDate date)
        {
            int sYear = Days * Hours * Mins * Secs;
            int sDay = Hours * Mins * Secs;
            int sHour = Mins * Secs;
            int sMin = Secs;

            date.year = Convert.ToInt32(Math.Truncate(t / sYear)) + 1;
            date.day = Convert.ToInt32(Math.Truncate( (t - (date.year-1)*sYear) / sDay)) + 1;
            date.hour = Convert.ToInt32(Math.Truncate((t - (date.year - 1) * sYear - (date.day - 1) * sDay) / sHour));
            date.min = Convert.ToInt32(Math.Truncate((t - (date.year - 1) * sYear - (date.day - 1) * sDay - date.hour * sHour) / sMin));
            date.sec = Convert.ToInt32(Math.Truncate(t - (date.year - 1) * sYear - (date.day - 1) * sDay - date.hour * sHour - date.min * sMin));
        }

        public static void DeltaDate(double t, ref KDate date)
        {
            int sYear = Days * Hours * Mins * Secs;
            int sDay = Hours * Mins * Secs;
            int sHour = Mins * Secs;
            int sMin = Secs;

            date.year = Convert.ToInt32(Math.Truncate(t / sYear));
            date.day = Convert.ToInt32(Math.Truncate((t - (date.year) * sYear) / sDay));
            date.hour = Convert.ToInt32(Math.Truncate((t - (date.year) * sYear - (date.day ) * sDay) / sHour));
            date.min = Convert.ToInt32(Math.Truncate((t - (date.year) * sYear - (date.day) * sDay - date.hour * sHour) / sMin));
            date.sec = Convert.ToInt32(Math.Truncate(t - (date.year) * sYear - (date.day) * sDay - date.hour * sHour - date.min * sMin));
        }
    }

must be changed to Solar system transfer calculations

Edited by maisvendoo
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...