# Quadratic Function for Distance Constraints?

5 posts / 0 new
#1

I'm trying to develop a modified energy minimizer where, in addition to enforcing typical energetic interactions, I want to constrain distances between particular atoms. So I think I need to have a function associated with each constraint and I would like to use a parabolic/quadratic function to describe the behavior of the constraints. Is there a quadratic function in the constraints package of PyRosetta? I was just using the tab-autocomplete feature in iPython to look for something like this but I can't seem to find what I am looking for. A Gaussian function might work but I would rather use a quadratic function instead if it exists. Thank you for your consideration.

Post Situation:
Mon, 2014-01-27 06:21
protos_heis

The harmonic constraint function has an x^2 dependence on the quantity of interest. (e.g energy integration of Hooke's law)

If you want a more complex quadratic, with linear terms and offsets, you should be able to add those on with other constraint terms, although typical use case only requires a zero-centered quadratic.

Mon, 2014-01-27 07:36
rmoretti

Okay, yeah that will work perfectly! It's been a while since I took a physics class. Thanks for your help. Actually I have one more quick question. What is the name of the constraint that one would use to constrain distances? I thought it would be called "DistanceConstraint" but I only found "DistancePairConstraint." Do I need AtomPairConstraint?

Tue, 2014-01-28 05:49
protos_heis

Right - For AtomPairConstraint, the number that gets passed to the constraint function is the Cartesian distance between the pair of atoms you specify.

Tue, 2014-01-28 07:27
rmoretti

Okay, that's actually simpler than I thought it would be because now I don't actually have to calculate any distances myself. Thanks again for your help!

Tue, 2014-01-28 08:09
protos_heis