power-series

How to generate a symbolic multivariate polynomial of a given dimension in SymPy?

时光怂恿深爱的人放手 提交于 2019-12-24 06:44:19
问题 I want to use power series to approximate some PDEs. The first step I need to generate symbolic multivariate polynomials, given a numpy ndarray. Consider the polynomial below: I want to take a m dimensional ndarray of D=[d1,...,dm] where dj s are non-negative integers, and generate a symbolic multivariate polynomial in the form of symbolic expression. The symbolic expression consists of monomials of the form: Fo example if D=[2,3] the output should be For this specific case I could nest two

How to generate a symbolic multivariate polynomial of a given dimension in SymPy?

独自空忆成欢 提交于 2019-12-24 06:44:06
问题 I want to use power series to approximate some PDEs. The first step I need to generate symbolic multivariate polynomials, given a numpy ndarray. Consider the polynomial below: I want to take a m dimensional ndarray of D=[d1,...,dm] where dj s are non-negative integers, and generate a symbolic multivariate polynomial in the form of symbolic expression. The symbolic expression consists of monomials of the form: Fo example if D=[2,3] the output should be For this specific case I could nest two

Power Series in Haskell

让人想犯罪 __ 提交于 2019-12-23 09:32:52
问题 I am trying to write the power series in Haskell, e^x = 1 + x + x^2/2! + x^3/3! + ... such that it will out put [1,1,1/2,1/6,...] so far I got: factorial 0 = 1 factorial n = n * factorial (n - 1) powerSrs x = 1 : powerSrsFunc[1..] where powerSrsFunc ( p: xs ) = p : powerSrsFunc[y | y <-xs, ( (x^y) / (factorial y) )] However, I understand that my typing here is wrong. I am getting this error: tut08.hs:8:58: No instance for (Integral Bool) arising from a use of `^' Possible fix: add an instance