Change the evolution equations to
[code]
dx/dt = v;
dv/dt =calF(x,v)/m;
[/code]

Then, define a function to return correct force for different (x,v) values.
If you need to take care for short time event, e.g. collision , then you can use event in EJS.

What is left is your physics model to model the case you want. ;)