Dear users and developers:
Hello,
Can i add custon force in openmm ike below?:
f(x) = :
aaaaa 0 < x <= 1
bbbbb 1 < x <= 2
ccccc 2 < x <= 3
I want to use my customed L-J energy function in simulation.
add group cutoff energy function in openmm
- qian jiaqiang
- Posts: 2
- Joined: Tue Oct 24, 2017 9:58 am
- Peter Eastman
- Posts: 2541
- Joined: Thu Aug 09, 2007 1:25 pm
Re: add group cutoff energy function in openmm
Sure, this can be done in a few different ways. The simplest is probably to use the step() function, which equals 0 for x<0, 1 for x>=0. You could write something like this:
Another option would be to use a tabulated function.
Peter
Code: Select all
aaaa*inrange1 + bbbb*inrange2 + cccc*inrange3;
inrange1=step(1-x);
inrange2=(1-inrange1)*step(2-x);
inrange3=(1-inrange1)*(1-inrange2)
Peter
- qian jiaqiang
- Posts: 2
- Joined: Tue Oct 24, 2017 9:58 am
Re: add group cutoff energy function in openmm
Thank you,Peter。