raptop changed the topic of #principia to: READ THE FAQ: http://goo.gl/gMZF9H; The current version is Galileo. We currently target 1.5.1, 1.6.1, 1.7.x, 1.8.1, and 1.9.1. <scott_manley> anyone that doubts the wisdom of retrograde bop needs to get the hell out | https://xkcd.com/323/ | <egg> calculating the influence of lamont on Pluto is a bit silly… | <egg> also 4e16 m * 2^-52 is uncomfortably large
egg|anbo|egg_ has quit [Remote host closed the connection]
egg|anbo|egg has joined #principia
egg|anbo|egg has quit [Remote host closed the connection]
UmbralRaptor has quit [Ping timeout: 204 seconds]
UmbralRaptop has joined #principia
Blu3wolf has joined #principia
Mike` has quit [Ping timeout: 189 seconds]
Mike` has joined #principia
<discord-_>
moar ssto. — I don't know if this is the good place to ask or not, but at least guys here are good at numerical integrators. What is the intgerator that stock ksp uses for off rail calculations?
<discord-_>
moar ssto. — I encountered some serious kraken forces, near starts.
<discord-_>
moar ssto. — Assuming that ksp uses the dumbest form of integrator, then the error in velocity in each physics frame is second order and the second order term is directly porportional to jacobian of gravitational acceleration times velocity.
<_whitenotifier-9244>
[Principia] pleroy opened pull request #2693: Work-around polynomial operators +/- and fix the Mathematica test - https://git.io/JUJ2W
<_whitenotifier-9244>
[Principia] eggrobin labeled pull request #2693: Work-around polynomial operators +/- and fix the Mathematica test - https://git.io/JUJ2W
<discord-_>
Standecco. — I don't think it uses an integrator; keplerian orbits are just conics, so they're analytically determined by a simple quadric
<discord-_>
Butcher. — Off rails, not on.
<discord-_>
Butcher. — It probably uses forward Euler, or maybe semi-implicit if we're lucky.
<discord-_>
Standecco. — Oh, I read that "off rails" as "background"
<discord-_>
Standecco. — Too much persistent thrust
<discord-_>
moar ssto. — If I know the exact intergator it uses, then I can estimate the perturbations introduced and incude a currection for it when doing naneuvers.
<discord-_>
moar ssto. — If I know the exact intergator it uses, then I can estimate the perturbations introduced and incude a currection for it when doing maneuvers. (edited)
<discord-_>
moar ssto. — Currently the kraken perturbations are so strong that I need 40-60 throttle on an LVN engine on a 100t craft to kinda conteract it.
<discord-_>
moar ssto. — Currently the kraken perturbation is so strong that I need 40-60% throttle on an LVN engine on a 100t craft to kinda conteract it. (edited)
<discord-_>
Standecco. — int count2 = part.children.Count;
<discord-_>
Standecco. — for (int i = 0; i < count2; i++)
<discord-_>
Standecco. — {
<discord-_>
Standecco. — Part part2 = part.children[i];
<discord-_>
Standecco. — if (part2.isAttached)
<discord-_>
Standecco. — {
<discord-_>
Standecco. — Integrate(part2);
<discord-_>
Standecco. — }
<discord-_>
Standecco. — }
<discord-_>
Standecco. — does this help?
<discord-_>
moar ssto. — thank you, is this taken from stock ksp?
<discord-_>
Standecco. — I'm checking the FlightIntegrator class (which I assume does exactly this?) and in the end of its FixedUpdate, it calls this method
<discord-_>
Standecco. — wait, there's a better one
<_whitenotifier-9244>
[Principia] pleroy closed pull request #2693: Work-around polynomial operators +/- and fix the Mathematica test - https://git.io/JUJ2W
<_whitenotifier-9244>
[Principia] pleroy pushed 2 commits to master [+0/-0/±6] https://git.io/JUJw7
<_whitenotifier-9244>
[Principia] pleroy df03f42 - Work-around polynomial operators +/- and fix the Mathematica test.
<_whitenotifier-9244>
[Principia] pleroy 9699e42 - Merge pull request #2693 from pleroy/Bugs Work-around polynomial operators +/- and fix the Mathematica test
<discord-_>
Standecco. — anyway unless I'm looking in a completely wrong place (entirely possible), it's either Unity's integrator for AddForce or something else other than the integrator
<discord-_>
moar ssto. — These seems like are just means the integrator is taking in the forces?
<discord-_>
Standecco. — yeah, this doesn't seem like an integrator to me (who has never seen an integrator)
<discord-_>
moar ssto. — I think the ingerator is the code for `integrate(var)`.
<discord-_>
Standecco. — so either Unity does all the force integrations or I'm looking in the wrong place, as I said
<discord-_>
moar ssto. — > so either Unity does all the force integrations or I'm looking in the wrong place, as I said
<discord-_>
moar ssto. — @Standecco very likely the first option?
<discord-_>
moar ssto. — since unity is a well developed game engine.
<discord-_>
Standecco. — > I think the ingerator is the code for `integrate(var)`.
<discord-_>
Standecco. — @moar ssto where do you see that call?
<discord-_>
Standecco. — or method in general
<discord-_>
Standecco. — lowercase `integrate` doesn't exist in FlightIntegrator
<discord-_>
moar ssto. — Oh, I don't know if that's case sensitive, sorry about that.
<discord-_>
moar ssto. — > int count2 = part.children.Count;
<discord-_>
moar ssto. — > for (int i = 0; i < count2; i++)
<discord-_>
moar ssto. — > {
<discord-_>
moar ssto. — > Part part2 = part.children[i];
<discord-_>
moar ssto. — > if (part2.isAttached)
<discord-_>
moar ssto. — > {
<discord-_>
moar ssto. — > ***Integrate(part2);
<discord-_>
moar ssto. — > }
<discord-_>
moar ssto. — Just a guess, I have no clue yet waht is going on.
<discord-_>
Standecco. — Oh alright, that's the same function
<discord-_>
Standecco. — It's a recursively called function
<discord-_>
Standecco. — It just calls the integrator for children parts too
<discord-_>
Standecco. — Makes sense, given the tree structure of stock vessels
<discord-_>
moar ssto. — So it does the per part calculations, not on the entire vessel?
<discord-_>
moar ssto. — So this function channels the force between parts?
<discord-_>
Standecco. — yeah, this basically applies all the forces of flight (first 3 statements with `part.rb.AddForce()`) (`vessel.precalc.integrationAccel` turns out to be gravitational + coriolis + centrifugal acceleration; `part.force` is, I guess™️, engine and RCS thrust and similar; `part.torque`, therefore, torque generated by engine/RCS/reaction wheels),
<discord-_>
Standecco. — then it applies additional forces (`part.rb.AddForceAtPosition` and `part.forces loop`) that I guess™️ are forces between parts,
<discord-_>
Standecco. — then I have no idea what `part.servoRB` is, but I guess™️ it might be BG's robotic servos,
<discord-_>
Standecco. — then it clears the old forces,
<discord-_>
Standecco. — then it updates the aerodynamics,
<discord-_>
Standecco. — then it calls itself on all the children (recursively, so it will integrate each vessel "branch" at a time)
<discord-_>
Standecco. — yeah, this basically applies all the forces of flight (first 3 statements with `part.rb.AddForce()`) (`vessel.precalc.integrationAccel` turns out to be gravitational + coriolis + centrifugal acceleration; `part.force` is, I guess™️, engine and RCS thrust and similar; `part.torque`, therefore, torque generated by engine/RCS/reaction wheels),
<discord-_>
Standecco. — then it applies additional forces (`part.rb.AddForceAtPosition` and `part.forces` loop) that I guess™️ are forces between parts,
<discord-_>
Standecco. — then I have no idea what `part.servoRB` is, but I guess™️ it might be BG's robotic servos,
<discord-_>
Standecco. — then it clears the old forces,
<discord-_>
Standecco. — then it updates the aerodynamics,
<discord-_>
Standecco. — then it calls itself on all the children (recursively, so it will integrate each vessel "branch" at a time) (edited)
<discord-_>
moar ssto. — Seems like it's doing all the math in a BCVA frame.
<discord-_>
Standecco. — so it's really just the place where all the forces are added to the craft; Unity then probably integrates it on its own
<discord-_>
Standecco. — so it's really just the place where all the forces are added to the craft; Unity then probably integrates them on its own (edited)
<discord-_>
moar ssto. — It's odd, since when i used kos, as soon as clearing atmo, all things are dispayed in inertal frame.
<discord-_>
moar ssto. — As far as I'm aware, kos calls stuff directly from ksp without re-procdsssing.
<discord-_>
Standecco. — this is how gravitational acceleration is calculated
<discord-_>
Standecco. — I read that, but it doesn't say anything about the integrator used
<discord-_>
Katniss. — Well, Unity uses PhysX engine for physics (and they planned to add Havoc too, but that's either not done yet, or it's very fresh)
<discord-_>
Katniss. — Well, Unity uses PhysX engine for physics (and they planned to add Havok too, but that's either not done yet, or it's very fresh) (edited)
<discord-_>
moar ssto. — Do they use diffierent integrators?
<discord->
moar ssto. — So not very different from forward euler method, hmm
<discord->
moar ssto. — So me guestimiation about tidal term disturbing the orbital elements is true.
Mike` has joined #principia
UmbralRaptor has joined #principia
UmbralRaptop has quit [Ping timeout: 204 seconds]
<_whitenotifier-9244>
[Principia] pleroy commented on issue #2685: Very long scene changes with outer-planet probes - https://git.io/JUUXa
<discord->
lamont. — @Standecco is that the actual KSP source code that i'm looking at for computing gravity?
<discord->
Standecco. — it is, why?
<discord->
Standecco. — should be 1.8.1
<discord->
lamont. — been wanting to see this for fucking years
<discord->
lamont. — so KSP is using `vessel.orbit.GetOrbitalStateVectorsAtUT(uT, out railsPosNext, out railsVelNext);` and then applying a bunch of logic to make the PhysX engine do the right thing to get that position at the next step
<discord->
lamont. — and my guess would be that is just the front end to a kepler solver
<discord->
lamont. — there's a whole bunch of nonsense in that block of code to deal with the inverse rotation and the kraken velocity
<discord->
lamont. — i'm guessing though there's another method that applies the pre+post integration velocity offsets+correction variables to the PhysX engine calculations
<discord->
lamont. — yeah so it figures out the right answers from Kepler, then it does a coordinate transform more or less to convert it to the co-rotating reference and i would bet money that egg can find some bugs in it
<discord->
lamont. — yeah so it figures out the right answers from Kepler, then it does a coordinate transform more or less to convert it to the co-rotating reference frame and i would bet money that egg can find some bugs in it (edited)
<discord->
Standecco. — if you want more info, this code is in the VesselPreCalculate class
<discord->
Standecco. — there is a MainPhysics method that looks pretty important
<discord->
Standecco. — ```Cs
<discord->
Standecco. — public virtual void MainPhysics(bool doKillChecks)
<discord->
moar ssto. — Odd that the semimajoraxis drifts faster than the real time simulation I run with the semi-implicit euler's method.
Jesin has joined #principia
<discord->
moar ssto. — (I used semimajoraxis as an indication for specific orbital energy)
<discord->
lamont. — the problem is that the physics engine needs to be in the corotating frame so that the velocities are mostly removed. the physics engine needs the vessel at the origin of the coordinate system and without orbital velocities. the way that KSP is doing that (from that code above) looks like they solve the kepler problem, then tweak up some hacks so that the numbers that come out of the physics engi
<discord->
moar ssto. — So it's a bit more complecated than feeding the forces acting on a pointmass and get the cartesian posvel of it?
<discord->
moar ssto. — So it's a bit more complecated than feeding the forces acting on a pointmass into the PhysX integrator and get the cartesian posvel of it? (edited)
<discord->
lamont. — much
<discord->
Kirk. — Doesn't PhysX actually calculate angular momentum incorrectly? (well, it intentionally calculates angular momentum differently than real life)
<discord->
sichelgaita. — > pretty sure they're getting it slightly wrong though
<discord->
sichelgaita. — Someone shared a code snippet earlier today that had: `Vector3d a = vessel.velocityD + integrationAccel * fDeltaTime;`. This looks suspiciously like a step of forward Euler. As in: let's do a bit of integration ourselves, we wouldn't want to give the forces to PhysX and let it do proper symplectic integration.
<discord->
Kirk. — Also a quote from that issue: * PhysX is crap.*
<discord->
Kirk. — Also a quote from that issue: “PhysX is crap.” (edited)
<discord->
Kirk. — Basically, PhysX does a lot of math wrong, some of it on purpose, and some of it because nobody cares
<_whitenotifier-9244>
[Principia] pleroy opened pull request #2695: Extraction of a piecewise Poisson series from a continuous trajectory - https://git.io/JUU5q
<discord->
lamont. — PhysX mostly only has to make "Doom 7: Doomer and Gloomer" look like it has realistic physics near the origin and within a max of 50 m/s of zero velocity on a flat earth with constant gravity.