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

SimbodyMatterSubsystem::calcConstraintAccelerationErrors(). #517

Merged
merged 2 commits into from
Jul 28, 2016

Conversation

chrisdembia
Copy link
Member

Previously, SimbodyMatterSubsystemRep had an operator
calcConstraintAccelerationErrors(), but there was no related operator for use
by users. This PR introduces such an operator. The operator is tested
in TestConstraints to ensure it gives results that are consistent with
other methods/operators.

In the doxygen, I stated that the complexity of the operator is O(m+n) This was determined by inspecting the internal documentation for:

  • SimbodyMatterSubsystemRep::calcConstraintAccelerationErrors() (O(m+n)),
  • SimbodyMatterSubsystemRep::calcBodyAccelerationsFromUDot() (O(nu+nb)), and
  • SimbodyMatterSubsystem::calcQDotDot() (O(n)).

Fixes #514.

Previously, SimbodyMatterSubsystemRep had an operator
calcConstraintAccelerationErrors(), but there was no related operators for use
by users. This commit introduces such an operator. The operator is tested
in TestConstraints to ensure it gives results that are consistent with
other methods.

Fixes simbody#514.

// The same code should have been executed when using forward
// dynamics or the operator, so the errors should be exactly the same.
SimTK_TEST(pvaerrFromOperator.size() == m);
Copy link
Member

Choose a reason for hiding this comment

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

This condition is probably too strict. It would be OK if later someone didn't run exactly the same code. I would suggest checking to SignificantReal (1e-14 ish) which is what you get with SimTK_TEST_EQ.

@sherm1
Copy link
Member

sherm1 commented Jul 28, 2016

Wow -- this looks beautiful, Chris. I really like the comprehensive tests! I had a few minor comments but otherwise this is ready to go in.

@chrisdembia
Copy link
Member Author

Thank you for the quick review. I have addressed both of your comments.

@sherm1 sherm1 merged commit 3469006 into simbody:master Jul 28, 2016
@chrisdembia
Copy link
Member Author

Thank you.

@chrisdembia chrisdembia deleted the calcConstraintAccelerationErrors branch July 28, 2016 16:05
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.

None yet

2 participants