Beispiel #1
0
	def difference(self,a,b,u):
		assert len(a)==len(b)
		x1,v1 = a[:len(a)/2],a[len(a)/2:]
		x2,v2 = b[:len(b)/2],b[len(b)/2:]
		dx = spline.hermite_deriv(x1,v1,x2,v2,u,order=1)
		ddx = spline.hermite_deriv(x1,v1,x2,v2,u,order=2)
		return dx+ddx
Beispiel #2
0
	def interpolate(self,a,b,u):
		assert len(a)==len(b)
		x1,v1 = a[:len(a)/2],a[len(a)/2:]
		x2,v2 = b[:len(b)/2],b[len(b)/2:]
		x = spline.hermite_eval(x1,v1,x2,v2,u)
		dx = spline.hermite_deriv(x1,v1,x2,v2,u)
		return x+dx