Skip to content

Conversation

@jgreener64
Copy link
Contributor

As discussed in #1387, use the FSAL value to avoid calculating the acceleration twice in the VelocityVerlet integrator.

Obtains similar results for a small system I tested on. I am running the package tests locally now.

Closes #1387.


# x(t+Δt) = x(t) + v(t)*Δt + 1/2*a(t)*Δt^2
ku = f.f1(duprev,uprev,p,t)
ku = integrator.fsallast.x[1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this should be integrator.fsallast.x[2]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That leads to immediate divergence. I'm not sure I fully understand the variable naming scheme but in that function it seems ku is a(t) and kdu is a(t+dt). So once you reach the next step, you want to load kdu from the last step into the current ku.

Copy link
Member

@YingboMa YingboMa Apr 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are exactly right.

@YingboMa YingboMa merged commit 9d9218e into SciML:master Apr 26, 2021
@YingboMa
Copy link
Member

Thanks!

@jgreener64 jgreener64 deleted the velocityverlet branch April 26, 2021 20:16
@jgreener64
Copy link
Contributor Author

jgreener64 commented Apr 26, 2021

Thanks for the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Velocity Verlet integrator calculates the acceleration twice at each time step

2 participants