Global Errors when solving the Equation of Motion

Click For Summary
SUMMARY

The discussion focuses on implementing the 4-step Adams-Bashforth method to solve the equation of motion. The user’s code produces results with global errors proportional to delta instead of the expected delta^4. This discrepancy arises from incorrectly updating the acceleration and velocity variables, leading to behavior akin to the Euler forwards method. The solution involves reordering the updates for the acceleration and velocity variables to achieve the desired accuracy.

PREREQUISITES
  • Understanding of numerical methods, specifically the Adams-Bashforth method
  • Familiarity with programming concepts, including variable assignment and sequential execution
  • Knowledge of basic physics principles related to motion and forces
  • Proficiency in a programming language suitable for numerical computations
NEXT STEPS
  • Review the implementation of the Adams-Bashforth method in numerical analysis
  • Learn about error analysis in numerical methods, focusing on global and local errors
  • Explore the differences between explicit and implicit methods in solving differential equations
  • Investigate optimization techniques for improving numerical method implementations
USEFUL FOR

Students and professionals in computational physics, numerical analysts, and software developers working on simulations involving differential equations.

RH10
Messages
6
Reaction score
0
Hi All,
I’m implementing a code to solve the equation of motion using the 4-step Adams-Bashforth method.
Here’s my section of code that does this:

a=F/m;

upnew= up + delta *( (55/24)*a - (59/24)*am1 +(37/24)*am2 - (3/8)*am3 );
xnew=x + delta *( (55/24)*up - (59/24)*upm1 +(37/24)*upm2 - (3/8)*upm3);

am1=a;
am2=am1;
am3=am2;
upm1=up;
upm2=upm1;
upm3=upm2;

up=upnew;
x=xnew;

It seems to work; at least it produces sensible results which agree with the Euler forwards method. However, I read that the global error should be proportional to delta^4, but this code produces results that have errors proportional to delta. Why is this? Is there some quirk of using the method as a double integral reduces the accuracy? Or am I getting something wrong?

Thanks in advance,
 
Last edited:
Physics news on Phys.org
RH10 said:
am1=a;
am2=am1;
am3=am2;
Assuming your programming language executes statements sequentially. that sets am1 = a, then am2 = a, then am3 = a. You are getting similar results to the Euler forwards method because your code is just a complicated way of doing the Euler forwards method!

The fix is to update things in the right order.
am3=am2;
am2=am1;
am1=a;
and similarly for the u's
 

Similar threads

Replies
4
Views
5K
  • · Replies 65 ·
3
Replies
65
Views
9K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 0 ·
Replies
0
Views
4K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K