Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize polynomial results from approximantOfPade? #29

Open
axkr opened this issue Jul 5, 2022 · 2 comments
Open

Normalize polynomial results from approximantOfPade? #29

axkr opened this issue Jul 5, 2022 · 2 comments

Comments

@axkr
Copy link
Contributor

axkr commented Jul 5, 2022

Can the result poylnomials be "normalized" from the approximantOfPade(), so that the coefficient for x^0 is 0 or 1.

  public void testQuotientPade001() {
    GenPolynomialRing<BigRational> pr = fac.polyRing();
    GenPolynomial<BigRational> numerator = pr.parse("x^3 + 72 x^2 + 600 x + 720 ");
    GenPolynomial<BigRational> denominator = pr.parse("12 x^2 + 240 x + 720");
    QuotientRing<BigRational> qr = new QuotientRing<BigRational>(pr);

    Quotient<BigRational> p = new Quotient<BigRational>(qr, numerator, denominator);

    QuotientTaylorFunction<BigRational> tf = new QuotientTaylorFunction<BigRational>(p);


    Quotient<BigRational> approximantOfPade =
        PolyUfdUtil.<BigRational>approximantOfPade(fac, tf, BigRational.ZERO, 3, 1);
    System.out.println(approximantOfPade.toString());
    System.out.println("num: " + approximantOfPade.num.toString());
    System.out.println("den: " + approximantOfPade.den.toString());
  }

gives

{ ( -1/192 ) x^3 + 3/16 x^2 + 23/8 x + 15/4  | x + 15/4  }
num: ( -1/192 ) x^3 + 3/16 x^2 + 23/8 x + 15/4 
den: x + 15/4 
@kredel
Copy link
Owner

kredel commented Jul 6, 2022

The normalization of the quotient as normalization of the denominator leading coefficient to one is hard coded in the constructor. Maybe it would need an enumeration of possible normalizations defined in its ring.

@kredel
Copy link
Owner

kredel commented Jul 28, 2022

The next JAS version will contain code to select between different quotient normalizations.

/** Quotient polynomial normalization, simplification. */
public static enum QuoNorm {
    normNumLead,  // normalize ldcf(numerator) == 1
    normNumTrail, // normalize trcf(numerator) == 1
    normDenLead,  // normalize ldcf(denominator) == 1
    normDenTrail  // normalize trcf(denominator) == 1
};
/** Default quotient polynomial normalization, simplification.*/
public final static QuoNorm quoNorm = QuoNorm.normDenLead; // must be the default

But using other normalizations than QuoNorm.normDenLead will crash code in various places.
Could you please help in spotting all those places and give hints on what would be a desirable solution?

axkr added a commit to axkr/symja_android_library that referenced this issue Jul 30, 2022
axkr added a commit to axkr/symja_android_library that referenced this issue Jul 30, 2022
kredel added a commit that referenced this issue Sep 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants