John | 曲

Reflection in Transition

贝贝60秒:做了一回伸手党

曲政 / 2019-10-02


今天是贝贝报告给你的第 216 天
2019-10-02 星期三

我听说,行动之前,要打招呼。于是我今天在 Github 上提交了一个 issue。

还听说,求救之前,要先搜索。但是我只在 Github 上搜索了开放状态的 issue。

我尽力描述清楚现象和问题。

首先,介绍我的目的和遇到的问题。

然后,讲讲我的猜想和做过的尝试。

最后,说说我自己打算怎么做,希望得到什么帮助。

不到一个小时,开发者之一就给我回信说:这个问题已经在今年三月的这个 issue 中讨论过了,当前仓库主干中的文件就是正确版本。

我用新文件覆盖老文件,试了一下,一切顺利。

Hello,

I'm using SymPy's bspline package to generate b-splines to design a mechanical cam profile, so I need to use splines with order 6and knots with repeated start and endpoint, e.g. [0, 0, 0, 0, 0, 0, pi / 4, pi / 2, 3 * pi / 4, pi, pi, pi, pi, pi, pi].

I found the bspline_basis_setreturns nine basis splines just as it promised and suits my purpose well in derivating for velocity and acceleration, except for the center one bs[4] which is not continuous at knots pi/4, pi/2, 3*pi/4, as shown here.

img

I wonder it is the feature of repeated knots at both ends that cause bspline_basisfail to function well. So with the following simple experiment, it shows a similar result.

img

I really appreciate the SymPy functions, and it really helps me of solving my cam design problem.

I have tried scipy.interpolate.Bspline. It generates splines as it is. But I can't derivate them with the unknown coefficientsimgI would like to read your source codes and see if I can find why it is not continuous at the middle splines among them. But I am a newbie to python and sympy, so I think it is better to let you know this issue and hope for some tips for me.

Thanks.

John Qu