<p><strong>明白了</strong>!
在看了好几个小时的代码之后,我发现了一个链接<a href="https://github.com/kawache/Python-B-spline-examples" rel="nofollow noreferrer">https://github.com/kawache/Python-B-spline-examples</a>,它给了我一个线索,现在我可以生成与我最初的FORTRAN代码类似的结果(它是用M.G.Cox原始代码<a href="https://github.com/kawache/Python-B-spline-examples" rel="nofollow noreferrer">1</a>)编写的,后来又改为Cox&deboor<a href="https://i.stack.imgur.com/rFCea.png" rel="nofollow noreferrer">2</a>)。在</p>
<p>也许我应该把它写成“对连续不规则时间点的多个观测数据的样条拟合”。在</p>
<p>谢谢你的帮助。在</p>
<p>这是我的代码:</p>
<pre><code>import matplotlib.pyplot as plt
from scipy import interpolate
import numpy as np
x=[152.0,152,152,152,152,159,159,159,159,159,166,166,166,166,166,174,174,174,174,174,181,181,181,181,181,188,188,188,188,188,194,194,194,194,194,202,202,202,202,202,208,208,208,208,208,215,215,215,215,215,222,222,222,222,222,229,229,229,229,229,236,236,236,236,236,243,243,243,243,243,250,250,250,250,250,258,258,258,258]
y=[-1.31639523,-1.90045889,-1.81769285,-1.25702203,-1.31975784,-0.76206863,-0.74170737,-0.66029284,-0.58124809,-0.49593701,-0.19309943,0.02254396,-0.04614866,0.06709774,0.10436002,0.577175,0.56809403,0.89547559,0.60922195,0.76220672,1.0461253,1.1304339,1.56360338,1.34189828,1.41658105,1.98677786,2.40487089,2.20431052,1.91072699,2.49328809,2.670556,2.85024397,3.24333426,2.44841554,3.14604703,3.39128172,3.78063788,3.21446612,3.07158159,3.79503965,3.40717945,4.02417242,3.70708767,4.00729682,4.25504517,4.28874564,3.9356614,4.30337567,4.02388633,4.65376986,4.33884509,4.68839858,4.10508666,4.26236997,4.53098529,5.03443645,4.07940011,4.3033351,4.43476139,4.80221614,4.49558967,4.5052504,4.40289487,5.15433152,5.1330299,4.30299696,4.47974301,5.34886789,4.60896298,5.35997675,4.40204983,5.50162549,4.3056854,4.87120463,5.36265274,4.33578634,5.06347439,4.46811258,5.30920785]
plt.plot(x, y, 'ro', ms=5)
tck,u = interpolate.splprep([x,y],k=3,s=32)
u=np.linspace(0,1,num=50,endpoint=True)
out = interpolate.splev(u,tck)
plt.plot(x, y, 'ro', out[0], out[1], 'b' )
plt.show()
</code></pre>
<p>{3{decox}的原始结果。在</p>
<p>考克斯,“b样条函数的数值计算”,数学应用学报,第10期,第134-1491972页。在</p>
<p>[3}:C.de Boor,“关于用b样条函数进行计算”,J.近似理论,第6期,第50-62页,1972年。
<a href="https://i.stack.imgur.com/rFCea.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rFCea.png" alt="Plot of results from python code."/></a>
<a href="https://i.stack.imgur.com/qyBsj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qyBsj.png" alt="Plot of reults from original Fortran code from Cox & De Boor"/></a></p>