def linear(cls, time, y0, yf):
""" return linear function values that array size is same as time length
Args:
time (array_like) : time
y0 (float): initial value
yf (float): final value
Returns:
(N, ) ndarray
"""
x = np.array([time[0], time[-1]])
y = np.array([y0, yf])
f = interpolate.interp1d(x, y)
return f(time)
评论列表
文章目录