Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Addon Development
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Addon Development Developers post news, updates, & discussions here about your projects in development.

Reply
 
Thread Tools
Old 11-28-2013, 10:29 PM   #1
Enjo
Mostly harmless
 
Enjo's Avatar


Default TransX development

I'm starting to do some improvements of TransX.

SourceForge project page:
http://sf.net/projects/enjomitchsorbit
Repository location:
http://sourceforge.net/p/enjomitchso.../default/tree/
To obtain the source code, you need TortoiseHG
Current dependencies of TransX (available in TransX's parent dir):
- EnjoLib ("lib" dir)

If you want to develop it together with me, please setup an account at SourceForge.net and send me a PM with your account name.

Implemented so far:
- An auto-min mode, hunting on the 3 planes for the minimum approach distance. For each press on auto-min (AMI), up/down on plane ch to get to a min, then repeat on outward, then repeat on prograde.

Last edited by Enjo; 12-04-2013 at 07:15 AM.
Enjo is offline   Reply With Quote
Old 11-28-2013, 10:29 PM   #2
sorindafabico
Orbinaut
 
sorindafabico's Avatar
Default TransX development

O-F Staff note: Moved from TransX 2013.11.28 thread

Quote:
Originally Posted by ADSWNJ View Post
 Nice work Dgat! I love to see continuing work on these classic (and must-have) utilities.

Do you have a wish-list of things to add, given unlimited time to create things? Here's some of mine:

1. An auto-min mode, hunting on the 3 planes for the minimum approach distance. For each press on auto-min (AMI), up/down on plane ch to get to a min, then repeat on outward, then repeat on prograde.

2. A clean way to do resonant encounter slingshots (e.g. 1 1/2 orbits to reach Earth again).

3. Add moons into the two-body gravity calculation - e.g. to increase Earth-Moon trajectory accuracy.

4. An auto-center mode for maneuver thrusting (manual thrust, auto rotation).
I'd also suggest something like IMFD's Map program.

I would do it if already had the know-how, but I need to learn somt things before.

Last edited by Loru; 11-30-2013 at 10:59 PM.
sorindafabico is offline   Reply With Quote
Old 11-29-2013, 07:47 AM   #3
Enjo
Mostly harmless
 
Enjo's Avatar


Default

Quote:
Originally Posted by dgatsoulis View Post
 I have really no idea when I will be able to continue working on TransX, so any takers are more than welcome.
I know how to do #4, because I have the same code in Launch MFD. I was thinking about drawing the vector on HUD, but this would add unnecessary dependency. I've also done a quick research on #1 and if I find some time this weekend, I could start writing it. Realistically though, I will first have to spend time on setting up the build environment, because currently I don't even have a working Windows box.
Enjo is offline   Reply With Quote
Thanked by:
Old 11-29-2013, 05:42 PM   #4
aldarion
Orbinaut
Default

#1
We need to remember that min value is not always the best way to find solution in TransX.
Overshooting is one of the main techniques I use in TransX.
aldarion is offline   Reply With Quote
Old 11-29-2013, 06:34 PM   #5
Enjo
Mostly harmless
 
Enjo's Avatar


Default

Sure. The idea is to remove the tediousness of manual tuning, but without removing the option of tuning.
Enjo is offline   Reply With Quote
Thanked by:
Old 11-29-2013, 10:18 PM   #6
ADSWNJ
Scientist
 
ADSWNJ's Avatar
Default

Quote:
Originally Posted by Enjo View Post
 Sure. The idea is to remove the tediousness of manual tuning, but without removing the option of tuning.
Exactly ... just optimize the process of manually finding the best solution, without making it auto-magical.
ADSWNJ is offline   Reply With Quote
Thanked by:
Old 11-30-2013, 10:22 PM   #7
Enjo
Mostly harmless
 
Enjo's Avatar


Default Auto min

Attached is the first try of (unconstrained) minimization, available as an special adjustment variable type (before Reset). Because it's unconstrained, sometimes the Min function finds solutions that are far from sane, especially when it comes to Prograde vel. Please give it a go and tell me what you think.
Attached Files
File Type: zip TransX.dll.zip (423.5 KB, 17 views)
Enjo is offline   Reply With Quote
Old 12-01-2013, 01:39 AM   #8
dgatsoulis
ele2png user
 
dgatsoulis's Avatar
Default

I tested only a simple 3 stage Earth→Mars journey with today's date and I have to say that it's pretty freaking awesome! Great job Enjo!

As far as the outward and plane change go, I didn't notice any problems. Sure, there is some back and forth between the variables , but it was as fast (if not faster) as setting up a plan with the previous way.
Besides, I am pretty fast with TransX, so I can definitely see how this adjustment setting will help.

I did not notice any problems with the unconstrained prograde. If anything, it was undershooting until I started adding the other 2 variables with "Min". Perhaps it was because of the date (close to a Mars window).

One thing that will help a lot, is the addition of a line that shows the total dV of the Eject plan: sqrt(pro²+pl.ch²+out²).
This was on my to do list, as an easy and fast way to compare plans.
Now with the "Auto-min" setting (I think the name is fitting), showing the total dV becomes necessary.

Will do more testing tomorrow.


P.S. the size went from 317 to 1264 kb?
dgatsoulis is offline   Reply With Quote
Old 12-01-2013, 06:27 AM   #9
Enjo
Mostly harmless
 
Enjo's Avatar


Default

Thanks for testig late in the night!

Quote:
Originally Posted by dgatsoulis
 I did not notice any problems with the unconstrained prograde. If anything, it was undershooting until I started adding the other 2 variables with "Min". Perhaps it was because of the date (close to a Mars window).
In my Venus plan it was overshooting, by finding a second minimum with a non-hohmann transfer. But I think I know how to mitigate this: by setting 0 as the starting point for the optimum search, and not the current value. However I'll disable the Auto-min for the date variable, because this may screw up somebody's plan.

Quote:
Originally Posted by dgatsoulis
 One thing that will help a lot, is the addition of a line that shows the total dV of the Eject plan: sqrt(pro²+pl.ch²+out²).
Great Idea.
I also have another one - we could have a gobal setting - minimize all - which would automatically minimize all three velocities upon any change of the date. Technically it's very easy to do.
Notice How we slowly converge to IMFD's functionality, but with TransX's plan flexibility.

Quote:
Originally Posted by dgatsoulis
 P.S. the size went from 317 to 1264 kb?
That's because of the library that I use - "dlib". A very pro numerical lib with a permissive license (Boost). And it's easy to compile. However it's quite heavy with all the features that it has, while in this project I use just a tiny subset of them.

Last edited by Enjo; 12-01-2013 at 06:41 AM.
Enjo is offline   Reply With Quote
Thanked by:
Old 12-01-2013, 07:03 AM   #10
Linguofreak
Orbinaut
Default

Quote:
Originally Posted by Enjo View Post
 Thanks for testig late in the night!



In my Venus plan it was overshooting, by finding a second minimum with a non-hohmann transfer. But I think I know how to mitigate this: by setting 0 as the starting point for the optimum search, and not the current value. However I'll disable the Auto-min for the date variable, because this may screw up somebody's plan.
Was this the November 2013 launch window?

Do note that due to inclination and eccentricity effects, the min-DV trajectory for the November 2013 Venus Hohmann window is not exactly a classical Hohmann. It goes through more than half an orbit before meeting Venus.

Quote:
Great Idea.
I also have another one - we could have a gobal setting - minimize all - which would automatically minimize all three velocities upon any change of the date. Technically it's very easy to do.
Notice How we slowly converge to IMFD's functionality, but with TransX's plan flexibility.
This would make slingshots into resonant trajectories and such a whole ton easier to set up.
Linguofreak is offline   Reply With Quote
Old 12-01-2013, 08:44 AM   #11
Ripley
Tutorial translator
 
Ripley's Avatar
Default

I tried a simple Earth->Venus (on MJD 51906.916667 - December 2000).
With the "previous" TransX (enterbutton_graphicsfix) I got a Cl. App. of 604M, while with this new dll it went down all the way to something like 30M
then upon another click of Prograde (on "Min"), it jumped to a crazy + value, screwing everything up.

Anyway


Another thing: since now we have the new largest adjustment setting "Rough", I think variables should start on that setting instead of "Course".

Last edited by Ripley; 12-02-2013 at 02:30 PM. Reason: Rough & Course - minor typo
Ripley is offline   Reply With Quote
Thanked by:
Old 12-01-2013, 10:34 AM   #12
dgatsoulis
ele2png user
 
dgatsoulis's Avatar
Default

Quote:
Originally Posted by Ripley View Post
 Another thing: since now we have the new largest adjustment setting "Rough", I think variables should start on that setting instead of "Course".
I tried that when I was testing the new version, but I decided to leave it starting on "Coarse" for two reasons:

1. The "Rough" setting is mostly useful for 1 variable, the date. You use it very seldom for the other 3 variables.

2. TransX has been around for many years and most people (including me) have developed a certain "habit" for the way they setup their plans.
I wanted the new settings to add to that, without changing those habits.

Anyway, it's just a minor thing. I guess in the end, it's a matter of getting used to it.

---------- Post added at 12:34 ---------- Previous post was at 12:04 ----------

Quote:
Originally Posted by Enjo View Post
 But I think I know how to mitigate this: by setting 0 as the starting point for the optimum search, and not the current value. However I'll disable the Auto-min for the date variable, because this may screw up somebody's plan.
Yeah, I tried an Earth→Mercury plan and in the beginning the prograde was all over the place. It wasn't difficult to adjust it first and then use auto-min, but some way of constraining the values is needed.

Totally agree on disabling it for the date.

Quote:
Originally Posted by Enjo View Post
 I also have another one - we could have a gobal setting - minimize all - which would automatically minimize all three velocities upon any change of the date. Technically it's very easy to do.
So, in the Eject plan view, that would be an additional variable -not an adjustment setting- that says "Auto-min DV" with "Yes" and "No" as the adjustment settings to choose from.
If it is set to "Yes", TransX will auto-set the Pro, Pl.ch. and Out, to find a minimum dV solution for that particular date of departure.

How will that work, without the user also setting a date of arrival?
(Which would be exactly as IMFD works).

Quote:
Originally Posted by Enjo View Post
 Notice How we slowly converge to IMFD's functionality, but with TransX's plan flexibility.
dgatsoulis is offline   Reply With Quote
Thanked by:
Old 12-01-2013, 10:52 AM   #13
Enjo
Mostly harmless
 
Enjo's Avatar


Default

Quote:
Originally Posted by Linguofreak View Post
 Was this the November 2013 launch window?
Nope. It wasn't. But as I can see, it's a common problem.

Quote:
Originally Posted by dgatsoulis View Post
 Yeah, I tried an Earth→Mercury plan and in the beginning the prograde was all over the place. It wasn't difficult to adjust it first and then use auto-min, but some way of constraining the values is needed.
It's easy to calculate a perfect Hohmann transfer orbit. I think that if the resulting prograde vel is greater than, say 20% of the Hohmann transfer orbit dv, then the optimization task should be considered a failure and cancelled.

Quote:
Originally Posted by dgatsoulis View Post
 So, in the Eject plan view, that would be an additional variable -not an adjustment setting- that says "Auto-min DV" with "Yes" and "No" as the adjustment settings to choose from.
If it is set to "Yes", TransX will auto-set the Pro, Pl.ch. and Out, to find a minimum dV solution for that particular date of departure.
That's how I imagine it.

Quote:
Originally Posted by dgatsoulis View Post
 How will that work, without the user also setting a date of arrival?
(Which would be exactly as IMFD works).
By simply automating the process of switching between variables and minimizing them. It will not be done iteratively (for int i = 0; i < 3; i++), but on the mathematical level - ie. making the calculation function not 1 variable dependent, but all 3 in the same time. The solver will automatically find the direction or fastest change (gradient), and proceed to look for the minimum there in one iteration.
Have a look at this method, where you see a minimization of 2 variables (we have 3): http://en.wikipedia.org/wiki/File:Nelder_Mead2.gif
By iterating over the variables by hand and performing 1-var only minimization, you effectively limit the picture in one dimension, having no chance to perceive higher dimensions (and I ain't talkin' New Age! ), therefore you can't find the high dimension gradient and have to repeat the task, also increasing the number of iterations.

and Re: prograde vel going haywire - the gif I posted also shows our situation nicely: imagine that the depressions are the possible minima of the 2D function, which in our case are lowest Cl. App. values - it's not obvious which one of these minima the algorithm will find. Of course, we know that it would be enough if the algorithm minimized the total DV in the same time, but I don't have that much control over it. Other than that, nobody said that the algorithm / library can't be changed. I'll try to design the optimizer in such way that it will be possible easily.

Last edited by Enjo; 12-01-2013 at 06:40 PM.
Enjo is offline   Reply With Quote
Thanked by:
Old 12-01-2013, 06:30 PM   #14
Enjo
Mostly harmless
 
Enjo's Avatar


Default Constraints

OK, I've added Hohmann-orbit-dv-based constraint to the prograde velocity, like I've described. It doesn't jump that dramatically anymore, however still due to TransX instabilities, sometimes the plan may change, if it is not firmly set (if it's like a perfect Hohmann transfer). It doesn't serve beer, but by simply switching between ProgradeVel and PlaneVel with Auto-Min, you can quickly find an optimal solution.

The idea with all variables optimising has unfortunately failed, because the design of TransX is obscure and nothing is what it seems to be. Therefore my assumptions where to hook my own code to reach my goal, have all failed. The MFD needs a redesign. Maybe later...

Please test the constrained automatic variable selection nevertheless. For now only for the ejection plan. The same in slingshots leads to CTD.

(PS. the file size is reduced. I probably sent a debug version by accident before)
Attached Files
File Type: zip TransX.dll.zip (108.6 KB, 24 views)

Last edited by Enjo; 12-01-2013 at 06:37 PM.
Enjo is offline   Reply With Quote
Thanked by:
Old 12-01-2013, 08:30 PM   #15
Ripley
Tutorial translator
 
Ripley's Avatar
Default

Quote:
Originally Posted by dgatsoulis View Post
 I tried that when I was testing the new version, but I decided to leave it starting on "Coarse" for two reasons:

1. The "Rough" setting is mostly useful for 1 variable, the date. You use it very seldom for the other 3 variables.

2. TransX has been around for many years and most people (including me) have developed a certain "habit" for the way they setup their plans.
I wanted the new settings to add to that, without changing those habits.

Anyway, it's just a minor thing. I guess in the end, it's a matter of getting used to it.
Ok, I understand your points. Perfectly fine.

Quote:
Originally Posted by Enjo View Post
 ...The MFD needs a redesign. Maybe later...
Ok, it's a deal!

Last edited by Ripley; 12-01-2013 at 08:33 PM.
Ripley is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Addons > Addon Development


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 03:36 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright ©2007 - 2017, Orbiter-Forum.com. All rights reserved.