Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trapezoidal rule in Euler implicit solver #5140

Open
alxbilger opened this issue Nov 25, 2024 · 1 comment · May be fixed by #5169
Open

Trapezoidal rule in Euler implicit solver #5140

alxbilger opened this issue Nov 25, 2024 · 1 comment · May be fixed by #5169
Labels
pr: dev meeting topic PR to be discussed in sofa-dev meeting

Comments

@alxbilger
Copy link
Contributor

alxbilger commented Nov 25, 2024

Hi,

I would like to discuss the trapezoidal rule option in EulerImplicitSolver. I tried to derive the maths, but I cannot find the same result than in the code.

Here is my maths:

image

Here is the code:

mFact = 1 + tr * h * d_rayleighMass.getValue();
bFact = -tr * h;
kFact = -tr * h * (h + d_rayleighStiffness.getValue());

with $h=1/2$

If we remove the Rayleigh damping:

mFact = 1;
bFact = -tr * h;
kFact = -tr * h * h;

There is a discrepancy between the code and the maths for the factor of $K$. The code should be kFact = -tr * tr * h * h; according to the maths.

The code was introduced in c1acea6

@alxbilger alxbilger added the pr: dev meeting topic PR to be discussed in sofa-dev meeting label Dec 2, 2024
@hugtalbot
Copy link
Contributor

Hi @alxbilger

After "derouling" all equations, I definitely agree with you. In fact, there is more than just the factor K to be fixed.
Do you think about a scene illustrating the scheme? We could run a pendulum case which should be less numerically dissipated with the Trapezoidal rule.

See my associated PR #5169

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: dev meeting topic PR to be discussed in sofa-dev meeting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants