Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [polynomials]

For questions about solving and representing polynomials computationally.

Filter by
Sorted by
Tagged with
2 votes
2 answers
109 views

Gradient descent for solving polynomial equations while encouraging variables to be nonzero

I would like to use gradient descent to "randomly sample" solutions to a set of homogeneous polynomial equations. Because the equations are homogeneous, setting all variables to 0 is a valid ...
PPenguin's user avatar
  • 123
0 votes
1 answer
90 views

Solving a polynomial with NumPy

I'm trying to do something that I thought would be very straightforward but somehow I'm struggling. I have a time series and I want to extrapolate it, assuming a linear trend, to forecast when will it ...
user avatar
2 votes
0 answers
96 views

What is the point in non-intrusive Polynomial Chaos output moments?

So I recently learned about Polynomial Chaos Expansion (aka PCE), and it seemed to me that its purpose was to propagate uncertainty from the inputs to the outputs more efficiently (via closed-form ...
profPlum's user avatar
  • 149
0 votes
1 answer
69 views

Solve bivariate polynomial system

Given a bivariate polynomial system with variables $(x, y, z)$ like (1) $ f_1 = x * a_1 + y * a_2 + z * a_3 = 0 $ (2) $ f_2 = x * a_4 + y * a_5 + z * a_6 = 0$ (3) $ f_3 = x^2 + y^2 - 1 = 0$ how do I ...
Citizen3011's user avatar
1 vote
0 answers
71 views

Strategies to solve an equation with a polynomial and a numeric function

I have to solve numerically an equation of the following form: $$ \sum_{n=0}^m c_n x^n = f(x) x^k $$ Where the $c_n$ are real values, $k$ is an integer and $f$ can only be evaluated numerically. The ...
WIP's user avatar
  • 153
1 vote
1 answer
129 views

Explicit polynomial for quadratic elements? (FEM)

In this resource the linear (barycentric) elements are explicitly given: The geometry placement of higher order elements is also given but not expression for the polynomial of $P_2$ is given. I am ...
Makogan's user avatar
  • 263
1 vote
0 answers
96 views

Integration problem

I want to numerically solve integrals of the form, $$ I = \int_a^b x^k f(x) dx $$ where $k$ is a given integer, and $f(x)$ is a cubic polynomial, expressed as, $$ f(x) = c_0 + c_1 (x - a) + \frac{c_2}{...
vibe's user avatar
  • 1,058
2 votes
0 answers
48 views

Software for Smith form or Hermite form of a sparse polynomial matrix

In a current research project, I have a number of matrices with coefficients in ℚ[𝑥] for which I want to understand how their rank depends on the value of the parameter 𝑥. These matrices are: ...
Vladimir Dotsenko's user avatar
0 votes
0 answers
44 views

Quadrature rules for products of 2D regions

I am interested in computing integrals of the form $\iint_{P\times P} Q(x_1,x_2,y_2,y_2) dxdy$ where $P$ is a polygon and $Q$ is a polynomial. The coordinates $(x_1,x_2)$ are in the plane of $P$. Of ...
Beni Bogosel's user avatar
  • 1,057
0 votes
0 answers
558 views

Curve fitting using a piecewise polynomial

I am trying to fit a piecewise polynomial function Code: ...
Natasha's user avatar
  • 421
0 votes
1 answer
1k views

Fitting a monotonically increasing spline function

I want to fit a monotonically increasing smooth spline function for a dataset Code: ...
Natasha's user avatar
  • 421
0 votes
0 answers
105 views

Recursion relations for integrating Gaussian functions

I'm trying to implement a numerical method used in quantum chemistry from scratch. I'm using this paper as a reference. It's also available on Sci-Hub. So, the method requires calculating integrals of ...
Dmitry Govorov's user avatar
2 votes
1 answer
194 views

Quadrature of rational functions

I have a class of integrals I need to solve numerically which have the form: $$ I_k = \int_a^b \frac{p_k(x)}{x^k} dx, \quad k = 0, 1, \dots, K $$ where $p_k(x)$ is a cubic polynomial on the interval $[...
vibe's user avatar
  • 1,058
1 vote
0 answers
75 views

Generate polynomial basis through a sequence of SVD

I need help to understand how to use the result given by an algorithm for constructing an orthonormal polynomial basis over $L^{2}(X)$, where $X\subset\mathbb{R}^2$, with respect to the inner product $...
Raibyo's user avatar
  • 219
3 votes
1 answer
97 views

What does this function called LAGRANGE2 do?

While browsing a disk image from the Soviet mainframe BESM-6, I've found some bits and pieces of a computational math library for Algol-60, stored in plaintext (if the Soviet GOST 10859 encoding with ...
Leo B.'s user avatar
  • 215
3 votes
0 answers
82 views

Sufficient condition for real roots of a polynomial of order $n>5$ with arbitrary real coefficients

I ask for help in solving the problem. I am developing an optimization program that selects the coefficients of a polynomial of order $n> 5$ so that all its zeros are just real numbers. And I ...
dtn's user avatar
  • 131
6 votes
1 answer
537 views

Polynomial approximation for floating-point arithmetic

I cannot remember where I picked this up, but during my time reading about polynomial approximation for floating-point arithmetic of sin(x), I vaguely remember that ...
Quang Thinh Ha's user avatar
2 votes
0 answers
107 views

Solve Rational Equation for Root Music in MATLAB

I'm trying to estimate DOA in the Hybrid architecture using root music so I need to solve the attached equation to find the roots for the Root_Music equation in Matlab. Does anyone have an idea for ...
Mona's user avatar
  • 31
4 votes
1 answer
326 views

Is there any way/any python function to calculate the condition number of the roots of a polynomial directly?

I know that NumPy has linalg.cond(A) to find the condition number of a matrix A. But, if I want to find the condition numbers of the roots of a large polynomial ...
Deirdre's user avatar
  • 41
-1 votes
1 answer
39 views

Time complexity and its formula [closed]

Is there any example support the case of $O(n^k)$ where $k$ has a fixed calculated value for every $n$ and $k$ is not a constant value for all $n$. As $k$ depends on the value of $n$ in polynomial ...
user39807's user avatar
4 votes
0 answers
99 views

Pade-like approximation, but force poles to be negative

Are there techniques to form a Pade approximation (or Pade-like approximation), except force the poles of the rational function to be negative? I am trying to use Pade approximations to extrapolate a ...
Nick Alger's user avatar
  • 3,133
1 vote
1 answer
72 views

Gauss Integration of $\sqrt(x)$

I want to construct a gauss integration for the weight function $w(x) = x^{1/2}$ for $$\int_{0}^{1}x^{1/2}f(x)dx = a_{1}f(x_{1})+a_{2}f(x_{2})$$ Solving \begin{align*} a_{1}+a_{2} =& \int_{0}^{...
user avatar
1 vote
1 answer
76 views

Algorithm to determine if a polynomial has any complex roots

Is there a simple algorithm to determine if a given polynomial (with all real coefficients) has all real roots? I do not need to know what the roots are; I just what to know if a given polynomial has ...
physics_researcher's user avatar
5 votes
0 answers
379 views

Polynomial rooting - fast root finding

I need to solve a rooting problem of a polynomial (the order of which is 2(N-1), where N=48). So far I'm using Python Numpy algorithm (that relies on computing the eigenvalues of the companion matrix)...
Luca R's user avatar
  • 61
2 votes
1 answer
86 views

How to robustly and numerically expand a $k$-order polynomial in two variables defined on a polygon domain?

Given a $k$-order polynomial in two variable $p(x, y)$ defined on a polygon domain $K$. And I want to numerically expand it to the following form $$ p(x, y) = c_0 + c_1 x + c_2 y + c_3 x^2 + c_4 xy + ...
Huayi Wei's user avatar
  • 143
2 votes
0 answers
119 views

Find solution to Polynomial Sequences without going through variety in Sage

I'm computing the Groebner basis of an ideal defined over the QQ ring. Once I have this Groebner basis, I would like to obtain a set of values that satisfy the equations in the Groebner basis. I know ...
David Bernal's user avatar
1 vote
0 answers
43 views

Minimizing a polynomial with millions of monomials

I need to minimize a single polynomial $P(x_1,x_2,...,x_n)$ with the constraint that for each $i$, $0\leq x_i \leq 1$. The number of variables in my practical problem is at most $50$. The degree is at ...
Springberg's user avatar
2 votes
1 answer
182 views

Differentiation Matrix In DG-FEM - Hesthaven/Warburton

In the book of Hesthaven and Warburton on discontinual Galerkin methods the authors give motivation to the differentiation matrix (page 52), referred to as $D_r(i,j)=\frac{dl_j}{dr}|_{r_i}$ where $l_i(...
dba's user avatar
  • 295
0 votes
0 answers
43 views

Finding the polynomial for the solution of an ODE

I’m stuck trying to solve part (b) and (c) of the below problem, but part (b) is the one of main concern here as I think (c) should follow easily once (b) is completed. I don’t know where to start ...
Laplace's Demon's user avatar
6 votes
2 answers
143 views

Positive root of $x^q + bx - b$

Is there either a closed-form expression or fast/elegant algorithm for computing the positive root of the polynomial $$f(x)=x^q + \beta x - \beta,$$ where $\beta>0$ and $q\geq2$? How about the $q\...
Justin Solomon's user avatar
6 votes
3 answers
295 views

Fast evaluation functions given by straight-line programs

I have a simple but long function that takes a vector x[10], and outputs a vector y[100]. It is an automatically generated eval function for a multivariate polynomial, ie, there is only (complex) ...
rfabbri's user avatar
  • 129
1 vote
1 answer
120 views

Find the roots of a complicated polynomial

For the polynomial $$p(x) = (x-1)(x-2) \cdots (x-20) - 2^{-23}x^{19}\, ,$$ I tried to use fzero() in MATLAB, and I set the interval to be $[0.5,1.5]\cdots [19.5,...
M Z's user avatar
  • 29
9 votes
2 answers
569 views

Numerical stability of higher order Zernike polynomials

I'm trying to calculate higher order (e.g., m=0, n=46) Zernike moments for some image. However, I'm running into a problem ...
Sanchises's user avatar
  • 273
2 votes
0 answers
2k views

Solve system of polynomial equations with Python

I have 5 at most 4th order polynomials in 5 variables, $$p_i(x_1,x_2,x_3,x_4,x_5) \qquad i = 1, \ldots, 5$$ where all coefficients are either rational or floating point. I'd would like to get the ...
Fetchinson0234's user avatar
5 votes
2 answers
194 views

Polynomial approximation spaces

I often see people using products of 1-D polynomials to do interpolation or projection of smooth multivariate functions over grids or cells because it is intuitive and simple to implement. What are ...
coolguy1000000's user avatar
2 votes
1 answer
59 views

Test on a set of high degree polynomials whose coefficients in {-1,0,1}

I'm looking for the best way of implementing the following algorithm: consider the set of all polynomials with a high degree (say, degree 30) whose coefficients ranges from a given set of values (say, ...
R. Vieira's user avatar
1 vote
0 answers
61 views

Numerical analysis: Chebyshev coefficient representation error

If $x_k$ are the Chebyshev nodes, that is for $n \in \mathbb{N}^*$, we have $x_k = \cos(\pi \frac{2k + 1}{n})$. Now suppose you have approximated values of $x_k$ and $x_{k'}$ for $k,k' \leq n$. In the ...
user401855's user avatar
2 votes
0 answers
44 views

Can I expect reasonable results when expanding in scaled Legendre polynomials?

Imagine I want to compute the eigenvalues of an operator $\hat O$ defined on $ L^2(\mathbb{R})$, however using a properly scaled N-dimensional polynomial basis of $ L^2([-a,a]) $ which fulfills ...
Jodocus's user avatar
  • 121
1 vote
2 answers
1k views

Polynomial Interpolation with Matlab polyfit

Given $N$ data points, does polyfit of degree $N-1$ produces the unique interpolating polynomial? For concreteness, here is a code example: ...
Amir Sagiv's user avatar
5 votes
2 answers
266 views

Building Gaussian-type quadrature schemes with Zernike polynomials

The abscissas for Gauss quadrature are given by the zeros of the Legendre polynomials. The Legendre polynomials form an orthogonal set over $[-1, 1]$, and it is shown in (for instance) Kress that the ...
user14717's user avatar
  • 2,155
0 votes
1 answer
129 views

Chebychev Polynomial derivatives at zero points and extreme points

I was looking for some help with derivatives of Chebychev polynomials at zero points. The recursive expression, $$ T_{(j+1)}(x) = 2xT_j(x) - T_{(j-1)}(x) $$ has the derivative $$ T'_{j+1}(x) = 2T_j(...
Anup Mulay's user avatar
0 votes
1 answer
4k views

Derivatives of a Chebychev polynomial

I am using Chebychev collocation nodes for approximation, and my problem requires me to calculate derivatives of the polynomial. I have been reading from a few sources, but I am not sure I understand ...
Anup Mulay's user avatar
4 votes
2 answers
405 views

Intervals where the sign of a polynomial can be computed reliably

This is a follow-up of a previous question. Let $p$ be a polynomial with floating-point coefficients. Is there a method for finding intervals where evaluating $p$ in floating-point arithmetic always ...
lhf's user avatar
  • 966
6 votes
3 answers
183 views

Accurate evaluation of the sign of a polynomial

Let $p$ be a polynomial with floating-point coefficients and let $a$ be a floating-point value. Is there a method for accurately evaluating the sign of $p(a)$ in floating-point arithmetic? I don't ...
lhf's user avatar
  • 966
1 vote
0 answers
539 views

Polynomial approximation - Vandermonde matrix creation - precision

I am trying to fit a polynomial through 340 points in a 3D space, i.e. $$f(x,y,z) = k$$ I asked previously about the theory behind polynomial interpolation here -> Polynomial interpolation Few ...
federico's user avatar
0 votes
1 answer
388 views

Underdetermined/overdetermined polynomial interpolation

I am trying to apply a polynomial interpolation to 340 points in a 4D space, i.e., $$f(x,y,z)=k\, .$$ What I would like to understand is this: if I use a 6th order polynomial I will end up with 343 ...
federico's user avatar
4 votes
1 answer
912 views

Interpolating a mathematical function using a Hermite Cubic Finite Element Space

I have a Hermite Cubic Finite Element Space on a computer in the form of Matlab m-files. More specifically, I can evaluate four "shape functions" $N_1, N_2, N_3,$ and $N_4$, for which the following ...
A. B. Marnie's user avatar
2 votes
1 answer
100 views

Legendre expansion of $r(x) = f(x)/g(x)$ using a finite number of samples from $f(x)$ and $g(x)$

I have two finite sets of events $\{x_1, ..., x_N\}$ and $\{y_1, ..., y_N\}$ that are sampled from the PDFs $f(x)$ and $g(x)$, respectively, where $x \in [-1,+1]$. I want to estimate the Legendre ...
Sam's user avatar
  • 23
1 vote
0 answers
98 views

Quadrature in finite element methods | How should I compute integrals involving the solution of the last time step?

Let $\Delta\subseteq\mathbb R^2$ denote the triangle spanned by $(0,0)$, $(1,0)$ and $(0,1)$ and $$\mathbb P_r(\Delta):=\left\{p:\Delta\to\mathbb R\mid p(x)=\sum_{|\alpha|\le r}\lambda_\alpha x^\alpha\...
0xbadf00d's user avatar
  • 283
1 vote
0 answers
60 views

How to sort 13 enormous polynomials, each having terms with 5 variables ($1>h_0>h_1>h_2>h_3>h_4$)?

Both algebraically or with software (numerically/computationally, for example) is acceptable. Here is a how one of the polynomials looks like ($L<1$ is a constant). I have attached a text file ...
TPank's user avatar
  • 11