User Tools

Site Tools


soft:siman:intercalation

Please download this file with tools for intercalation intercalation tool.py Below is example:

from siman.header import db
from intercalation_tool import intercalate_Li_by_one
 
TP = db['TiPO4', '1u', 1] #example calculation
 
#Step 1: Create intercalated states, and run them one by one
intercalate_Li_by_one(TP, ise = '1ulow', el2insert = 'Li') # just run it as many times as needed, step by step
 
#Step 2: After you made several steps, process data and plot a voltage curve
if 0:
    el2insert_z = 3 # Z of element to insert, Li in this case
    el_ref_z = 22 # Z of element to calculate concentration, Ti in this case
    case = 'e600U2'# 
    if  case == 'e600U2': 
        cl = TPU2e6    
    st = cl.end
    st.write_cif(filename = 'cif/Li0TiPO4')
 
    x_str = '0'
    print('Li{:s}TiPO4, {:.2f}, {:.2f}, {:.2f}, {:.1f}'.format(x_str, st.vlength[0], st.vlength[1], st.vlength[2], st.vol))
    objs = {x_str:cl}
    nvoids = 0
 
    for ll in TP.inserted_cls_data[('1ulow', '1.6')]:
    	#loop over different concentrations
        nvoids+= ll['nvoids']
        idd = ll['cl_most_stable_id']
        cl = db[idd]
 
        nLi = cl.end.get_specific_elements([el2insert_z])
        nTi = cl.end.get_specific_elements([el_ref_z])
        x = len(nLi)/len(nTi) # calculate concentration
        x_str = '{:.2f}'.format(x)
 
        #here you can add more steps of relaxation using cl.run(), and asigning new cl
 
        objs[x_str] = cl 
        cl.end.write_cif(filename = 'cif/Li'+x_str+'TiPO4', symprec = None) #write structures
        st = cl.end
        print('Li{:s}TiPO4, {:.2f}, {:.2f}, {:.2f}, {:.1f}'.format(x_str, st.vlength[0], st.vlength[1], st.vlength[2], st.vol))
 
 
    keys = list(objs.keys())
    print(keys)
 
    for i, key in enumerate(keys[:-1]):
        print(float(keys[i+1]) - float(keys[i]))
 
    if 0:
    	# plot voltage profile
        voltage_profile(objs, first = 1, last  =1, invert = 0, xlabel = 'Specific capacity, mAh/g',
            xlim = (0,168), ylim = (0.75, 3.1), last_point = 0, ylabel  = 'Potential vs. Li$^+$/Li, V', 
            filename = 'voltage_curve_'+case,
            # exclude = [3,5,7,8], # allows to exclude several points that have negative potential
            formula = 'TiPO4', fit_power = 3)
soft/siman/intercalation.txt · Last modified: 2025/04/04 14:06 by d.aksenov

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki