Sunday, July 26, 2026
HomeLanguagesAdd one Laguerre series to another in Python

Add one Laguerre series to another in Python

In this article, we will be looking at the method to add one Laguerre series to another in Python.

The product of the exponential of a matrix by a vector is computed using Laguerre polynomials and a Filtered Conjugate Residual (FCR) framework. In Python, we take the Numpy library, and use the polynomial.laguerre.lagadd() method to combine two Laguerre series. The method returns an array that represents their sum’s Laguerre series.

Syntax : np.lagadd(c1, c2)
Parameters:

  • c1, c2 :[ array_like ] 1-D arrays of Laguerre series coefficients ordered from low to high.

Return : [ndarray] Array representing the Laguerre series of their sum.

Numpy.polynomial.Laguerre function includes a Laguerre class that incorporates the normal arithmetic operations, as well as a number of objects (mainly functions) helpful for dealing with the Laguerre series. The sum of two Laguerre series (series1 + series2) is returned. The arguments are ordered sequences of coefficients from lowest to highest order term, e.g., [1,2,3] represents the series P 0 + 2*P 1 + 3*P 2. 1-D arrays of Laguerre series coefficients arranged from low to high, parameters series1, series2array like.

The Laguerre series of their sum is returned as an out array Array. 

Example  #1 :

In this example, we are simply creating two series of 5 integers, and further, with the call of the np.lagadd() function passed with the series as the parameters, we are printing the lagadd series in python.

Python3




import numpy as np
import numpy.polynomial.laguerre as neveropen
  
# Laguerre series coefficients
series1 = (10, 20, 30, 40, 50)
series2 = (1, 2, 3, 4, 5)
  
# using np.lagadd() method
result = neveropen.lagadd(series1, series2)
  
# Resulting laguerre series
print(result)


Output:

[11. 22. 33. 44. 55.]

Example  #2 :

Under this example, we have created two series variables of 4 unique data point integer type , and further, with the call of the np.lagadd() function we are getting in the return of the function the lagadd series in python.

Python




import numpy as np
import numpy.polynomial.laguerre as neveropen
  
# Laguerre series coefficients
series1 = (8, 7, 6, 5)
series2 = (2, 3, 4, 5)
  
# using np.lagadd() method
result = neveropen.lagadd(series1, series2)
  
# Resulting laguerre series
print(result)


Output:

[10. 10. 10. 10.]
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32520 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6903 POSTS0 COMMENTS
Nicole Veronica
12017 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12115 POSTS0 COMMENTS
Shaida Kate Naidoo
7023 POSTS0 COMMENTS
Ted Musemwa
7265 POSTS0 COMMENTS
Thapelo Manthata
6980 POSTS0 COMMENTS
Umr Jansen
6972 POSTS0 COMMENTS