编程语言
首页 > 编程语言> > 数学-如何在JavaScript中实现拉普拉斯逆变换?

数学-如何在JavaScript中实现拉普拉斯逆变换?

作者:互联网

我正在编写一个JavaScript小程序,使其他人可以轻松地查看带有和不带有比例控制器的系统的工作原理以及输出是什么.

首先对小程序进行一些解释(如果需要,可以跳过此步骤,真正的问题在最后一段中.):

I managed to implement a way of input for the system (in the frequency domain), so the applet can do the math and show the users their provided system. At the moment the applet computes the poles and zeros of the system, plots them together with the root-Loci, plot the Nyquist curve of the system and plot the Bode plots of the system.

The next thing I want the applet to do is calculating and plotting the impulse response. To do so I need to perform an inverse Laplace transformation on the transferfunction of the system.

现在真正的问题是:
我在频域中有一个函数(传递函数).该函数是一个有理函数,作为两个多项式(分子和分母由其系数存储)存储在程序中.将这个功能转换到时域的最佳方法是什么? (逆拉普拉斯).还是有一个已经实现此功能的开源库.我已经搜索过它,但是只找到了一些数学更简单的数学库.

提前致谢

解决方法:

这是一个相当复杂和有趣的问题.几个想法.

(1)如果解决方案必须是严格的JS:可以通过部分分数分解来找到一些有理函数的逆LT.您有多项式的数字系数,对不对?您可以尝试在JS中实现部分分数分解,也可以找到一个.这里的困难是不能保证您可以通过部分分数找到逆LT.

(2)使用JS作为粘合代码,并将有理函数发送到另一个进程(运行例如Sympy或Maxima)以计算逆LT.这样,您可以利用所有可用的功能,但是需要花费一些工作才能连接到另一个进程并解析结果.至少对于Maxima,有许多项目将Maxima用作计算后端.查看:http://maxima.sourceforge.net/relatedprojects.html

标签:javascript,math,numerical-methods,system-analysis
来源: https://codeday.me/bug/20191029/1958416.html