Hi, I have written the following code as part of a project to find the literature values for given constants (s1hkl and s2hkl) as well as these constants that I have found experimentally (s1hklBaye and s2hklBaye) where s1 and s2 are the values that have come out of earlier steps in my experiment. I have defined these equations as functions where I can pass through h,k and l which alter the values of the literature values and I have different experimental s1 and s2’s for different h k and l values. I would like to add code to find the percentage error between the expermental and litrature values which although in itself is quite simple, I can’t work out a way to access the values of s1hklBaye, s2hklBaye, s1hkl and s2hkl as these are inside the functions. I have left the code unedited for completeness so apologies if this makes things complicated. I would really appreciate any help

E=220*(10**9)
v=0.28
s1lit=(-v/E)*(10**12)

s2lit=((1+v)/E)*(10**12)

print("literature value for S1 = " + str(s1lit))

print("literature value for S2 = " + str(s2lit))

s1=-1.3

s2=6

def s1s2hklBaye(h,k,l):

Arx=1.49

Rhkl=((h**2)*(k**2)+(k**2)*(l**2)+(l**2)*(h**2)) / (((h**2)+(k**2)+(l**2))**2)
delta=(5*(Arx-1))/(3+2

*Arx)*

print(“Arx=” + str(Arx),“R=” + str(Rhkl), “delta=” + str(delta))

s1hklBaye= s1-s2(0.2

print(“Arx=” + str(Arx),“R=” + str(Rhkl), “delta=” + str(delta))

s1hklBaye= s1-s2

*Rhkl)*(0.2-Rhkl*delta))

*delta*

s2hklBaye= s2(1+3s2hklBaye= s2

print("Bayesian value for S1hkl = " + str(s1hklBaye))

print("Bayesian value for S2hkl = " + str(s2hklBaye))

def s1s2hkl(h,k,l):

Arx=1.49

Rhkl=((h**2)*(k**2)+(k**2)*(l**2)+(l**2)*(h**2)) / (((h**2)+(k**2)+(l**2))**2)
delta=(5*(Arx-1))/(3+2

*Arx)*

print(“Arx=” + str(Arx),“R=” + str(Rhkl), “delta=” + str(delta))

s1hkl= s1lit-s2lit(0.2

print(“Arx=” + str(Arx),“R=” + str(Rhkl), “delta=” + str(delta))

s1hkl= s1lit-s2lit

*Rhkl)*(0.2-Rhkl*delta))

*delta*

s2hkl= s2lit(1+3s2hkl= s2lit

print("literature value for S1hkl = " + str(s1hkl))

print("literature value for S2hkl = " + str(s2hkl))

s1s2hkl(1,1,0)

s1s2hklBaye(1,1,0)