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] Help w/ Euler Cromer algo.



Better late than never.


On 2014, Sep 23, , at 15:02, Bill Nettles <bnettles@uu.edu> wrote:

> I've taken a look at the code, and I don't see how you are calculating what 
> you call "residuals.” *** Is that a root mean square error of a fitting 
> routine, the root mean square of the point-by-point comparison to a cosine, 
> or the max difference of any one calculated point compared to a cosine, or 
> something else? 
> 
> If I take sqrt[ 1/N *sum( (calc-cosine)^2) ] I get numbers in the range of 
> 2.7e-7 for 0.1 ms time step over 50 periods.  I get 1e-5 for 1.0 ms time 
> steps over 50 periods.
> For 1 period:   0.1 ms time step -> 3.8e-8   and 1.0 ms time step -> 1.2 e-6
> 

IIRC, I obtained ~ the same.

> The differences (in my calcs) oscillate like a sine curve which says that the 
> largest discrepancies are occurring near theta=0 and smallest near + and - 
> thetamax.


This “makes sense”, and is the motivation for the article to which I referred 
wherein the algo. detects speed and adjusts the step time accordingly, no?

***That program doesn’t — I input its output into Kaleidagraph and fit w/  
m1*cos(m2*m0+m3)+m4  .    Kal. finds the diff. between its fit values and the 
inputted to give the residuals.  If there is no weighting of the values the 
Chisquare it displays is the sum of the squared residuals.  It also displays 
the Pearson R^2, which is too complicated for me to understand.  Unless I 
ensure the number of points outputted are the same, I compare various run using 
Chisquare / (number of points).  

I’ve moved on from this problem, as the “error” produced by the simulation when 
including the sin(angle) is "somewhat" greater than the integration 
approximation.  However,  here are the errors for 30s runs.  (note after 15s 
the pendulum error increases.  As JD suggested for the determination of lack of 
harmonicity only one period is sufficient.  Note the only difference between 
the two graphs is the introduction of sin(theta) for theta in the Q line.  
[Better would be A instead of Q, no?]

Index of /PHYS-L-1  


http://www.cleyet.org/PHYS-L-1/



bc  thanks all much!,   and more later.