hello,
I have been compress my model by add a force to the set " wall" in the Z direction, and then i count the force of the set "wall", but the forceZ got is fluctuate heavy. the average force is different to the adding force. why?
add force by this :
ExternalForceX => 0,
ExternalForceY => 0,
ExternalForceZ => -1,
ExternalForceStrength => 200,
count force by this:
my \\\$forceX=0;
my \\\$forceY=0;
my \\\$forceZ=0;
foreach my \\\$atoms(@\\\$atoms)
{
my \\\$Force = \\\$atoms->Force;
\\\$forceX = \\\$forceX+\\\$Force->X;
\\\$forceY = \\\$forceY+\\\$Force->Y;
\\\$forceZ = \\\$forceZ+\\\$Force->Z;
}

the force of the wall like this
Two possible mechanisms as follows.
(1) Your script does not include the "CounterExternalForce" setting [*1], which choose whether the counter force (the same absolute value but opposite sign) is added to all atoms not included in the set . If not specified, the default value of "CounterExternalForce" is "Yes", so the force looks fluctuate around the zero force as you saw in the .xcd file. Please open the .xtd file to check whether the atoms behave as expected.
(2) The atoms includes not only the external force but also the interaction force from other atoms, so the forces looks fluctuated.
[*1] Please see the online help, Scripting in Materials Studio > MaterialsScript Application Programming Interface (API) > Modules > Forcite > Dynamics