Jump to content

[1.12] SOC: Simple Orbit Calculator


linuxgurugamer

Recommended Posts

Written by @stevehead who hasn't been around for 4 years, original thread is here: https://forum.kerbalspaceprogram.com/index.php?/topic/104465-122-soc-simple-orbit-calculator-v150-1122017/

Instructions for the orbit calculator

You can access the calculator by clicking the AppLauncher icon (or Blizzy's Toolbar icon) with the image of "SOC".

  1. Select the celestial body on the left.
  2. To the right of the celestial bodies, select two orbital elements (you cannot select both semi-major axis and orbital period; it would create an ambiguous case). The other elements will be disabled from input at this point.
  3. As an option, you can use either apoapsis/periapsis as altitudes above sea level of parent body or as distances from the center of the parent body. Just toggle the Use Altitudes for Apsides option near the bottom under Options.
  4. Enter your target values. The S button on the same row of the orbital period will set the orbital period to the parent body's rotation period (useful for synchronous orbits).
  5. Click the Calculate button, which will fill in the other elements and display below more in-depth information of the calculated orbit. Any errors will be reported.
  6. Optionally, if you are currently in a flight scene, you can click the Use Current Orbit button to use your current orbit or click the Use Target Orbit to use your target's orbit.

Because the calculation will fill in other elements that you did not choose, you will be free to use those easily in other calculations. Just de-select the elements you do not need, and select the new ones. This is very useful for calculating Hohmann transfers.

Instructions for the Hohmann transfer calculator

  1. Once you have calculated an orbit above, click either Save as Orbit 1 or Save as Orbit 2.
  2. When two orbits are saved that have the same parent body, the delta-v for the transfer will be calculated and displayed below.
  3. Click the C buttons to clear their respective orbits.

Instructions for the info mode

  1. Select the celestial body on the left.
  2. Toggle on Celestial Body Info Mode from the options on the right.
Javascript is disabled. View full album

Current Features

  • Will automatically detect all celestial bodies known to KSP and their properties, including changes/additions by RSS or Planet Factory like mods.
  • Allowed inputs include: Apoapsis, Periapsis, Semi-Major Axis, Eccentricity, Orbital Period.
  • Other information displayed after calculation: Orbital Speeds at Apoapsis and Periapsis, Mean Orbital Speed, Launch Delta-V (the minimum dV required to launch to or land from the orbit), Max Darkness Length (useful for Remote Tech satellite electric charge calculations).
  • Can use your current vessel's or target's orbit as input.
  • Can save two orbits to calculate the delta-v required for a Hohmann transfer.
  • Blizzy's Toolbar support.
  • Celestial Body Info mode will display orbit and physical characteristics of the selected body, similar to that found on a wiki page.

Dependencies

Availability

Now Available via CKAN

Edited by linuxgurugamer
Link to comment
Share on other sites

  • 4 months later...

Hello @linuxgurugamer

 

It seems the maximum darkness length is not displaying a correct value while installed along RSS

For a 500x500km orbit on earth, it shows 41sec.

Do you need log or any other file?

Best,

 

Version 1.6.0.1 with all 3 dependencies installed

Edited by Benoit Hage
Link to comment
Share on other sites

5 hours ago, Benoit Hage said:

Hello @linuxgurugamer

 

It seems the maximum darkness length is not displaying a correct value while installed along RSS

For a 500x500km orbit on earth, it shows 41sec.

Do you need log or any other file?

Best,

 

Version 1.6.0.1 with all 3 dependencies installed

I don’t do RSS, so I will need the log file, if for nothing else than to get a list of mods you have installed.  Better yet, if you use CKAN, an exported list fromCKAN would be very useful.

Not needed, I've been able to replicate the problem

Beyond that, do you have any idea what the value should be?

 

Edit 2:  I'm wondering if that should be minutes instead of seconds

Edited by linuxgurugamer
Link to comment
Share on other sites

9 hours ago, Benoit Hage said:

Hello @linuxgurugamer

 

It seems the maximum darkness length is not displaying a correct value while installed along RSS

For a 500x500km orbit on earth, it shows 41sec.

Do you need log or any other file?

Best,

 

Version 1.6.0.1 with all 3 dependencies installed

It's been fixed.  But the problem wasn't in this mod, it was a bug in SpaceTuxLibrary.

Update SpaceTuxLibrary to 0.0.8.3 and it should be fixed

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 weeks later...

Hello @linuxgurugamer, and thank you for your awesome work on many mods !

When I save a second orbit for my Hohman transfer calculation, the SOC window goes empty, and the console get spammed with OrbitalElementExecption : Resulting eccentricity cannot be less than 0.

I use RSS/RO/RP-1 and the orbit calculation was around Earth.

Here is the Player.log

https://www.mediafire.com/file/15g2w2a2dmz47f7/Player.log/file

Edited by Silverthorn
Link to comment
Share on other sites

On 1/6/2022 at 2:48 AM, Galland1998 said:

I got a strange issue.  I am running on 1.10 with an RSS/RP-1 game and when I click on the icon in tool bar or the stock bar on the side SOC comes up but I can't get the SOC window to close.

I had a similar issue in KSP 1.12.3. But it only happens with "Blizzy's" Toolbar. If I use the stock toolbar to launch SOC, I can open and close it without any issues, so I only use the stock applauncher. I was too lazy to follow the issue any further since this easy workaround works perfectly.

Link to comment
Share on other sites

  • 3 months later...

Nice mod! It will replace a bunch of calculations in my Excel sheet!

There's one calculation missing that would be very helpful too: plane change DeltaV. It's dependent on instant orbit's altitude but the mod could simply calculate the best and worst values, i.e. at Apoapsis and Periapsis. All that is missing is input fields for the inclination of the orbits and a couple formulas. Please, consider that if you ever have the time to improve this mod.

Anyway, thanks for your great work for the KSP community!

Link to comment
Share on other sites

I was poking around with the mod and ran into this error. After the error, I couldn't close the window anymore.


[EXC 16:05:35.356] NullReferenceException: Object reference not set to an instance of an object
    SimpleOrbitCalculator.CalculatorWindow.RenderHohmannTransferArea () (at <53bab64bf3df4e0dbf9aa2bd5113b0a4>:0)
    SimpleOrbitCalculator.CalculatorWindow.RenderWindow (System.Int32 windowId) (at <53bab64bf3df4e0dbf9aa2bd5113b0a4>:0)
    UnityEngine.GUILayout+LayoutedWindow.DoWindow (System.Int32 windowID) (at <58f888e0d56a4620958c8e58a768c70d>:0)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.GUI+WindowFunction func, System.Int32 id, System.Int32 instanceID, UnityEngine.GUISkin _skin, System.Int32 forceRect, System.Single width, System.Single height, UnityEngine.GUIStyle style) (at <58f888e0d56a4620958c8e58a768c70d>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

I'll take a look at the source later today and see if I can figure out what is going on.

Link to comment
Share on other sites

  • 4 months later...
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...