Numerical RK4 integrator help

In summary, the speaker is having trouble with angular motion in their vehicle physics engine and is considering rewriting their RK4 integrator using momentum. They are seeking assistance and resources for using a momentum-based RK4.
  • #1
smythst
1
0
I'm writing a vehicle physics engine and am using an RK4 integrator which I wrote. But I am having huge problems with angular motion. Long story short I thing it might be to do with the fact that I'm integrating from accelerations. So I'm re-writing the integrator using momentum. However I'm very sketchy about momentum and how to handle it. Anyone know where I can see some good demos of a momentum based RK4, or perhaps anyone interested in having a look at my code to see if they can help?

Cheers.
 
Physics news on Phys.org
  • #2
You may find some help in In this thread.

What is it you are trying to do?
 
  • #3


It sounds like you are on the right track by considering using momentum instead of accelerations in your RK4 integrator. Momentum is a key concept in physics and can greatly improve the accuracy and stability of numerical integrators. I would recommend looking into some resources on numerical methods for solving differential equations, as they often cover the use of momentum in integrators.

As for demos or examples of momentum-based RK4 integrators, there are several available online that you can refer to for guidance. Additionally, there are many forums and communities dedicated to physics engines and numerical methods, where you can seek advice and feedback on your code. It may also be helpful to work with someone who has experience in this area to review your code and offer suggestions.

Overall, it is great that you are actively seeking solutions to improve your integrator and I am sure with some additional research and support, you will be able to successfully implement momentum in your code. Best of luck!
 

1. How does a numerical RK4 integrator work?

A numerical RK4 integrator is a mathematical algorithm used to approximate the solution of a differential equation. It works by breaking down the differential equation into smaller time steps and using a weighted average of four different approximations to calculate the next step in the solution.

2. What are the advantages of using a numerical RK4 integrator?

One advantage of using a numerical RK4 integrator is that it is a higher order method, meaning it is more accurate than simpler numerical integration methods. It also has relatively low computational cost compared to other high order methods.

3. What types of problems can a numerical RK4 integrator solve?

A numerical RK4 integrator can solve a wide range of problems, including initial value problems, boundary value problems, and stiff systems of equations. It is commonly used in physics, engineering, and other scientific fields.

4. How do you choose the step size for a numerical RK4 integrator?

The step size for a numerical RK4 integrator should be small enough to ensure accuracy, but not so small that it increases the computational time significantly. It is typically chosen based on the desired level of precision and the stability of the differential equation being solved.

5. Are there any limitations to using a numerical RK4 integrator?

While a numerical RK4 integrator is a reliable method for solving many types of differential equations, it may encounter difficulties when dealing with extremely complex or highly oscillatory systems. In these cases, other numerical integration methods may be more suitable.

Similar threads

  • Differential Equations
Replies
1
Views
2K
Replies
2
Views
10K
Replies
2
Views
232
  • Differential Equations
Replies
31
Views
6K
Replies
2
Views
2K
  • Differential Equations
Replies
3
Views
1K
Replies
2
Views
1K
  • Differential Equations
Replies
1
Views
2K
  • Differential Equations
Replies
11
Views
4K
  • Programming and Computer Science
Replies
3
Views
2K
Back
Top