### Author Topic: Help with Correlation function and Coordination polyhedra  (Read 488 times)

#### mrodriguez

• Newbie
• Posts: 3
##### Help with Correlation function and Coordination polyhedra
« on: January 28, 2019, 06:56:26 PM »
Hello,

I am new with the use of OVITO. I am studying the structure of a simulation with three elements (A, B, O) and since I start from a random configuration I need to know the following:

- Is it possible to identify trigonal structural units (AO3) and structural tetrahedral units (AO4)? Is there any way to count how many units I have of one type and how many of the others?

I found the Coordination polyhedra functions in the manual for the first case, but it only allows me to see structures type AO4.

- Is it possible to obtain the total structure factor or an equivalent function? I also found in the manual the Correlation function, but it's not clear to me what I'm looking for.

Thanks for your help

#### Constanze Kalcher

• Sr. Member
• Posts: 299
##### Re: Help with Correlation function and Coordination polyhedra
« Reply #1 on: January 29, 2019, 12:31:39 PM »
Hello,

concerning your first two questions, yes, that should be possible. I would suggest to use a bond-based criterion, to identify the structural units - more specifically the Create bonds modifier.
http://ovito.org/manual_testing/particles.modifiers.create_bonds.html
Let's say that whenever an O atom is found in the neighborhood of an A atom within a cutoff of 2 Å , or whatever your distance unit is, you consider them bound.
Thus, you could choose the option "Pair-wise cutoffs" and edit only the cutoff value for A-O pairs to 2.
In a next step, you could use a Python script modifier function,
https://ovito.org/manual_testing/particles.modifiers.python_script.html
that loops over all A-atoms and counts the number of A-O bonds connected to each A atom, which should either be three or four in your case, right?
If you need help with the scripting part let me know.

Alternatively, if you don't want to calculate bond vectors and/or are not comfortable with python scripting you could also just use the Compute property modifier
https://ovito.org/manual_testing/particles.modifiers.compute_property.html
to generate a particle property "Number-of-O-neighbors". Let's assume your particle types A, B and O are associated with particle type id's 1, 2 and 3.
Then you would need to enter 0 in the "Expression field" and "ParticleType == 3? 1:0" in the "Neighbor expression field".
In short, this is a sum over all neighbor atoms where +1 for every neighbor atom of type 3 is added, otherwise the contribution is 0.
(Please double check that the type id of the O atoms is really 3, it depends on your input.) Here you will also need to specify an appropriate cutoff for your problem,
that controls within what distance range an atom is considered as a neighbor.

Now, you have calculated that property for every atom, but your questions is how many A atoms are coordinated by 3 or by 4  O-atoms. This can be calculated using
the Expression selection modifier
https://ovito.org/manual_testing/particles.modifiers.expression_select.html.
In case the particle type id of the A atoms is 1, the boolean expression would be "ParticleType == 1 &&  Number-of-O-neighbors == 3" to count the AO3 structural units e.g.

Concerning the last question, you can use OVITO to calculate the (partial) radial distribution functions, have a look at the Coordination analysis modifier.
http://ovito.org/manual_testing/particles.modifiers.coordination_analysis.html

Hope that's a good starting point for you. Let me know if you have questions.

-Constanze
« Last Edit: January 29, 2019, 02:09:12 PM by Constanze Kalcher »

#### mrodriguez

• Newbie
• Posts: 3
##### Re: Help with Correlation function and Coordination polyhedra
« Reply #2 on: February 01, 2019, 07:34:07 PM »
Hello Constanze

Thanks for the tips!

First of all, sorry for the delay in my response.

I followed the steps you indicated and I was able to obtain a quantity value of units type AO3 and AO4. However, according to my estimates, the values ​​I get are lower than the theoretical ones. I'm probably doing something wrong.

I will try to explain the problem better. I start from an initial configuration using Reverse Monte Carlo of 10000 particles of which 3333 are of type A and I hope it should have a distribution of 50% units type AO3 and 50% units type AO4. For what one should expect for example, 1666 units AO3 and 1667 units AO4 considering that for each particle of A I have a single unit.
the AO3 units have a smaller bond distance (for example 1.37 A) and the AO4 units have a larger bond distance (1.48 A).
For example, using a cutoff of 1.37 in the Neigbhour particles field, I get 660 AO3 units and 984 AO4 units

With respect to the other question, when calculating the Coordination analysis, I obtain a signal "similar" to what I obtain experimentally for a sample but the signal tends to 1 very fast (near to 2 A). How can that be corrected?

In the page
http://ovito.org/manual_testing/particles.modifiers.coordination_analysis.html

it also shows that partial contributions can be calculated, however in my version that option is not available. Should we do it by script

Thanks very much

#### Constanze Kalcher

• Sr. Member
• Posts: 299
##### Re: Help with Correlation function and Coordination polyhedra
« Reply #3 on: February 04, 2019, 11:49:25 AM »
Hello,

it is difficult for me to diagnose why you obtain certain results without having insight into your data. If you like you can upload an example file here, then I can try to help.
Also, did you opt for the Python script modifier or the Compute property modifier?

Concerning the partial radial distribution functions, yes you can do it using a custom python script modifier, as explained here
http://forum.ovito.org/index.php?topic=131.0,
but it's easiest to just update to the latest developer version of OVITO, where the Coordination analysis modifier in the GUI has a checkbox  "Compute partial RDFs".

-Constanze
« Last Edit: February 04, 2019, 11:53:11 AM by Constanze Kalcher »

#### mrodriguez

• Newbie
• Posts: 3
##### Re: Help with Correlation function and Coordination polyhedra
« Reply #4 on: February 04, 2019, 02:54:29 PM »
Dear Constanze

Plase, find attached the .cfg file.

Thanks very much

#### Constanze Kalcher

• Sr. Member
• Posts: 299
##### Re: Help with Correlation function and Coordination polyhedra
« Reply #5 on: February 04, 2019, 03:48:05 PM »
Hello,

there is no issue with the way you're performing the analysis, it's rather that for your system it's not that clear to me how you should define a BO3 and BO4 units.
I had a look at your structure and it looks almost amorphous to me, is that the case? The issue is that there is not really a clear criterion that would let you distinguish between 3-fold and 4-fold coordinated B-O units here since there is a wide range of bond lengths of B-O neighbor bonds.
If we simply compare coordination numbers for different cutoffs, you'll find that there is always a broad distribution of coordination numbers (often ranging from 2 to 10) and not only 3-fold and 4-fold ones.
This is also visible in the partial rdfs.
At the moment, I don't have any better suggestions how to tackle this.

-Constanze