Question about Perl Script Job

Dear all,
My material studio edition is material studio 2017. When I use the forcite module to do MD simulation in my computer, the speed of my computer is about 1300 steps per minute. But when I add an external force into my system bu perl script, the compute speed slowed a lot to about 20 steps per minute. Why the compute speed slowed so much? Thanks.
Here are my perl script:

#!perl

use strict;
use Math::Trig;
use MaterialsScript qw(:all);

my \\\$doc = \\\$Documents{"MFI5aftergeomopt.xsd"};
my \\\$totalTime1 = 1200; # ps



my \\\$interval = 120; #ps


my \\\$forceAmplitude = 339; # kcal/mol/A

my \\\$forcite = Modules->Forcite;
my \\\$dynamics = \\\$forcite->Dynamics;

    
my \\\$xtd = \\\$dynamics->Run(\\\$doc, Settings(NumberOfSteps => 1))->Trajectory;

Modules->Forcite->ChangeSettings(Settings(
    TrajectoryRestart => "Yes", 
    AppendTrajectory => "Yes"));

for(my \\\$time1 = 0; \\\$time1 < \\\$totalTime1; \\\$time1 += \\\$interval)
{
    my \\\$force1 = \\\$forceAmplitude*(\\\$time1/\\\$totalTime1);
    printf("%12.6f %12.6f\\n", \\\$time1, \\\$force1);
    
    my \\\$externalForceStrength = \\\$force1;
    
    my \\\$results = \\\$dynamics->Run(\\\$xtd, Settings(
    Ensemble3D => "NVT",
Temperature => 348, 
TimeStep=> 2, 
EnergyDeviation=> 5000000,
 NumberOfSteps=>60000,
 TrajectoryFrequency=>60000,
 Thermostat=>"Berendsen",
 CurrentForcefield=>"Dreiding",
 Quality=>"Coarse",
 ChargeAssignment=>"Use current",
        
    
    ExternalForceSet => "Top",  
        ExternalForceStrength => \\\$externalForceStrength, 
    ExternalForceX=>0.0649,
    ExternalForceY=>-1,
        ExternalForceZ=>0,
        CounterExternalForce=> "No"
    ));
}

The more strange thing is that it happens in sometimes, sometimes when I use the same perl script, the compute speed will not slowed down. What's the reason about it? What's wrong with my computer or this script? Thanks.
Best regards.
Yours
CHENG Xu
Answers 4
NS
NS 2018-05-25
Can you tell us exactly what your input structure is, i.e. MFI5aftergeomopt?

I think the most likely problem is that you have CounterExternalForce=> "No". The external force can cause the whole structure, including the matrix, to accelerate to higher and higher speeds.

One way to prevent this is to set CounterExternalForce=> "Yes". This applies an equal and opposite force, so the momentum of the whole system remains zero.
XC
XC 2018-05-25
Dear Neil Spenley,
Thanks for your reply, this is my input structure MFI5aftergeomopt


In my system, I put an external force on the top molucules of my system. In order to prevent my system from accelerating to higher and higher speeds, I have fixed the position of the bottom molucules in my system. Thanks.
Best regards,
Yours
CHENG Xu
 
comment imagecomment image
NS
NS 2018-05-25
Is it possible for you to attach the file MFI5aftergeomopt.xsd ?
XC
XC 2018-05-25
Dear Neil,
Attached with my MFI5aftergeomopt.xsd file.
Thanks.
Best regards,
Yours
CHENG Xu
comment imagecomment image