Hello, I am trying to implement a version of the cubic spline based on the artilce here: Click Here and while implementing it I find errors that my indices are out or range such as:
h[i]=(n[i+1]-n[i]) IndexError: list index out of range
Here's a part of the code:
a=[None]*(len(m)+1)
b=[None]*(len(n))
d=[None]*(len(n))
h=[None]*(len(n))
g=[None]*(len(n)) #Alpha
lo=[None]*(len(m)+1)
mo=[None]*(len(m)+1) #Mu
zo=[None]*(len(m)+1)
c=[None]*(len(m)+1)
#Steps 1 and 2
for i in range(0, len(n)):
h[i]=(n[i+1]-n[i])
for i in range(1, len(n)):
g[i]=((3/h[i])*(a[i+1]-a[i])) - ((3/h[i-1])*(a[i]-a[i-1]))
The main thing that confuses me is that the program needs a cardinality of n+1 but I'm only getting N points and so how would I acocunt for that in my coding?