Temperature during relaxation

Dear lammps users
My model is diamond cutting monocrystalline silicon. The temperature of the simulation process has been very high, which does not meet the requirements of the simulation. How can I reduce the temperature to a stable state at the time of relaxation. This is part of my program :

compute 2 work pe/atom
compute w_pe work reduce sum c_2
compute w_temp work_temp temp
velocity work_newton create 300.0 5812775
fix 1 work nve
fix b work_b setforce 0.0 0.0 0.0
#fix c tool setforce 0.0 0.0 0.0
fix 4 work_temp temp/rescale 100 300.0 300.0 0.05 1.0 temp c_w_temp
timestep 0.001
thermo 100
thermo_style custom step temp c_w_temp c_w_pe
run 5000

Step Temp c_w_temp c_w_pe
0 236.83901 0 -266803.4
100 904.69181 300 -273217.11
200 626.01812 300 -270647.2
300 780.0033 300 -272091.3
400 677.82046 300 -271164.53
500 655.25284 300 -270975.33
600 761.85245 300 -271976.47
700 759.31043 300 -271960.53
800 672.5661 300 -271164.15
900 713.19505 300 -271557.34
1000 799.13165 300 -272361.55
1100 775.87506 300 -272154.55
1200 682.04869 300 -271301.96
1300 725.88498 300 -271726.67
1400 779.36776 300 -272235.05
1500 758.06341 300 -272044.66
1600 694.6221 300 -271475.4
1700 717.29731 300 -271710.44
1800 753.49922 300 -272057.3
1900 720.33721 300 -271765.15
2000 685.90508 300 -271470.07
2100 721.66298 300 -271820.67
2200 750.51525 300 -272103.03
2300 707.59839 300 -271721.41
2400 687.27777 300 -271558.77
2500 722.91444 300 -271908.21
2600 727.17098 300 -271962.48
2700 686.19011 300 -271601.46
2800 692.7653 300 -271687.16
2900 722.07765 300 -271975.92
3000 714.32628 300 -271920.71
3100 680.61023 300 -271634.12
3200 693.34431 300 -271771.32
3300 719.17972 300 -272026.05
3400 694.76341 300 -271819.5
3500 676.45705 300 -271673.78
3600 698.5739 300 -271899.76
3700 711.29495 300 -272037.34
3800 687.18067 300 -271833.23
3900 676.50853 300 -271759.46
4000 698.70964 300 -271984.05
4100 697.9266 300 -271995.01
4200 674.0297 300 -271797.52
4300 675.23101 300 -271828.5
4400 699.26206 300 -272069.81
4500 694.10654 300 -272039.9
4600 668.42101 300 -271822.34
4700 677.00521 300 -271922.73
4800 692.0363 300 -272081.96
4900 677.6879 300 -271969.96
5000 663.19252 300 -271855.3

Thanks
Liu Qiqi

it is extremely difficult to make recommendations based on only such limited information. there are many possible reasons for things not behaving as expected. starting geometry, potential parameters, simulation parameters and settings. almost everything.

apart from that, you should not be using fix temp/rescale. it is a very bad choice for managing temperature and can lead to wrong conclusions when used during cases where you have doubts about proper simulation settings and energy conservation. it can hide a lot of flaws in your setup and thus lead to bogus results.

axel.