[snip](My own interest is in trajectories with departure burns, arrival burns, and mid-course plane-change burns. Porkchop style tools don't seem to support that.)

Quote from: InterestedEngineer on 06/01/2024 12:27 am[...] I want a... mission planning tool [...]Still there are some open source alternatives. GMAT for example is available under the Apache License. https://opensource.gsfc.nasa.gov/projects/GMAT/

[...] I want a... mission planning tool [...]

NSI standard C++ using an Object Oriented methodology,

Quote from: InterestedEngineer on 06/01/2024 01:24 amAnd Porkchops are terrible at hyperbolic trajectories. I've never seen one do one correctly.Which ones?

And Porkchops are terrible at hyperbolic trajectories. I've never seen one do one correctly.

It's odd that this bug would exist, since the underlying Lambert solver algorithms I've seen are perfectly capable of handling hyperbolic trajectories.

Quote from: InterestedEngineer on 06/01/2024 01:24 amThey also don't spit out the vector for the deltaV. I can't even tell if they've optimized tangential and radial components.Do you want the vector for the delta-v (ie the heliocentric spacecraft velocity vector minus the heliocentric Earth velocity vector), or do you just want the heliocentric spacecraft velocity vector?It would be pretty trivial to make the Easy Porkchop algorithm spit out either one. Obviously it has to find them to solve the problem.

They also don't spit out the vector for the deltaV. I can't even tell if they've optimized tangential and radial components.

Quote from: InterestedEngineer on 06/01/2024 01:24 amYes, but making the graph is the problem. At this point I'm far enough along I'll just make my own graphs.I look forward to years and years of correcting people after they got fooled by recycled copies of your "idealized" (ie wrong) graphs.

Yes, but making the graph is the problem. At this point I'm far enough along I'll just make my own graphs.

I'm currently working on making Easy Porkchop less hilariously wrong for high delta-v trajectories. When I have something that won't be absurdly wrong, I might work on graphs.

Quote from: InterestedEngineer on 06/01/2024 01:24 amMulti-variate optimization might be a bit of a hassle but it's doable, it's what neural net learning does all day long.Very funny!

Multi-variate optimization might be a bit of a hassle but it's doable, it's what neural net learning does all day long.

Quote from: sdsds on 06/01/2024 01:34 amQuote from: InterestedEngineer on 06/01/2024 12:27 am[...] I want a... mission planning tool [...]Still there are some open source alternatives. GMAT for example is available under the Apache License. https://opensource.gsfc.nasa.gov/projects/GMAT/ from README.txtQuoteNSI standard C++ using an Object Oriented methodology,Oh dear, mallocs in the middle of computation loops. Might as well just use a scripting language if one didn't care about performance.2 decades of C++. Still hate it. One of the languages where O(nlogn) can be easily turned into O(N^2) mallocs if you are not insanely careful. which most aren't.

Quote from: Twark_Main on 06/01/2024 01:34 amQuote from: InterestedEngineer on 06/01/2024 01:24 amAnd Porkchops are terrible at hyperbolic trajectories. I've never seen one do one correctly.Which ones?all the ones in this thread. The JPL will intentionally not let you input high enough deltaVs to go hyperbolic. Which is probably a way of covering up a bug.

Quote from: Twark_Main on 06/01/2024 01:34 amIt's odd that this bug would exist, since the underlying Lambert solver algorithms I've seen are perfectly capable of handling hyperbolic trajectories.I think you said they have accuracy problems.

There's also a bunch of corner cases I can see in the code for it. Which means probably not tested very well, esp. since stuff like the JPL Pork Chop plotter won't let you test it in the first place.

Quote from: Twark_Main on 06/01/2024 01:34 amQuote from: InterestedEngineer on 06/01/2024 01:24 amThey also don't spit out the vector for the deltaV. I can't even tell if they've optimized tangential and radial components.Do you want the vector for the delta-v (ie the heliocentric spacecraft velocity vector minus the heliocentric Earth velocity vector), or do you just want the heliocentric spacecraft velocity vector?It would be pretty trivial to make the Easy Porkchop algorithm spit out either one. Obviously it has to find them to solve the problem.Yes. I want the standard patched conics solutions.

[skip a bit, Brother...]Quote from: Twark_Main on 06/01/2024 01:34 amQuote from: InterestedEngineer on 06/01/2024 01:24 amMulti-variate optimization might be a bit of a hassle but it's doable, it's what neural net learning does all day long.Very funny!Seriously that is what neural net learning is fundamentally.

Is there a scenario where it uses less fuel to do a plane change separately instead of combining it with the departure & arrival burns? Of course we all know about the bi-elliptic transfer, but is there a less extreme case you're thinking of?

Heh. I can understand tense SLS threads, but not tense orbital mechanics threads!

QuoteYou're familiar with the Lambert space triangle?Yes. You mentioned "Orbital Mechanics" by Prussing and Conway a few pages ago. I am one of Professor Conway's graduate students. I've been reading this message board for years but I never found anything that I felt I could contribute to. I'm happy to see an orbital mechanics thread!You are right that it is (usually) better to have a mid course maneuver. I say usually because sometimes it turns out from an operational perspective that it's cheaper in dollars to spend the extra fuel than it is to bring in the staff for an additional burn.The way I would do this numerically:First, choose the launch date. That gives you the position and velocity of the Earth on the date of launch. Second, choose a total flight time T_{flight}. That gives you the position and velocity of Mars.Second, choose a magnitude and direction (two angles) of the launch v_{infty}. You do it this way because you can bound the magnitude without having to impose an explicit constraint. That's an additional three variables. Add this vector to Earth's velocity to get the initial velocity of the spacecraft.Third, choose a "burn index" eta. This is scaling factor that varies in [0,1]. For practical purposes let's let it vary in [0.1,0.9]. Propagate the spacecraft forward in time from the date of launch to time t=eta*T_{flight}. For this you could use the "Universal Kepler Solver" on page 36 of Prussing and Conway. It's not great as it doesn't handle orbits with eccentricity 1, so if you're interested there is a better one in Battin's "Mathematics and Methods of Astrodynamics." You have now arrived at the point where the mid course burn will occur.Fourth, solve Lambert's problem to go from the burn point to the location of Mars in time (1-eta)*T_{flight}. Then calculate your braking burn (rendezvous, orbit insertion, aerobraking, whatever) just as you did before.This becomes a six variable problem. You control the launch window by putting bounds on the decision variables, most importantly T_{launch} and T_{flight}. I would use differential evolution or particle swarm to solve this. You could try using Excel's solver too. I think it could handle this problem because it should be unimodal (only one local minimum). I have not verified that though.The solver will find that the burn index should appear at the node point, assuming you've allowed a long enough T_{flight}. But if you insist on a very short transfer, it will place the burn earlier, and if you insist on a long transfer, it might go out to a high aphelion and do the burn there, or figure out for itself that it needs to do a multi-rev orbit. Very flexible.All that said, I like what you are doing. You're an artist by trade, right? One of the difficult things about the way engineers do orbital mechanics is that it's very difficult to explain to the general public. But your work, from what I see from your website, is a lot easier to present as a teaching tool. Every year we have an engineering open house and I think about having a booth, but I can't figure out how to explain what I do to kids and so I never do it.I will confess that I haven't checked your math yet. Can you add true anomaly to your chart? Or better yet x,y,z coordinates of the spacecraft and the planets so that we can check the endpoints.Also, do you have access to AIAA journals? If not I could go hunting for you and see if anyone has tried to do this before.

You're familiar with the Lambert space triangle?

Quote from: Twark_Main on 06/01/2024 07:04 pmIs there a scenario where it uses less fuel to do a plane change separately instead of combining it with the departure & arrival burns? Of course we all know about the bi-elliptic transfer, but is there a less extreme case you're thinking of?Selecting two posts from a very old thread.Quote from: Chris Bergin on 03/27/2011 12:17 amHeh. I can understand tense SLS threads, but not tense orbital mechanics threads! Quote from: jenglan3 on 03/27/2011 02:18 pmQuoteYou're familiar with the Lambert space triangle?Yes. You mentioned "Orbital Mechanics" by Prussing and Conway a few pages ago. I am one of Professor Conway's graduate students. I've been reading this message board for years but I never found anything that I felt I could contribute to. I'm happy to see an orbital mechanics thread!You are right that it is (usually) better to have a mid course maneuver. I say usually because sometimes it turns out from an operational perspective that it's cheaper in dollars to spend the extra fuel than it is to bring in the staff for an additional burn.The way I would do this numerically:First, choose the launch date. That gives you the position and velocity of the Earth on the date of launch. Second, choose a total flight time T_{flight}. That gives you the position and velocity of Mars.Second, choose a magnitude and direction (two angles) of the launch v_{infty}. You do it this way because you can bound the magnitude without having to impose an explicit constraint. That's an additional three variables. Add this vector to Earth's velocity to get the initial velocity of the spacecraft.Third, choose a "burn index" eta. This is scaling factor that varies in [0,1]. For practical purposes let's let it vary in [0.1,0.9]. Propagate the spacecraft forward in time from the date of launch to time t=eta*T_{flight}. For this you could use the "Universal Kepler Solver" on page 36 of Prussing and Conway. It's not great as it doesn't handle orbits with eccentricity 1, so if you're interested there is a better one in Battin's "Mathematics and Methods of Astrodynamics." You have now arrived at the point where the mid course burn will occur.Fourth, solve Lambert's problem to go from the burn point to the location of Mars in time (1-eta)*T_{flight}. Then calculate your braking burn (rendezvous, orbit insertion, aerobraking, whatever) just as you did before.This becomes a six variable problem. You control the launch window by putting bounds on the decision variables, most importantly T_{launch} and T_{flight}. I would use differential evolution or particle swarm to solve this. You could try using Excel's solver too. I think it could handle this problem because it should be unimodal (only one local minimum). I have not verified that though.The solver will find that the burn index should appear at the node point, assuming you've allowed a long enough T_{flight}. But if you insist on a very short transfer, it will place the burn earlier, and if you insist on a long transfer, it might go out to a high aphelion and do the burn there, or figure out for itself that it needs to do a multi-rev orbit. Very flexible.All that said, I like what you are doing. You're an artist by trade, right? One of the difficult things about the way engineers do orbital mechanics is that it's very difficult to explain to the general public. But your work, from what I see from your website, is a lot easier to present as a teaching tool. Every year we have an engineering open house and I think about having a booth, but I can't figure out how to explain what I do to kids and so I never do it.I will confess that I haven't checked your math yet. Can you add true anomaly to your chart? Or better yet x,y,z coordinates of the spacecraft and the planets so that we can check the endpoints.Also, do you have access to AIAA journals? If not I could go hunting for you and see if anyone has tried to do this before.

I guess I was right to have my doubts. No evidence of a show-stopper with hyperbolic orbits and Porkchop Plotters (innuendo isn't evidence).

[snip]

2. There are a couple of "if this is hyperbolic do X" spots in the code that likely haven't been tested

5. The hyperbolic orbits don't appear to be graphing correctly. Which means they weren't tested or someone would have fixed that.

Quote from: InterestedEngineer on 06/02/2024 05:09 am[snip]Yes, we know. "Code smell."Quote from: InterestedEngineer on 06/02/2024 05:09 am2. There are a couple of "if this is hyperbolic do X" spots in the code that likely haven't been tested"Likely" Sprinkling in unsupported, question-begging probability words to prop up your argument has a bad "rhetoric smell" FYI.Quote from: InterestedEngineer on 06/02/2024 05:09 am5. The hyperbolic orbits don't appear to be graphing correctly. Which means they weren't tested or someone would have fixed that.Now we're getting somewhere!!What are the reproduction steps? Can we get a screenshot of the incorrect graph or graphs?

Quote from: Twark_Main on 06/02/2024 05:39 amQuote from: InterestedEngineer on 06/02/2024 05:09 am[snip]Yes, we know. "Code smell."Quote from: InterestedEngineer on 06/02/2024 05:09 am2. There are a couple of "if this is hyperbolic do X" spots in the code that likely haven't been tested"Likely" Sprinkling in unsupported, question-begging probability words to prop up your argument has a bad "rhetoric smell" FYI.Quote from: InterestedEngineer on 06/02/2024 05:09 am5. The hyperbolic orbits don't appear to be graphing correctly. Which means they weren't tested or someone would have fixed that.Now we're getting somewhere!!What are the reproduction steps? Can we get a screenshot of the incorrect graph or graphs?It's reactions like these that argue for implementing McCabe complexity metrics in a development process so that a computer will tell someone their code is likely full of bugs instead of an experienced human "smelling" it.My dog is amused by the smelling analogy, BTW. He says smelling works just fine for finding food. One of which is bugs, coincidentally.

Is this your code?

Quote from: InterestedEngineer on 06/01/2024 01:24 amIdealized is good enough. It is irrelevant whether it's +/- a couple of days or a 0.5 km/sec.Looking at the (large) differences between various Earth-Mars conjunctions, I doubt it would be adequate. Also, 0.5 km/s is a lot!

Idealized is good enough. It is irrelevant whether it's +/- a couple of days or a 0.5 km/sec.

adjusting thrust angle

Here's a snapshot of a 30-100 day for departure Vinf.1. Why are there mid 2025, 2027, and late 2029 departures that aren't part of the normal window of Mars 2024, 2026, and 2028 conjunctions?2. Why are the high deltaV windows so narrow for the correct conjunctions in 2024, 2026, and 2028?3. I note it refused to give me an actual 30 day trip result.

You'll notice I've also excluded hyperbolic transfers (even having e > 0.98 was inducing some plotting weirdness, so I've kept everything within the regular elliptical transfers).

Do you know why there's plotting weirdness with hyperbolic transfers? I note that's what I got with the weird off-cycle pork chop transfers - only at hyperbolic speeds.

These algorithms are very touchy and ill-tempered, especially for multi-revolution orbits and at the transition between elliptic and hyperbolic orbits

From the video, I notice your paths are going "up and over" the Sun's poles. From this I gather you don't do broken plane transfers, only ballistic transfers.Check out these resources:https://hopsblog-hop.blogspot.com/2013/01/deboning-porkchop-plot.htmlhttps://physics.stackexchange.com/questions/123029/why-is-there-a-gap-in-porkchop-plotshttp://www.braeunig.us/space/ (section "Non-coplanar Trajectories")There's an implementation of the latter... for KSP. Selecting "Optimal" will perform both ballistic and broken plane calculations and return the cheapest option.https://alexmoon.github.io/ksp/https://github.com/alexmoon/kspEven that algorithm isn't quite optimal. It's actually better to do a hybrid strategy, with part of your plane change at departure and part of it during the mid-course burn. See:https://orbital-mechanics.space/orbital-maneuvers/plane-change-example.htmlhttps://space.stackexchange.com/questions/12997/saving-delta-v-by-splitting-plane-changing-manoeuvreIt's not perfectly optimal, but it's close. To find the exact optimal solution would require a 4-D binary hill climb for the mid-course burn X/Y/Z/time variables. At first I worried this would be too simplistic an approach, but further research reveals that's exactly how NASA solved the problem. https://ntrs.nasa.gov/api/citations/19940010378/downloads/19940010378.pdf (see "Optimizer" on page 16 / PDF page 28)Sorry for the number of links, but hopefully you find something useful in it.