Questions tagged [polynomials]

In mathematics, a polynomial is an expression consisting of variables (or indeterminates) and coefficients, that involves only the operations of addition, subtraction, multiplication, and non-negative integer exponents.

In mathematics, a polynomial is an expression consisting of variables (or indeterminates) and coefficients, that involves only the operations of addition, subtraction, multiplication, and non-negative integer exponents.

An example of a polynomial of a single indeterminate (or variable), x, is x2 − 4x + 7, which is a quadratic polynomial.

Polynomials appear in a wide variety of areas of mathematics and science. For example, they are used to form polynomial equations, which encode a wide range of problems, from elementary word problems to complicated problems in the sciences; they are used to define polynomial functions, which appear in settings ranging from basic chemistry and physics to economics and social science; they are used in calculus and numerical analysis to approximate other functions. In advanced mathematics, polynomials are used to construct polynomial rings and algebraic varieties, central concepts in algebra and algebraic geometry.

Wikipedia: http://en.wikipedia.org/wiki/Polynomial

978 questions
3
votes
1 answer

Generate a symbolic interpolating polynomial in Scilab

I've made a code to calculate the result of divided differences method and lagrange method by interpolating points. I would also like to build a polynomial using symbolic variables but how can I accomplish this? function dividedDifferences(X,Y,x) …
0rkan
  • 845
  • 2
  • 18
  • 34
3
votes
3 answers

Substitute a Sympy matrix into a polynomial

I have a Sympy matrix A and a polynomial expression P, and I would like to compute P(A). Here is an example: x = Symbol('x') P = x**2 - 3*x + 5 A = Matrix([ [1,3], [-1,2] ]) P.subs(x, A) I expect Sympy to compute A**2 - 3*A + 5*eye(2) (in the…
Adrien
  • 469
  • 3
  • 11
3
votes
1 answer

Faster way to attach 2d polynomial coefficients to terms in Python?

So I am trying to create a polynomial that contains 2 independent variables by attaching the respective coefficients (k_ij) to the respective monomial (x**i*y**j, where x and y are symbolic variables). My goal is to minimize computation time…
3
votes
1 answer

Interpolation using dynamic programming

I'm having trouble on doing a homework exercise. I need to describe an efficient algorithm which solves the polynomial interpolation problem: Let P[i,j] be the polynomial interpolation of the points (xi, yi),...,(xj,yj). Find 3 simple polynomials…
user3114639
  • 1,895
  • 16
  • 42
3
votes
2 answers

4th and 5th Order Polynomial Regression not Working in Excel

I'm having an odd problem with doing polynomial regression in Excel. As many have before, I'm trying to get the correct coefficients that Excel is using when it creates a polynomial trend line on a graph. I've read how to do it using LINEST, and I…
Vadaar
  • 43
  • 2
  • 4
3
votes
1 answer

Plotting Legendre Polynomials - Getting different results for own method

I'm trying to plot the legendre polynomials, defined as: P0(x) = 1 P1(x) = x Pn+1(x) = ((2n+1)/(n+1)) * x * Pn(x) - (n / (n+1)) * Pn-1(x) I've done it the easy slow way, and I've done it the direct, a little more complicated way. Both result in a…
3
votes
1 answer

How to compute sin(2*m*Pi/n) exactly with CGAL and CORE?

Using Chebyshev polynomials, we can compute sin(2*Pi/n) exactly using the CGAL and CORE library, like the following piece of codes: #include #include #include //return sin(theta) and…
Weisheng
  • 31
  • 2
2
votes
3 answers

Adding a trendline in basic R code (no GGPlot) for multiple plot graph of exponential and 2 factor polynomial curves

I am trying to add trendlines to a multi-plot graph using basic R code. Could use some help to to add trendlines for non-linear functions, and am not sure if this is possible with basic R. I may need to upgrade my skillset to ggplot and thought I…
EBH
  • 21
  • 3
2
votes
1 answer

Polynomial regression models return different values: `lm(dist ~ speed+I(speed^2), data=cars)` and `lm(dist ~ poly(speed, degree = 2), data = cars)`

Using the cars data in R, I would like to create a polynomial regression model with varying degree values. Through research online I have found two methods of creating these models: library(tidyverse) data(cars) # method 1 polyreg_deg2 <- lm(dist ~…
2
votes
1 answer

Speed up Gekko when minimizing many equations with interactive variables

I am using gekko to solve for 14 variables by minimizing around 10,000 equations with IMODE=3. Each equation is the squared error between a response y and the output of a polynomial model at row i in the training data. eq[i] = (y[i] - model[i]) **…
Florent H
  • 323
  • 1
  • 8
2
votes
2 answers

How can I replace x in a polynomial by 'y' in R language?

if(!require('PolynomF')) { install.packages('PolynomF') library('PolynomF') } (q <- polynom(c(0,2,2))) for example here it will print with x, but I want it to be with y, like 2y + 2y^2
Obida
  • 37
  • 6
2
votes
0 answers

Julia ERROR: 'Can't Promote to Common Type' for multivariate polynomials in Nemo Library

I am new to Julia and have been trying to compute some polynomials using the Nemo library's multivariate polynomials. I have the following code: R = GF(2); # create finite field S, (z, x) = PolynomialRing(R, ["z", "x"]); # Multivariate…
Sputn1k
  • 51
  • 7
2
votes
1 answer

How to get the vector representation of a polynomial in GF(2)[x]?

I tried to multiply two polynomials g(x), h(x) ∈ GF(2)[x]. And I got the result as c(x). I would like to get the vector representation of c(x). Here is the code I am sharing. import galois GF = galois.GF(2) g = galois.Poly([1, 0, 1, 1], field=GF) h…
Robin Kurtz
  • 115
  • 2
2
votes
3 answers

polynomial fitting of a signal and plotting the fitted signal

I am trying to use a polynomial expression that would fit my function (signal). I am using numpy.polynomial.polynomial.Polynomial.fit function to fit my function(signal) using the coefficients. Now, after generating the coefficients, I want to put…
MRR
  • 45
  • 1
  • 6
2
votes
1 answer

making a function with a for loop to compare degrees of polynomial in polynomial regression

I want to make this code into a function with a for loop so that I can plug a variable into the function (where "age" is in this code) and get an ANOVA table out that compares the fit of each polynomial. I would like the fits examined to go up to…
Rachel
  • 21
  • 2