In [2]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
In [3]:
from IPython.display import Image
In [6]:
#СВЯЗИ
a = np.loadtxt("bond")
x_o=a[:,0]
y_o=a[:,1]
print "initial data:", y_o
#function is  f(x)=k(b-x)^2 + a
#fitfunc = lambda p, x: p[0]*pow(p[1]-x,2) + p[2] # Target function
#errfunc = lambda p, x, y: fitfunc(p, x) - y # Error function

#p0 = [1,1, -79] # Initial guess for the parameters
#p1, success = optimize.leastsq(errfunc, p0[:], args=(x_o, y_o))
#print "Optimized params:", p1

#Plot it
plt.plot(x_o, y_o, "ro")
plt.xlim(1.3,1.8)
plt.show()
initial data: [-79.73393153 -79.74061737 -79.74628686 -79.75103318 -79.75494129
 -79.75808863 -79.76054578 -79.76237713 -79.76364138 -79.76439208
 -79.76467808 -79.76454395 -79.7640304  -79.76317457 -79.76201041
 -79.76056892 -79.75887846 -79.75696494 -79.75485209 -79.75256157
 -79.75011326]
In [8]:
#ВАЛЕНТНЫЙ УГОЛ
a = np.loadtxt("hch")
x_o=a[:,0]
y_o=a[:,1]
print "Initial data:", y_o
plt.plot(x_o, y_o, "ro")
plt.xlim(108,115)
plt.savefig('hch.png')
plt.show()
Initial data: [-79.76370844 -79.76388439 -79.76404291 -79.76418395 -79.76430746
 -79.76441342 -79.76450176 -79.76457244 -79.76462542 -79.76466065
 -79.76467808 -79.76467766 -79.76465935 -79.7646231  -79.76456887
 -79.76449659 -79.76440623 -79.76429774 -79.76417106 -79.76402616
 -79.76386298]
In [7]:
#ТОРСИОННЫЙ УГОЛ
a = np.loadtxt("d3")
x_o=a[:,0]
y_o=a[:,1]
print "Initial data:", y_o
#Plot it
plt.plot(x_o, y_o, "ro")
plt.xlim(-180,180)
plt.savefig('d3.png')
plt.show()
Initial data: [-79.76467808 -79.76423369 -79.76306284 -79.76161482 -79.76044078
 -79.75998276 -79.76044078 -79.76161482 -79.76306284 -79.76423369
 -79.76467808 -79.76423369 -79.76306284 -79.76161482 -79.76044078
 -79.75998276 -79.76044078 -79.76161482 -79.76306284 -79.76423369
 -79.76467808 -79.76423369 -79.76306284 -79.76161482 -79.76044078
 -79.75998276 -79.76044078 -79.76161482 -79.76306284 -79.76423369
 -79.76467808]
In [ ]:
 
In [ ]:
#ТОРСИОННЫЕ УГЛЫ