Simulating inter-connected springs/beams

  • Thread starter Thread starter Alkatran
  • Start date Start date
Click For Summary
SUMMARY

This discussion focuses on simulating interconnected springs and beams, highlighting issues with energy overestimation due to fixed-step calculations. The participant notes that the current method results in excessive energy gain unless significant damping is applied. To address this, they suggest recalculating total energy after iterations and proportionately reducing forces if energy increases. Additionally, they recommend minimizing step sizes to reduce approximation errors and improving midpoint calculations for more accurate simulations.

PREREQUISITES
  • Understanding of basic physics principles related to springs and forces.
  • Familiarity with numerical simulation techniques.
  • Knowledge of floating-point arithmetic and its implications in simulations.
  • Experience with programming languages suitable for simulations, such as Python or C++.
NEXT STEPS
  • Research advanced numerical integration methods for physics simulations.
  • Explore energy conservation techniques in dynamic systems.
  • Learn about adaptive time-stepping algorithms for improved accuracy.
  • Investigate methods for calculating midpoint values in iterative simulations.
USEFUL FOR

Engineers, physicists, and software developers involved in simulation modeling, particularly those working with mechanical systems and dynamic simulations of interconnected components.

Alkatran
Science Advisor
Homework Helper
Messages
959
Reaction score
0
I've been writing a simple program to simulate what is essentially a bunch of springs connected together at nodes. However, I'm having trouble.

Currently I just calculate instantaneous force for every spring/node, step ahead a fixed amount, and repeat. The problem is this tends to overestimate and I end up with a the whole system gaining a ton of energy unless I dampen the springs by a large factor.

What is the next step up for this type of thing?
 
Technology news on Phys.org
It sounds like stepwise recalculations (possibly coupled with rounding errors on floating point numbers) are causing the problem. One kludge is to add up the total energy after each iteration and, if it has increased from the previous total, do a second pass to reduce all forces proportionately. This will solve the problem of creeping energy increase directly.

Of course the main problem is the stepwise approach used in the simulation. The errors introduced by these approximations will cause total energy to change and they will also cause the model's behavior to deviate from an actual device's. The simplest solution is to reduce the size of each step to minimize the "staircase approximation" of the curves that are being modeled. Another solution is to find a better, more accurate midpoint value at each iteration, but this is not a programmatic problem, it takes some analysis of your model to find out what is best.
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 14 ·
Replies
14
Views
6K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 23 ·
Replies
23
Views
37K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
4
Views
5K