Questions tagged [polynomial-math]

Polynomial Math is a subset of mathematics dealing with mathematical expressions constructed from variables and constants using only the operations of addition, subtraction, multiplication, and non-negative integer exponents. Any polynomial math question should be programming related.

630 questions
3
votes
1 answer

sympy: Collect symbols for matrix coefficients?

I am trying to factor an expression, and separate coefficients to matrix form, such that: Closely related to Factor sympy expression to matrix coefficients?, where Wild symbols are used with match(form) to determine coefficients for its matrix…
OnStrike
  • 748
  • 1
  • 6
  • 22
3
votes
2 answers

What is a fast algorithm to find a numeric solution of a system of N polynomial equations on 3 unknown variables?

I'm looking for a fast algorithm to solve a system of N polynomial equations on 3 unknown variables. That is, given 3 functions, F0(x,y,z), F1(x,y,z)... FN(x,y,z), I want to find x, y, z such that F0(x,y,z) = F1(x,y,z) = ... = FN(x,y,z) = 0. I've…
MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
3
votes
2 answers

Good Package for Fitting Polynomial Trend Lines

Given a simple data set, I would like to be able to calculate a trending formula given it's a second order polynomial regression. In fact, it would be great if one could even forecast X periods during calculation (similar to what Excel does). I'm…
Rev316
  • 1,920
  • 2
  • 19
  • 24
3
votes
1 answer

Implementing the De Boor splining algorithm in C#

I know it's a slightly "Please do my homework" question, but I'm trying to implement the De Boor algorithm as explained here: http://en.wikipedia.org/wiki/De_Boor's_algorithm I have got a generic class which takes any array of any type and two…
Phil Whittington
  • 2,144
  • 2
  • 16
  • 20
3
votes
4 answers

Calculation of CCITT standard CRC with polynomial x^16 + x^12 + x^5 + 1 in Java

I need help with calculating of CCITT standard CRC with polynomial x^16 + x^12 + x^5 + 1 (0x1081) in Java. I have tried many examples on the internet but every one of them returns other values than the ones in the example. For example for this array…
AdrianES
  • 670
  • 3
  • 13
  • 29
3
votes
3 answers

Polynomial operations using operator overloading

I'm trying to use operator overloading to define the basic operations (+,-,*,/) for my polynomial class but when i run the program it crashes and my computer frozes. Update4 Ok. i successfully made three of the operations, the only one left is…
Vlad
  • 618
  • 2
  • 10
  • 21
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

Java Horner's polynomial accumulation method

So far, I have this code, which, in summary, takes two text files and a specified block size in cmd and standardises the txt files, and then puts them into blocks based on the specified block size. import java.io.*; import java.util.*; public class…
user3364788
  • 99
  • 2
  • 10
3
votes
2 answers

how to calculate a quadratic equation that best fits a set of given data

I have a vector X of 20 real numbers and a vector Y of 20 real numbers. I want to model them as y = ax^2+bx + c How to find the value of 'a' , 'b' and 'c' and best fit quadratic equation. Given Values X = (x1,x2,...,x20) Y = (y1,y2,...,y20) i need…
3
votes
3 answers

Nested Polynomial-Time functions

If I run a polynomial-time subroutine a polynomial number of times, what are some examples of a way that this is done in exponential time? "show that a polynomial number of calls to polynomial time subroutines may result in an exponential-time…
theB3RV
  • 894
  • 4
  • 13
  • 33
3
votes
1 answer

Polynomial Constrained Least Squares curve fitting with matlab

I want to fit and draw a curve that is constrained with the following boundary condition: diff (yfit)<=0 where yfit is the polynomial fitted function to degree n. The condition ensures that the slope of the polynomial to any degree of is…
3
votes
3 answers

Evaluation issue using accumulators in Prolog to evaluate a polynomial

Background I need to write a predicate eval(P,A,R), where: P represents a list of polynomial coefficients, i.e. 1+2x+3x^2 is represented as [1,2,3]. A represents the value for X. R is the result of the polynomial at X=A. Example: eval([3,1,2],3,R)…
jessicaraygun
  • 315
  • 1
  • 4
  • 15
3
votes
1 answer

Canonical coefficients from Newton polynomial

A while ago I implemented a Polynom approximation for a game I programmed. I am using Newton's pyramide method. It took me quite a while to figure it out, but my solution requires to calculate the binomial coefficients and I also have to sum up all…
superphil0
  • 94
  • 8
3
votes
5 answers

Java - toString method for polynomial Terms

I have created a polynomial class without using Polynomial, I am using my own Term(coefficient, exponent) to create the polynomial expression. I have some conditions which are as follows: coefficient = 0 -> Term(0,2) -> 0x^2 -> "0" coefficient = 1…
germainelol
  • 3,231
  • 15
  • 46
  • 82
3
votes
2 answers

Java / JUnit - comparing two polynomial objects

I have a Java class called Term holding polynomials like below public Term(int c, int e) throws NegativeExponent { if (e < 0) throw new NegativeExponent(); coef = c; expo = (coef == 0) ? 1 : e; } I also have an equals method in the same…
germainelol
  • 3,231
  • 15
  • 46
  • 82