Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Scripting rod forces
#12
(25-08-2025, 02:11 PM)Qriva0 Wrote: What is better: 5 substeps and 10 iterations, or 1 substep and 50 iterations? I guess the first one should be better,

The best possible configuration in terms of convergence speed/quality is N substeps, and only 1 iteration. This is what the article I shared demonstrates:

Quote:We make the surprising observation that performing a single large time step with n constraint solver iterations is less effective than computing n smaller time steps, each with a single constraint solver iteration.

In other words: it's costlier to correct constraint error caused by using large time steps (which is what iterations do) than to keep the error from growing in the first place, by using a smaller timestep (more substeps). To correct the error caused by using only 1 substep instead of say, 4 substeps, you need a lot more than 4 iterations.

(25-08-2025, 02:11 PM)Qriva0 Wrote: but at the same time it increases the cost of all other aspects of simulation. However let's assume, there is only one actor and I want to get as good result as possible.

"All other aspects" is just integration - moving state forward in time, which is dirt cheap. Because of this the cost of substeps = N, iterations = 1 and substeps = 1, iterations = N is basically the same. Collision detection is only performed once per full step, and the resulting contact constraints reused for all substeps/iterations.

For this reason, the manual recommends to start by setting all iteration counts to 1 and adjusting substeps first.

Also note that using more substeps dissipates a lot less energy than using iterations and will result in more lively simulations, so what substeps/iterations combination to use can also be a bit of a stylistic choice.

kind regards,
Reply


Messages In This Thread
Scripting rod forces - by Qriva0 - 08-08-2025, 06:33 PM
RE: Scripting rod forces - by chenji - 11-08-2025, 03:18 AM
RE: Scripting rod forces - by josemendez - 11-08-2025, 08:31 AM
RE: Scripting rod forces - by Qriva0 - 11-08-2025, 11:14 AM
RE: Scripting rod forces - by josemendez - 11-08-2025, 11:26 AM
RE: Scripting rod forces - by Qriva0 - 11-08-2025, 12:25 PM
RE: Scripting rod forces - by josemendez - 11-08-2025, 12:48 PM
RE: Scripting rod forces - by Qriva0 - 11-08-2025, 03:24 PM
RE: Scripting rod forces - by Qriva0 - 25-08-2025, 11:30 AM
RE: Scripting rod forces - by josemendez - 25-08-2025, 12:12 PM
RE: Scripting rod forces - by Qriva0 - 25-08-2025, 02:11 PM
RE: Scripting rod forces - by josemendez - 25-08-2025, 02:36 PM
RE: Scripting rod forces - by Qriva0 - 25-08-2025, 03:59 PM