Carl Love

Carl Love

28010 Reputation

25 Badges

12 years, 290 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

I just noticed that you used A in two ways in your code: as the lower limit of integration and as the name of the Array. It's very likely that this caused your errors, and even if it didn't, you should change the Array's name to something else.

In my code above, that problem doesn't show up, which is why I didn't notice it until now. In my code, the inert form of the integral expression is created before is made into an Array. Within the inert form, A is encoded as a string constant"A", which makes it immune to change. You can examine that inert encoding via lprint(J).

Also, it's not necessary to use inert forms to use long mathematical expressions as multiple choices; you can also use ordinary Maple expressions created via either 2D- or 1D-input. I used an inert form so that I could represent your expression into a form close to what you had.

@emendes The important thing is whether rho is less than or greater than 1rho being positive but not necessarily greater than 1 is irrelevant. Assuming beta > 0 is not problematic by itself.

There is no variable sigma in this problem. If you actually meant signum, that's a Maple function name. The assumptions should be made on beta and rho such that the value of the argument of signum is positive, which'll make the signum expression equal 1. Above, @dharr used 

assuming beta > 0, rho > 1, -1 - sqrt(beta)*sqrt(rho - 1) + rho > 0;

The purpose of the last of those assumptions is to determine the value of the signum expression.

Two general tips for assumptions:

  1. If a variable appears alone on one side of any inequality in a assumption, then also assuming that it's real is never necessary.
  2. I usually find assuming easier to work with than assume.

@aroche In your first equation, the first sqrt encompasses the denominator; in Ed's original it does not. But anyway, the first equation is superfluous; the xi__8 cancels, leaving a tautology.

@nm It is a Riccati equation; however, this classification doesn't help Maple to solve it. As you showed, Maple's dsolve needs no help or prompting to solve it, See the Wikipedia article "Riccati equation",

It wasn't obvious to me whether the above approach would work over an extended finite field (i.e., one with p^k elements where p is prime and k > 1). The worksheet below shows that it does work.

Partial-fraction decomposition of rational functions over finite fields

Author: Carl Love <carl.j.love@gmail.com> 2025-May-18

restart
:

#This procedure simply improves the display of polynomials over
#extended finite fields; it has no mathematical significance:
Collect:= f-> subsindets(f, polynom, sort@collect, indets(f,name))
:

#This is how to make an operator that works with the `mod` operator:
`mod/Fullparfrac`:= (f,p)->
local x:= indets(f, name)[]:
    (Collect@map)(
        `mod/Normal`,
        convert((numer/(Factor@denom))(f) mod p, 'parfrac', x),
        p
    )
:

#Partial-fraction example over a simple finite field:
Fullparfrac(1/(x^9+x^6-x+1)) mod 11;

(5*x+1)/(x^2+1)+(3*x^4+4*x^3+6*x^2+5*x+4)/(x^5+7*x^4+6*x^3+2*x^2+5*x+5)+(3*x+6)/(x^2+4*x+9)

#Partial-fraction example over an extended finite field:
#
#First, create a degree-2 field extension of GF(2):
Randprime(2,x) mod 2; alias(xi= RootOf(%)):

x^2+x+1

#So, the 4 field elements of GF(2^2) will be denoted as
{0, 1, xi, xi+1};

{0, 1, xi+1, xi}

#Create a large reducible monic polynomial over GF(2^2) to use as the
#denominator of a rational function:
deg:= 9:
do
    d:= x^deg + Randpoly(deg-1, x, xi) mod 2
until nops((Factors(d) mod 2)[2]) > 2: #more than 2 factors
d:= Collect(d);

x^9+xi*x^8+(xi+1)*x^7+xi*x^5+(xi+1)*x^4+x^3+x+xi+1

pf:= Fullparfrac(x^(deg+1)/d) mod 2;

x+xi+(xi*x+xi+1)/(x^2+x+xi)+((xi+1)*x^5+(xi+1)*x^4+x^3+xi*x^2+xi*x+1)/(x^6+xi*x^4+xi*x^3+(xi+1)*x^2+xi*x+xi+1)+1/(x+xi+1)

#Verify that we get back the original numerator:
Normal(pf*d) mod 2;

x^10

 

Download ModParfrac.mw

@dharr The (poorly named) display command is not needed to display an unaltered already-existing-in-memory plot. You could simply use 

plt0;

or even just

%;

@Joe Riel The above can also be done via subs:

om:= kernelopts('opaquemodules'= false):
Statistics:-Visualization:-VennDiagram:-GenerateSize:= subs(
    "%.2f%%"= "%.0f%%", 
    eval(Statistics:-Visualization:-VennDiagram:-GenerateSize)
);
kernelopts('opaquemodules'= om):

An easier way: Using the same a,

simplify(sum(a(2*k-1) + a(2*k), k= 1..infinity));

This works because simplify will already know from the summation limits that k is a positive integer.

@Blanc In mathematical English, the term for a quotient of polynomials is rational function, not "rational fraction". The use of "fraction" perhaps led to some initial confusion regarding this Question. The "simple elements" of the decomposition are called (unfortunately) partial fractions. If a field of coefficients is specified (or implied), and all of the denominators are irreducible polynomials (or powers thereof) over that field, then it's a full partial-fraction decomposition.

@Blanc Here's a simpler procedure. It doesn't need the add or op or to treat irreducible denominators as special degenerate cases.

If you want to replace the general-case ​​​​​​Factor that I used by one of the more specific factorization procedures (BerlekampDistDegSqrfree), some very minor syntax changes might be needed, which I could provide. Each of those has its own help page.

restart
:

`mod/Fullparfrac`:= (f, p)->
    map(Normal, convert((numer/(Factor@denom))(f) mod p, parfrac)) mod p
:

Fullparfrac(1/(x^9+x^6-x+1)) mod 11;

(5*x+1)/(x^2+1)+(3*x+6)/(x^2+4*x+9)+(3*x^4+4*x^3+6*x^2+5*x+4)/(x^5+7*x^4+6*x^3+2*x^2+5*x+5)

 

 

Download ModParfrac.mw

@salim-barzani Obviously you've been posting nearly identical Questions under different usernames, the other name being @SSMB.

If some of your variables and parameters can be assumed to be real, it would make what your asking for easier.

Please post your algorithms as Maple code. I'm particularly interested in your set-partioning algorithm. (And your green-bordered example clearly shows that it's a multiset algorithm, which is significantly more difficult to do efficiently.) I'm not interested in the user-interface portions of your code, i.e., the parts the accept input from a user and display the output in a Maplet.

This should be a Question, not a Post. And since it contains the entire informational content of your previous Question, plus some additional (and very relevant) information, that previous Question should be deleted.

Do you understand that phi >= 0 does not imply sin(phi) >= 0, and that it's this latter inequality that allows for simplification under the square root? Here's your latest expression:

B:= sin(phi)^(13/4)*2^(3/4)*sqrt(cos(phi)^(5/2)*sqrt(2)
    /(sin(phi)*cos(phi))^(5/2))*a^2/(4*x^2) 
    + sin(phi)^2/(2*x^2)
:
simplify(B) assuming sin(phi) >= 0;
                               2 / 2    \
                       sin(phi)  \a  + 1/
                       ------------------
                                 2       
                              2 x        
1 2 3 4 5 6 7 Last Page 3 of 708