You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In cell [2], where diff_forward is defined. It seems like it has been defined in the opposite sense of the usual. (https://mathworld.wolfram.com/ForwardDifference.html)
The usual definition would be diff_a = a[i+1] - a[i], whereas (if I understand roll correctly) it seems that here the function is calculating diff_a = a[i] - a[i+1]. (so there is a sign error).
Also, regardless of the sign error the diff_a would be a variable that ends up on ax1:right, but instead in the paragraph below it seems to suggest that things end up on ax1:left (which is what would happen if we were doing a backward difference.
The text was updated successfully, but these errors were encountered:
I think that you are right about what the code does. I personally always get confused by the sign of roll. Reading the text it does indeed seem like a backwards difference was intended, so maybe lets just rename the function to backwards_difference and do np.roll(a,1, ...)? @TomNicholas do you agree?
In cell [2], where diff_forward is defined. It seems like it has been defined in the opposite sense of the usual. (https://mathworld.wolfram.com/ForwardDifference.html)
The usual definition would be diff_a = a[i+1] - a[i], whereas (if I understand roll correctly) it seems that here the function is calculating diff_a = a[i] - a[i+1]. (so there is a sign error).
Also, regardless of the sign error the diff_a would be a variable that ends up on ax1:right, but instead in the paragraph below it seems to suggest that things end up on ax1:left (which is what would happen if we were doing a backward difference.
The text was updated successfully, but these errors were encountered: