In this tutorial, we will do a geometrical optimization of the compound TiO2 using the SinglePoint task by optimizing the lattice parameter a and the ration c/a and finding the optimized values of the lattice parameters a and c. We can refine the calculation of the ratio c/a to get the more optimized values of lattice parameters.

In the TiO2.cell file we need to use the lattice parameters as follows:

%BLOCK LATTICE_ABC
[units]
a b c
alpha beta gamma
%ENDBLOCK LATTICE_ABC


We need a param file and 3 script.

TiO2.param

task       SinglePoint           ! The TASK keyword instructs CASTEP what to do
xc_functional LDA ! Which exchange-correlation functional to use.
cut_off_energy 500 eV !
opt_strategy speed ! Choose algorithms for best speed

Script for optimization tetracell-opt.sh , script for plotting  tetracell-plot-EV-coa.sh and script for calculation lattice parameters tetracell-cal.sh.

You may download the 3 scripts using the command line

$ wget https://raw.githubusercontent.com/jazairdz/Castep/refs/heads/main/tetracell-opt.sh

$ wget https://raw.githubusercontent.com/jazairdz/Castep/refs/heads/main/tetracell-plot-EV-coa.sh
$ wget https://raw.githubusercontent.com/jazairdz/Castep/refs/heads/main/tetracell-cal.sh

 

Execution

$ bash tetracell-opt.sh
Enter the seed name: TiO2

running c/a= 1.5
running a= 3.00
running a= 3.05
.
.
.

finished with results in TiO2_ratio.dat

This calculation gives 5 files: TiO2_0.55.dat, TiO2_0.60.dat, TiO2_0.65.dat, TiO2_0.70.dat and TiO2_0.75.dat

 

$ sh tetracell-plot-EV-coa.sh

 This gives the script fit.Burch.py and the following figure:

 


 From the figure, we can see that the optimized ratio is c/a= 0.65 and we need to look for the optimized of lattice parameter value of a corresponding to this ratio. The results are in the file TiO2_fit.out file which contains the volume corresponding to c/a=1.60 (V0 =    59.8875 ang^3).

Results for c/a= 0.65
Burch-Murnaghan fit parameters:
E0 = -4895.8597 eV
B0 = 1.6227 eV.ang^-3
B' = 5.8466
V0 = 59.8875 ang^3

Bulk modulus = 259.9572 GPa

Graph of data and fit saved as BMM_curve.png - please check all is OK

 

$ sh tetracell-cal.sh
Enter the seed name: TiO2

Enter optimized volume corresponding to optimized ratio (ang^3): 59.8875
Enter optimized value of c/a: 0.65
tetragonal structure

we get the results in the file TiO2_lattice.out

Lattice parameters of tetragonal structure 

a = 4.513 ang c = 2.933 ang

c/a = 0.65 Volume = 59.8875 ang^3