Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: [Phys-L] report on the quality of three simple numerical ODE solutions




On 2015, Nov 12, , at 06:18, Tom Van Baak <tvb@LeapSecond.com> wrote:

Hi Bernard,

Thanks for the report. Very interesting.

It looks like Euler-Richardson is much better than Cromer or Denker in this case. But that may be because you chose to simulate free-fall, where both speed and distance are positive, unbounded and grow quadratically.

My gut tells me your examples do not apply so well to pendulum simulation where both speed (omega) and distance (theta) are both bounded and symmetrical about zero.


Yes, but only almost due to dissipation. The phase plot spirals.


I looked into this is some detail when I chose Euler-Cromer (instead of plain Euler) for my pendulum simulations (http://leapsecond.com/hsn2006/). It is also explained in Cromer's original 1980 AAPT paper.

Yes, the Euler “blows up" - seriously.
Yes, perhaps I shoulda included my tests w/ the harmonic oscillator in which the better approximations are different. [I did this first a coupala months ago.] Cromer, as you wrote, has the error in the first Pi and cancel in the second. This works partially even w/ linear dissipation.(1) Kaleidagraph is convenient in that one may acquire the errors for plotting. I’ll now look at the tests to verify my memory. (2) Unfortunately, I don’t know if there is a quad. dissipation cyclical ODE. Perhaps Newtonian orbits? Perhaps Cromer wrote this, which I missed. NASA's (JPL) been doing this for > half a century.


But I can look into this more if you want. My test program is http://leapsecond.com/tools/skydiver.c (skydiver.exe). I may have made a mistake (I spent less than an hour on it this morning) and I can run some more tests if you like. If nothing else, you can see the C code is vastly simpler and easier to read than your C++ code/PDF.

I'm also wondering why your plots show different values for "m1"? That should be fixed at 0.003, shouldn't it? That is, did you curve fit instead of just computing the actual error in each of your simulations? I guess I'm confused what your little blue box of numbers means in each of your plots.

Mmmm, I see your point. By allowing the drag coefficient to vary the E-R Chi Square is ~ 1/6 (smaller). I’m so accustomed to fitting w/ variable coefficients, I, suppose, incorrectly did.



Perhaps one of the mathematicians on the cc line can chime in. But it seems to me one should compare or validate a particular numerical integration method against the actual physics that you plan to experiment with. That is, maybe don't test an algorithm with 10 seconds of free-fall and then operate the algorithm with 10 seconds of a pendulum swinging. But I don't know for sure. I'm glad you brought up the issue.

As I wrote, I though, intuitively, that quad and linear would behave differently and tho not cyclical, if an approx. was better w/ fall quad it would be better w/ a harmonic oscillator.

I now think all this was an unnecessary exercise as all of them for horological purpose (except the forward Euler) are good enuff. However, when I first started doing this I found there was an optimum step time near one ms. I want to verify this. I think I was using the leapfrog from Eisberg — (same as Feynman’s?)

bc

BTW, in one case I used 100 micro sec (instead of one ms) and the Chi Square decreased two orders, as, I think, it should.


(1) This reminds me of the adiabatic invariant. All of my experiments (elevator, ramp, and artificial g change using an e-magnet and a PM on the bob) showed not invariant. I continued to think not sufficiently adiabatic. Then I numerically modeled it and found also not invariant. I decreased the g change rate w/ no change in the lack of invariance, but did change, as now expected, w/ change of the Q. Finally I did some lit. search, which suggested the derivation assumed E conservation (Hamiltonian?) [Remember I’m very maths declined.]

(2) Here’s the Chi Squares for Cromer, Sandvik, Euler-Richardson, and Denker [which is the same as Young’s (leapfrog?)]
1.15798e-17; 1.580e-17; 7.61e-17; 7.065e-11 Curiously the simplest is the best (of the four). this is linear dissipation of the harmonic oscillator (not pendulum)


Thanks,
/tvb
www.LeapSecond.com

----- Original Message -----
From: Bernard Cleyet
To: Forum Physics Educators
Cc: Bryan Mumford ; Douglas Drumheller ; Tom Van Baak ; Bob Holmstrom ; sandvik@bu.edu ; youngp@ucsc.edu ; sbsp@aol.com ; dave ; bill.watkins@csun.edu ; Watkins, Ann E
Sent: Wednesday, November 11, 2015 3:54 PM
Subject: report on the quality of three simple numerical ODE solutions

Index of /simple-ODE-comparisons


http://www.cleyet.org/simple-ODE-comparisons/

bc has consumed too much time on this.


p.s. next, I pray, the report with linear dissipation harmonic oscillator — the result is different. Cromer partially explains. And, finally, the effect of noise.