GreeningGalaxy has quit [Ping timeout: 206 seconds]
GreeningGalaxy has joined #kspacademia
e_14159 has quit [Ping timeout: 194 seconds]
e_14159 has joined #kspacademia
GreeningGalaxy has quit [Ping timeout: 190 seconds]
GreeningGalaxy has joined #kspacademia
Snoozee is now known as Majiir
<Majiir>
!wpn egg|zzz|egg
* Qboid
gives egg|zzz|egg an inductive ordinal which strongly resembles a polyhedron
<Qboid>
Majiir: SilverFox left a message for you in #kspmodders [01.03.2017 04:56:40]: "Jung Yeong is rather amazing, top 3 so far for me"
<Qboid>
Majiir: SilverFox left a message for you in #kspmodders [01.03.2017 15:55:24]: "I love how jihyo sang the song sung by a fat girl about it being good being fat"
<Qboid>
Majiir: SilverFox left a message for you in #kspmodders [01.03.2017 22:08:17]: "I vote in Sana, Jungyeon, Nayeon, and Jihyo"
<Qboid>
Majiir: SilverFox left a message for you in #kspmodders [01.03.2017 23:54:25]: "THEY KILLED OFF MOMO IM SO SAD. WHAT DO"
<Qboid>
Majiir: SilverFox left a message for you in #kspmodders [02.03.2017 04:34:21]: "I'm on the final mission now, I think the final group will be: Sana, Momo, Nayeon, Jihyo, Jungyeon, Somi, Mina"
<Majiir>
....my apologies
<Majiir>
!wpn egg|zzz|egg
* Qboid
gives egg|zzz|egg a dorsal telescope
GreeningGalaxy has quit [Ping timeout: 180 seconds]
<UmbralRaptor>
!wpn Majiir
* Qboid
gives Majiir a yttrium goto
<Majiir>
GOTO considered harmful
<Majiir>
especially in this case
<Majiir>
!wpn egg
* Qboid
gives egg a surprise [REDACTED]
<Majiir>
Wow, it's really a surprise
<Majiir>
UmbralRaptor, how much of Principia magics do you understand?
<UmbralRaptor>
Probably not enough to answer whatever question you're about to ask. =\
Majiir is now known as Snoozee
icefire has quit [Read error: Connection reset by peer]
oeuf has joined #kspacademia
egg|zzz|egg has quit [Ping timeout: 206 seconds]
ferram4 has quit [Read error: Connection reset by peer]
ferram4 has joined #kspacademia
<oeuf>
ow, missed the majiir
oeuf is now known as egg
<egg>
!tell Majiir you had a question about principia?
<Qboid>
egg: I'll redirect this as soon as they are around.
<egg>
!seen soozee
<Qboid>
egg: I last saw Soozee on [21.02.2017 02:40:37] in #kspmodders saying: "These concepts have names that I don't remember"
* egg
wonders whether he should go back to sleeping at 3 so there's a window to talk to majiir et al.
* egg
stabs timezones
<egg>
UmbralRaptor: can we flatten the earth
TonyC has joined #kspacademia
icefire has joined #kspacademia
oeuf has joined #kspacademia
oeuf has quit [Client Quit]
egg has quit [Quit: moo.]
egg has joined #kspacademia
TonyC1 has joined #kspacademia
TonyC has quit [Ping timeout: 206 seconds]
GreeningGalaxy has joined #kspacademia
Technicalfool is now known as Technicality
Technicality is now known as Technicalfool
egg is now known as egg|principia|egg
GreeningGalaxy has quit [Ping timeout: 194 seconds]
<kmath_>
<FioraAeterna> you: floating point rounding error cancels out, so it's okay me, an intellectual: *cries into a bucket of ice cream*
* UmbralRaptor
converts earth from spherical to rectangular coordinates, as requested.
<egg>
!wpn UmbralRaptor
* Qboid
gives UmbralRaptor an abstruse sphere
<egg>
appropriate
* UmbralRaptor
blinks at Qboid
GreeningGalaxy has joined #kspacademia
icefire has quit [Ping timeout: 201 seconds]
egg is now known as egg|nomz|egg
GreeningGalaxy has quit [Quit: SIGNAL LOST]
egg|nomz|egg is now known as egg
egg|cell|egg has joined #kspacademia
egg|phone|egg has quit [Read error: -0x1: UNKNOWN ERROR CODE (0001)]
egg|phone|egg has joined #kspacademia
egg|cell|egg has quit [Read error: Connection reset by peer]
Moistmelon has joined #kspacademia
pizzaoverhead has quit [Quit: Leaving]
Thomas is now known as Thomas|AWAY
Snoozee is now known as Majiir
<egg>
Majiir: you had a question about principia?
<Majiir>
I do
<egg>
what is it
<Majiir>
This is going to be a silly question in layman's form
<Majiir>
not because I am stupid but because I am interested in something only tangentially related to Principia
<Majiir>
so here goes
egg|laptop|egg has joined #kspacademia
<Majiir>
A naive way of simulating a planet's motion would be: at a fixed timestep, compute the force of gravity on the body, and update the velocity of the body
<egg|laptop|egg>
and what do you do with the position
<Majiir>
Let's say we update the position on a much faster timestep
<Majiir>
using the velocity
<Majiir>
You could imagine this planet traveling on a path made of lots of straight segments. (This is the naive version remember)
<egg|laptop|egg>
right, but note that updating is correct
<egg|laptop|egg>
so you don't care about a smaller timestep
<Majiir>
Sure
<egg|laptop|egg>
you integrate exactly if it's just linear inertial motion
<egg|laptop|egg>
the question is which velocity
<egg|laptop|egg>
that matters
<egg|laptop|egg>
a lot
<Majiir>
....okay slow down
<Majiir>
Like I said, starting layman here
<Majiir>
I'm trying to use what little I know about Principia to form a question about something I know even less about
<Majiir>
so let me build up a little more context
<egg|laptop|egg>
yeah, so not sure whether to interrupt and tell you how awesome leapfrog is, or let you continue
<egg|laptop|egg>
go ahead :-p
* egg|laptop|egg
wags tail and drools and barks something about leapfrog
<Majiir>
For a planet with a highly elliptical orbit, it moves faster at periapse and slower at apoapse (assuming a two-body system here) so with a fixed timestep, your 'segments' are shorter when the planet is near apoapse and longer near periapse
<Majiir>
(again assuming the naive simulation)
<egg|laptop|egg>
yes
<Majiir>
This is not really what we want, so we might imagine a simulation where every segment is made equal length (hi Kepler)
<Majiir>
But if we looked at what Principia does, simplifying a lot of the details, it actually goes "beyond" that and your "segments" are *shorter* near periapse, yes?
<UmbralRaptor>
Yes
<UmbralRaptor>
Time
<UmbralRaptor>
er
<Majiir>
acknowledging that they are probably not straight segments and that I'm probably butchering a lot of the details
<egg|laptop|egg>
UmbralRaptor: no well it depends >_>
<egg|laptop|egg>
predictions clearly yes
<egg|laptop|egg>
history, it's fixed step
<egg|laptop|egg>
and we don't do the Wisdom-Holmann stuff
<egg|laptop|egg>
Majiir: so, beyond, methinks that would be counterproductive?
<Majiir>
So that's what my question is about basically: if we can vary our timestep, what is a desirable "length" step and how do we know?
* UmbralRaptor
tyop'd time
<egg|laptop|egg>
UmbralRaptor: yeah, we use something by Dormand-Prince-El-Migonnabutcherthatname
<Majiir>
My intuition is that since near periapse the force of gravity is much higher, we would want shorter steps (length-wise)
<egg|laptop|egg>
indeed we do
<egg|laptop|egg>
so, if you don't want symplecticity this is all easy
<egg|laptop|egg>
Majiir: how familiar are you with numerical integration
<Majiir>
You guys keep using words and names I don't know
<Majiir>
I'm not a stupid person :(
<UmbralRaptor>
In practice, you need something to predict error vs stepsize AIUI
<egg|laptop|egg>
I did not say that you're stupid Majiir, I'm simply trying to see what sort of words I should use
<Majiir>
heh
<Majiir>
Numerical integration, sounds like something I did in calculus and then nevermore
<UmbralRaptor>
So something where you put integration in your integration (yo, dawg)
<egg|laptop|egg>
if you've been through an NM II course, then I can say "use an embedded RK method"
<Majiir>
Yeah I don't know jack about Runge Kutta whatever
<egg|laptop|egg>
if you've not been through that, and vaguely remember Runge and Kutta as weird german names and no more, I need to do a bit more backgroud
<egg|laptop|egg>
ground even
<egg|laptop|egg>
also webchat is bad at scroll
<egg|laptop|egg>
sob
<egg|laptop|egg>
all clients suck
<egg|laptop|egg>
lemme /clear, I have the quark-thomas logs
* UmbralRaptor
would rather not read a pdf on a phone.
<egg|laptop|egg>
UmbralRaptor: ah right.
<egg|laptop|egg>
Majiir: so, you have fixed step integrators
<egg|laptop|egg>
Majiir: uuuh let's limit ourselves to single-step method for a moment, I'll come back to the multistep stuff later.
<egg|laptop|egg>
Majiir: you have one-step methods.
<Majiir>
I am alive
<Majiir>
I don't know kth order integration methods, no
<Majiir>
or if I do I don't remember
<Majiir>
which is close enough to not knowing :)
<egg|laptop|egg>
lemme try to phrase it functionally
<egg|laptop|egg>
that's good for mathematicians so that's how I learned it
<egg|laptop|egg>
and you'll enjoy it too :-p
<egg|laptop|egg>
Majiir: a fixed step integrator is the following thing: it takes an ODE x'=f(x), an initial state x(t0), a step h, a final time t1, and yields an approximation x^(t1) of the true solution x(t1).
<egg|laptop|egg>
we can break things up, and I have fun headers full of glorious abstractions that you can look at and that may be instructive, but let's keep it to that formulation for now
<egg|laptop|egg>
Majiir: now, the cost (measured in evaluations of the RHS f) is proportional to (t1-t0)/h, the number of steps
<Majiir>
So the step h is a quantity of time?
<egg|laptop|egg>
ah yes
<egg|laptop|egg>
Majiir: specifically, it is the type of the difference of the ts :-p
<egg|laptop|egg>
(yeah, time)
<Majiir>
Oh, duh "fixed step integrator"
<Majiir>
I was going to exclaim "but egg this requires the steps to be fixed!"
<Majiir>
...and I suppose this is by desgin
<Majiir>
design*
<egg|laptop|egg>
Majiir: the method is said to be of order k if the error, that is, |x^(t1) - x(t1)|, can be expressed as O(h^k) as h tends to 0 (where the constants depend on x(t0) and f, basically on your problem)
<egg|laptop|egg>
Majiir: thus, if method is of order 1, halving the time step halves the error (roughly, assuming it's mostly converged, it's asymptotics, eventually you hit FP issues, yadayada)
<egg|laptop|egg>
Majiir: if it is of order 2, halving the time step divides the error by four (but recall, it only doubles the work!)
<egg|laptop|egg>
if it is of order 10, halving the time step divides the error by 1024 (again ideally), for only double the work.
<egg|laptop|egg>
Majiir: but, typically, a higher-order integrator will require more work per step.
<egg|laptop|egg>
so there's a tradeoff
<egg|laptop|egg>
which yields fun curves
<Majiir>
Yeah but it's a silly practical concern
<egg|laptop|egg>
Majiir: nevertheless allow me to show you some graphs, they illustrate the idea well
<egg|laptop|egg>
37 fixed step integrators, on the same problem
<egg|laptop|egg>
Majiir: horizontal axis, number of evaluations (work). vertical, error
<egg|laptop|egg>
(in this case energy error in a gravitational problem, who cares about the specifics)
<egg|laptop|egg>
Majiir: the more horizontal lines are the low-order methods
<egg|laptop|egg>
it's log-log, all of the polynomials I described are lines
<Majiir>
I see
<egg|laptop|egg>
Majiir: so for the blue-green-yellow order 2 methods, it takes ages to improve
<Majiir>
But these are all fixed timesteps, yes?
<egg|laptop|egg>
but if you are ok with a highish error, they are better than the higher order methods
<Majiir>
I think I'm missing something
<egg|laptop|egg>
they'll start behaving well faster, and their steps are cheap
<Majiir>
What is it about one of these methods that makes it a *fixed step* integrator?
<egg|laptop|egg>
for the user, h is a param of that function
<egg|laptop|egg>
internally, it means that it computes the state at t0, t0+h, t0+2h, t0+3h, etc.
<egg|laptop|egg>
Majiir: now, as you correctly identified, this is an issue
<egg|laptop|egg>
because you may be spending a lot of work computing a trajectory that's boring (say, mostly a straight line away from everything), and then you have expended all your supercomputer budget when you get to the interesting bit (when you're whizzing past that black hole)
<Majiir>
Right
<egg|laptop|egg>
Majiir: but let's formalize that
<Majiir>
(And while the gravity case is good for an example, I'm actually interested in something more general)
<egg|laptop|egg>
what makes it spending too much work on that boring trajectory
<egg|laptop|egg>
it is the fact that you could spend less work there, and still have an acceptable error *on that bit*
<egg|laptop|egg>
but what is the error on that bit? and how big should "that bit" be?
<egg|laptop|egg>
you introduce the concept of local error
<egg|laptop|egg>
and things get fun
<egg|laptop|egg>
what you do is you define a tolerance
<egg|laptop|egg>
and you say "at every step" (note how steps were not really something that mattered much if you were only interested in the final value in the previous integrator; here they're integral to the definition of the error)
<egg|laptop|egg>
"at every step, the error *resulting from that step* should not exceed that tolerance"
<egg|laptop|egg>
why is that interesting?
<egg|laptop|egg>
because after all, should you not be interested in the overall error?
<egg|laptop|egg>
well
<egg|laptop|egg>
no you shouldn't :D
<egg|laptop|egg>
not in a chaotic system
<egg|laptop|egg>
any error
<egg|laptop|egg>
the tiniest measurement error
<egg|laptop|egg>
will get amplified beyond recognition in a chaotic system
<egg|laptop|egg>
I wrote something about bop, which you should read, it's accessible
<egg|laptop|egg>
it's hilarious, millimetric perturbation completely dephase things in 5 years
<egg|laptop|egg>
so, you can't win on the front of global error anyway
<SnoopJeDi>
instability \o/
<egg|laptop|egg>
but, your simulation shouldn't yield things that are obviously wrong
<egg|laptop|egg>
an observer that looks at your system at time t and at time t+δt shouldn't look at that and say "WTF"
<egg|laptop|egg>
Majiir: and that's what local error reflects
<egg|laptop|egg>
Majiir: "assuming that what we have for time t be the truth, how much did we fuck it up over one step"
<egg|laptop|egg>
Majiir: and then, how do you do that
<egg|laptop|egg>
well, you try doing a step of size h
<egg|laptop|egg>
and you *magically* estimate the error
<egg|laptop|egg>
(we'll come back to that)
<egg|laptop|egg>
either your estimation is above what you tolerate
<egg|laptop|egg>
and then you start again with a lower h (which you may compute intelligently, using the order of your one-step-method)
<egg|laptop|egg>
or it's below the tolerance
<egg|laptop|egg>
and then, well, that step's good enough, no reason to throw out a calculation
<egg|laptop|egg>
but next time, you try with a bigger one, because you're doing too much work
<egg|laptop|egg>
again estimating what the bigger one should be using your order
<egg|laptop|egg>
(e.g. if your local order is 2, and your error is one fourth of the tolerance, doubling the step should bring you close to there; you don't want to fail a step too often, so maybe a bit less than doubling the step?)
<egg|laptop|egg>
Majiir: does this make sense up to now?