vv

13837 Reputation

20 Badges

9 years, 318 days

MaplePrimes Activity


These are answers submitted by vv

Do not use [...] for grouping in expressions; they are reserved for lists.
Do not use floats in symbolic computations.

restart;
f:=1/(exp((-1+(1-4*epsilon)^(0.5))/(2*epsilon))-exp((-1-(1-4*epsilon)^(0.5))/(2*epsilon)))*(exp((-1+(1-4*epsilon)^(0.5))/(2*epsilon)*t)-exp((-1-(1-4*epsilon)^(0.5))/(2*epsilon)*t))/(exp(1-t)-exp(1-t/(epsilon))):
g:=convert(f, rational);

simplify(limit(g, epsilon=0, right)) assuming t>0;
                               1
simplify(limit(g, epsilon=0, left)) assuming t>0;
                               0
simplify(limit(g, epsilon=0)) assuming t>0;
                           undefined

So, for t>0 your function has distinct side-limits. (For t=0 the function is not defined).

 

sol:=RootOf((8*n-8)*_Z^6+(n^4+36*n^2-68*n+56)*_Z^5+(n^5+10*n^4+80*n^3-200*n^2+224*n-152)*_Z^4+(n^6+28*n^5+69*n^4-268*n^3+468*n^2-356*n+200)*_Z^3+(3*n^7+32*n^6+7*n^5-204*n^4+380*n^3-544*n^2+272*n-128)*_Z^2+(3*n^8+14*n^7-20*n^6-32*n^5+252*n^4-240*n^3+304*n^2-80*n+32)*_Z-n^9-12*n^8-44*n^7-40*n^6-4*n^5-128*n^4+48*n^3-64*n^2);

RootOf((8*n-8)*_Z^6+(n^4+36*n^2-68*n+56)*_Z^5+(n^5+10*n^4+80*n^3-200*n^2+224*n-152)*_Z^4+(n^6+28*n^5+69*n^4-268*n^3+468*n^2-356*n+200)*_Z^3+(3*n^7+32*n^6+7*n^5-204*n^4+380*n^3-544*n^2+272*n-128)*_Z^2+(3*n^8+14*n^7-20*n^6-32*n^5+252*n^4-240*n^3+304*n^2-80*n+32)*_Z-n^9-12*n^8-44*n^7-40*n^6-4*n^5-128*n^4+48*n^3-64*n^2)

(1)

f:=eval(op(sol), _Z=z);

(8*n-8)*z^6+(n^4+36*n^2-68*n+56)*z^5+(n^5+10*n^4+80*n^3-200*n^2+224*n-152)*z^4+(n^6+28*n^5+69*n^4-268*n^3+468*n^2-356*n+200)*z^3+(3*n^7+32*n^6+7*n^5-204*n^4+380*n^3-544*n^2+272*n-128)*z^2+(3*n^8+14*n^7-20*n^6-32*n^5+252*n^4-240*n^3+304*n^2-80*n+32)*z-n^9-12*n^8-44*n^7-40*n^6-4*n^5-128*n^4+48*n^3-64*n^2

(2)

plots:-implicitplot(f=0, n=1..100, z=0..50, gridrefine = 3);

 

a:=algcurves:-puiseux(f,n=infinity,z,2):

alias(alpha=indets(a,RootOf)[]):
alpha=evalf(alpha);

alpha = .2587353940

(3)

Z:=collect(select(u->(limit(u,n=infinity)>0), a), n)[]; # the wanted asymptotic

alpha*n+(4/599)*alpha^4+(1137/1198)*alpha^3+(1203/599)*alpha^2+(1691/599)*alpha+355/1198+((12546379/2870408)*alpha^4+(19500071/2870408)*alpha^3-(2035499/1435204)*alpha^2-(11446491/2870408)*alpha+1446287/2870408)/n

(4)

plot(Z, n=1..100);

 

 

Download puiseux.mw

SymFun:=proc(f,x)
local s,a_,b_, g;
if is(simplify(diff(f,x))=0) then return 'ConstantFunction' fi;
s:=solve(identity(eval(f,x=a_+x)=eval(f,x=a_-x),x),[a_]);
if s<>[] then return 'VerticalSymmetry'=s[] fi;
s:=solve(identity(eval(f,x=a_-x)+eval(f,x=a_+x)=2*b_,x),[a_,b_]);
if s<>[] then return 'CentralSymmetry'=s[] fi;
# hack
g:=eval(f,x=a_+x)-eval(f,x=a_-x);
s:=solve(limit(g,x=infinity),[a_]);
if s<>[] and is(simplify(g,s[1])=0) then return 'VerticalSymmetry'=s[1] fi;
'NoSymmetry'
end:
SymFun(x^3+a*x^2+b*x+c,x);
     CentralSymmetry = [a_ = -(1/3)*a, b_ = (2/27)*a^3-(1/3)*a*b+c]
SymFun(-abs(2*k-7),k);
     VerticalSymmetry = [a_ = 7/2]
SymFun(1/a-1,a);
     CentralSymmetry = [a_ = 0, b_ = -1]
 

eliminate({s = sum(n/2^k, k=0..p), n/2^p=1}, p):
simplify(solve(%[2],s))[];

              s = -1+2*n

 

 

A point on the unit sphere is determined by the spherical coordinates (th, ph). You can choose any color for this point. E.g.

c := ph+th/16:  # color (HUE)
plot3d(1, th=0..2*Pi, ph=0..Pi, coords=spherical, color=c);

If your vector field is V(r,th,ph), you can take c := LinearAlgebra:-Norm(V(1,th,ph), 2, conjugate=false);

 

Digits:=15:
par:=[lambda1 = 0.733e-1,lambda2 = 5.3344,alpha = 4.8492]:
f := (Z^(lambda2/lambda1))^2*ln(Z)^2/((Z-1+alpha)^2*(Z^(lambda2/lambda1)-1+alpha)^3):
J:=IntegrationTools:-Change(Int(f,Z=1..infinity), Z=z^(lambda1/lambda2)) assuming positive:
evalf(eval(J,par));

           1.15034205858649*10^(-7)  

restart;

f:= x^8+x^7+x^5+x+1

x^8+x^7+x^5+x+1

(1)

n:=8; s:=10;

8

 

10

(2)

r:=rand(1..n^2): rLC:=rand(1..s):

LC:=Vector([seq(1..s)], datatype=integer[8]):

A:=Matrix(n,datatype=integer[8]): for i to s do A(LC[i]):=1 od:

st:=time[real]():
while LinearAlgebra:-Modular:-CharacteristicPolynomial(2,A,x)-f <> 0 do
k:=rLC();
do   m:=r();
until not(member(m,LC));
A(LC[k]):=0; A(m):=1; LC[k]:=m;
od:
time=time[real]()-st; A;

time = 45.756

 

Matrix(%id = 18446744074413263918)

(3)

add(A), LinearAlgebra:-Modular:-CharacteristicPolynomial(2,A,x);  #check

10, x^8+x^7+x^5+x+1

(4)

 

 

Download modular-cp.mw

Maple does not have a predicate logic package.

Sometimes we can use the assume facility  but only for very simple situations.
(For the existence quantifier probably only for a single variable!)
For other situations use solve, isolve, Logic package etc.

 

# Example:  Maple cannot prove Fermat theorem.

coulditbe(x^n + y^n = z^n) assuming x::posint, y::posint,z::posint,n::posint,n>2;  

FAIL

(1)

 

### Your problems

## 1 ##   cn2Z, 2*n > n+2   

is(2*n>n+2) assuming n::integer;

false

(2)

# compare:
is(2*n>=n+2) assuming (n/3) :: posint;

true

(3)

## 2 ##   dn2Z, 2 |( 3n+1)   

coulditbe( ((3*n+1)/2) :: integer)  assuming n::integer;

true

(4)

##  compare:

coulditbe( ((3*n+1)/2) :: integer)  assuming n::even;

false

(5)

## 3 ##   dk2Z,  cn2Z,  n=k*n
solve(n=n*k);
has([%], n=n);

{k = k, n = 0}, {k = 1, n = n}

 

true

(6)

 

restart:
A:= <x1,y1,z1>:
B:= <x2,y2,z2>:
P :=<x3, y3, z3>:
H:=A+t*(B-A):
solve( (P-H)^+ . (B-A), t ):
'H'=eval(H, t=% );

 

For multivariate polynomials there is no unique quotient and remainder. quo and rem work for univariate polynomials.

The "long division" must be defined in terms of a monomial order, see wiki-link

 

In Maple the computations can be done with the Groebner package.

 

Example.

 

A:=a*x^5*y^3+b*x*y+c*y^4+x+1;

a*x^5*y^3+c*y^4+b*x*y+x+1

(1)

B:=x^2+e*x*y^2+f*y^2+y+2;

e*x*y^2+f*y^2+x^2+y+2

(2)

r:=rem(A,B,x);  # A,B seen as univariate in variable x.

(a*e^4*y^11-3*a*e^2*f*y^9-3*a*e^2*y^8-6*a*e^2*y^7+a*f^2*y^7+2*a*f*y^6+4*a*f*y^5+a*y^5+4*a*y^4+4*a*y^3+b*y+1)*x+a*e^3*f*y^11+a*e^3*y^10+2*a*e^3*y^9-2*a*e*f^2*y^9-4*a*e*f*y^8-8*a*e*f*y^7-2*a*e*y^7-8*a*e*y^6-8*a*e*y^5+c*y^4+1

(3)

q:=quo(A,B,x);

a*y^3*x^3-a*e*y^5*x^2+(a*e^2*y^7-a*f*y^5-a*y^4-2*a*y^3)*x-a*e^3*y^9+2*a*e*f*y^7+2*a*e*y^6+4*a*e*y^5

(4)

normal( A - (B*q+r) );

0

(5)

######### Now, using Groebner.

r1:=Groebner:-NormalForm(A, [B], plex(x,y));  # lexicographic order

a*e^4*x*y^11-3*a*e^2*f*x*y^9-3*a*e^2*x*y^8+y^7*x*(-6*a*e^2+a*f^2)+2*a*f*x*y^6+y^5*x*(4*a*f+a)+4*a*y^4*x+4*a*y^3*x+b*x*y+x+a*e^3*f*y^11+a*e^3*y^10+y^9*(2*a*e^3-2*a*e*f^2)-4*a*e*f*y^8+y^7*(-8*a*e*f-2*a*e)-8*a*e*y^6-8*a*e*y^5+c*y^4+1

(6)

q1:=normal((A-r1)/B);

-(e^3*y^6-e^2*x*y^4-2*e*f*y^4+e*x^2*y^2-2*e*y^3+f*x*y^2-4*e*y^2-x^3+x*y+2*x)*a*y^3

(7)

normal( A - (B*q1+r1) );

0

(8)

r2:=Groebner:-NormalForm(A, [B], tdeg(x,y));   # tdeg order

-a*x^6*y/e+a*f*x^5*y/e^2+a*x^5/e^2+(-2*a*e^4-a*e^2*f^2)*x^4*y/e^5-2*a*f*x^4/e^3+(2*a*e^3*f+a*e*f^3+a*e^3)*x^3*y/e^5+(2*a*e^3+3*a*e*f^2)*x^3/e^5+(-2*a*e^2*f^2-a*f^4-2*a*e^2*f)*x^2*y/e^5+(-4*a*e^2*f-4*a*f^3)*x^2/e^5+(b*e^5+2*a*e*f^3+3*a*e*f^2)*x*y/e^5+(e^5+6*a*e*f^2)*x/e^5+c*y^4-a*f^5*y^3/e^5-5*a*f^4*y^2/e^5+(-2*a*f^4-4*a*f^3)*y/e^5+(e^5-8*a*f^3)/e^5

(9)

q2:=normal((A-r2)/B);

(e^4*x^4*y-e^3*f*x^3*y+e^2*f^2*x^2*y-e^3*x^3-e*f^3*x*y+2*e^2*f*x^2+f^4*y-3*e*f^2*x+4*f^3)*a/e^5

(10)

normal( A - (B*q2+r2) );

0

(11)

 

If you set Digits:=15 at the beginning of the worksheet (which is always a good idea), the integral will be finite (6.32 ...). Even TP(3, 10^(-5)) will be finite (7.59...).

Explanation. For Digits=10, if you replace in TP int with Int, you will see that TP(3, 10^(-4)) is
const * int(1/sqrt(1.0 - cos(theta)) ,  theta = 0 .. const).
So, the integral is divergent.
Here 1.0 appears due to roundoff errors; the exact value is strictly > 1. For a larger Digits ==>  1/sqrt(1+eps - cos(theta)) and the integral is convergent.

 

By default, verify checks syntactically the equality (without any simplification).
We can use:
verify(2*cos(phi)^2-1, cos(2*phi), simplify);
or
verify(2*cos(phi)^2-1, cos(2*phi), expand);
to obtain the desired result (true).

So, you actually want

asympt( (2 * Pi * n) ^ (1/(2*n)), n, 2);
           

(the fact that taylor also works instead of asympt is strange; it should not).

You are expecting O(ln(n)^2/n^2) instead of O(1/n^2).
This would be true in terms of the standard Landau notation  O(...).  But Maple uses a modified version where the sub-polynomial functions are ignored; e.g. in this Maple notation O(ln(n)) = O(1).

Note that MultiSeries:-asympt  uses the true Landau notation. So,

MultiSeries:-asympt( (2 * Pi * n) ^ (1/(2*n)), n, 2);
will produce the expected result.

You cannot do much about this. The automatic simplification in Maple transforms 5*(x+1)+y into 5*x+5+y.
There are some tricks (such as Kitonum's) but they work only temporarily (i.e. the next evaluation reverses the transform) or can be used only for display purposes (and not for computations). It is more convenient to accept it.

Q:=proc(k::list(nonnegint))
local P,i;
P := combinat:-cartprod([seq([seq(0..i)],i=k)]);
while not P[finished] do 
  print( add(i, i = P[nextvalue]()) ) 
end do;
end:

Q([2,3]);
                               0
                               1
                               2
                               3
                               1
                               2
                               3
                               4
                               2
                               3
                               4
                               5

In more recent versions it is better to use Iterator:-CartesianProduct

P:=proc(k::list(nonnegint))
local M,i,v;
M := Iterator:-CartesianProduct(seq([seq(0..i)],i=k);
for v in M do print(add(v[])) od
end;

 

First 57 58 59 60 61 62 63 Last Page 59 of 120