sursumCorda

922 Reputation

13 Badges

2 years, 206 days

MaplePrimes Activity


These are questions asked by sursumCorda

Some work, while others don't work. 
 

restart;

`assuming`([is(1/(sqrt(n*(n+1))*(sqrt(n)+sqrt(n+1))) = 1/sqrt(n)-1/sqrt(n+1))], [n::posint])

true

(1)

sum(1/sqrt(n)-1/sqrt(n+1), n = 1 .. infinity)

1

(2)

sum(1/(sqrt(n*(n+1))*(sqrt(n)+sqrt(n+1))), n = 1 .. infinity)

sum(1/((n*(n+1))^(1/2)*(n^(1/2)+(n+1)^(1/2))), n = 1 .. infinity)

(3)

`assuming`([sum(binomial(3*n, n)*x^n/(2*n+1), n = 0 .. infinity)], [abs(x) <= 4/27])

(2/3)*3^(1/2)*sin((1/3)*arcsin((3/2)*3^(1/2)*x^(1/2)))/x^(1/2)

(4)

`assuming`([eval(binomial(3*n, n)*x^n/(2*n+1), n = 0)+sum(binomial(3*n, n)*x^n/(2*n+1), n = 1 .. infinity, parametric)], [abs(x) <= 4/27])

1+x*hypergeom([1, 4/3, 5/3], [2, 5/2], (27/4)*x)

(5)

simplify(convert(1+x*hypergeom([1, 4/3, 5/3], [2, 5/2], (27/4)*x)-hypergeom([1/3, 2/3], [3/2], (27/4)*x), elementary), symbolic)

(1/3)*(3*x^(1/2)+3*x^(3/2)*hypergeom([1, 4/3, 5/3], [2, 5/2], (27/4)*x)-2*3^(1/2)*sin((1/3)*arcsin((3/2)*3^(1/2)*x^(1/2))))/x^(1/2)

(6)

plot((1/3)*(3*x^(1/2)+3*x^(3/2)*hypergeom([1, 4/3, 5/3], [2, 5/2], (27/4)*x)-2*3^(1/2)*sin((1/3)*arcsin((3/2)*3^(1/2)*x^(1/2))))/x^(1/2), x = -4/27 .. 4/27)

 

verify(0, (1/3)*(3*x^(1/2)+3*x^(3/2)*hypergeom([1, 4/3, 5/3], [2, 5/2], (27/4)*x)-2*3^(1/2)*sin((1/3)*arcsin((3/2)*3^(1/2)*x^(1/2))))/x^(1/2), 'equal')

FAIL

(7)

NULL


 

Download unable_to_sum.mw

How to explain this behavior?
I have read the help page, but I can not get the point.

Here is a symmetric matrix with three real parameters (`k__1`, `k__2`, and `k__3`).

mm:=<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\
,0,0,0,0,0,0,0,0,0|0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0|0,0,1,0,0,0,0,0,0,0,0,0,0\
,k__3-1/2,0,k__3-1/2,0,0,0,0,0,0,0,0,-1/2,0,1-2*k__3,0,-1/\
2,0,0,0,0,0,0,0|0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0|0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0|0,0,0,0,0,1,0,\
k__3,0,-1/2,0,0,0,0,0,0,0,0,0,k__3,0,-2*k__3,0,0,0,0,0,0,0\
,0,-1/2,0,0,0,0,0|0,0,0,0,0,0,-2*k__3,0,k__3-1,0,-1/2,0,0,\
0,0,0,0,0,0,0,k__3,0,1-2*k__3,0,0,0,0,0,0,0,0,k__1,0,0,0,0\
|0,0,0,0,0,k__3,0,1-4*k__3,0,k__3-1,0,0,0,0,0,0,0,0,0,(1-k\
__2)/2,0,k__3-1/2,0,0,0,0,0,0,0,0,1-2*k__3,0,0,0,0,0|0,0,0\
,0,0,0,k__3-1,0,1-4*k__3,0,k__3,0,0,0,0,0,0,0,0,0,k__3-1/2\
,0,(1-k__2)/2,0,0,0,0,0,0,0,0,1-2*k__3,0,0,0,0|0,0,0,0,0,-\
1/2,0,k__3-1,0,-2*k__3,0,0,0,0,0,0,0,0,0,1-2*k__3,0,k__3,0\
,0,0,0,0,0,0,0,k__1,0,0,0,0,0|0,0,0,0,0,0,-1/2,0,k__3,0,1,\
0,0,0,0,0,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0,-1/2,0,0\
,0,0,0,0,0,0,0,k__3,0,k__3-1,0,0,0,0,0,0,0,0,-2*k__3,0,0,0\
,0|0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\
,0,0,0,0,0,0,0,0|0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0|0,0,0,0,0,0,0,0,0,0,0,0,-1/\
2,0,-2*k__3,0,-1/2,0,0,0,0,0,0,0,0,k__3,0,k__3,0,0,0,0,0,0\
,1,0|0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>#assuming'real':
cc:={evalindets}(LinearAlgebra:-IsDefinite(mm,query='positive_semidefinite'),`and`,op):

As the title says, I hope to find some values satisfying andseq('cc') (so `mm` becomes positive semidefinite). Unfortunately, these don't work: 

# SMTLIB:-Satisfy(cc);
Optimization:-Maximize(0, cc, initialpoint = eval({k__ || (1 .. 3)} =~ 'rand(-2e1 .. 2e1)'()));
Error, (in Optimization:-NLPSolve) no feasible point found for the nonlinear constraints
timelimit(1e2, RealDomain:-solve(cc, [k__ || (1 .. 3)](*, 'maxsols' = 1*)));
Error, (in RegularChains:-SemiAlgebraicSetTools:-CylindricalAlgebraicDecompose) time expired

 Is there a way to do so as accurately (and precisely) as possible?

 

According to print - Maple Help (maplesoft.com),

calling print[N] instead of print where N is an integer between -2 and +3, temporarily overrides the prettyprint interface variable.

However, I find that 

print[-2]();
Error, prettyprint must be an integer in the range 0..3
print[-1]();
Error, prettyprint must be an integer in the range 0..3

Also, 

interface(prettyprint = -2);
Error, (in interface) prettyprint must be an integer in the range 0..3
interface(prettyprint = -1);
Error, (in interface) prettyprint must be an integer in the range 0..3

Did I miss something?

I'd like to reproduce Initial Value DDE of Neutral Type in Maple.
The differential equation is: 

deq := D(y)(t) = 2*cos(2*t)*y(t/2)^(2*cos(t)) + ln(D(y)(t/2)) - ln(2*cos(t)) - sin(t): # with y(0) = 1 and known D(y)(0)

Unfortunately, if I type valid initial values, Maple will simply generate , and yet if I just give a partial initial condition, Maple will display and only return incorrect results. 
 

restart;

interface(version)

`Standard Worksheet Interface, Maple 2023.1, Windows 10, July 7 2023 Build ID 1723669`

(1)

deq := (D(y))(t) = 2*cos(2*t)*y((1/2)*t)^(2*cos(t))+ln((D(y))((1/2)*t))-ln(2*cos(t))-sin(t)

RealDomain:-solve(subs(t = 0, y(0) = 1, deq), (D(y))(0))

2, -LambertW(-2*exp(-2))

(2)

dsolve({deq, y(0) = 1, (D(y))(0) = (2, -LambertW(-2*exp(-2)))[1]}, 'numeric', 'delaymax' = Pi, 'range' = 0 .. 2*Pi)

Error, (in dsolve/numeric/DAE/initial) too many initial conditions, the following are not needed: {D(y)(0) = 2}

 

dsolve({deq, y(0) = 1, (D(y))(0) = (2, -LambertW(-2*exp(-2)))[2]}, 'numeric', 'delaymax' = Pi, 'range' = 0 .. 2*Pi)

Error, (in dsolve/numeric/DAE/initial) too many initial conditions, the following are not needed: {D(y)(0) = -LambertW(-2*exp(-2))}

 

dsn := dsolve({deq, y(0) = 1}, 'type' = 'numeric', 'delaymax' = Pi, 'range' = 0 .. 2*Pi)

plots['odeplot'](dsn, 0 .. 2*Pi)NULL

Warning, cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up

 

`[Length of output exceeds limit of 1000000]`

 

Warning, cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up

 

 


 

Download ndelay.mw

The output is wrong. Note that "y(0) = 1" is insufficient to uniquely specify a solution, as "D(y)(0)" can be either -LambertW(-2/exp(2)) or 2. But Maple does not allow sufficient constraints here. How do I avoid such an unexpected behavior?

Here is a test: 

For small matrices, apart from the first call, the performance is almost perfect (🎉!). 
As a comparison, an equivalent test may be performed in modern Python:

As you can see, for 1024×1024, 2048×2048, 4096×4096, 8192×8192, and 16384×16384 matrices, Maple's performance gets pretty poor. Is the FFT procedure not well optimized for larger matrices? I do have read the Fourier Transforms in Maple, yet I cannot find any information on this subject. 
In accordance with the following output 

showstat(DiscreteTransforms::FFT_complex8, 3):

FFT_complex8 := proc()
       ...
   3   :-DiscreteTransforms:-FFT_complex8 := LinkExternal('hw_FFT',2003);
       ...
end proc

it appears that the code hasn't been developed for 20 years. Is it possible to improve the performance of the FFT built into Maple in order that the computation on such a 2¹⁴×2¹⁴ matrix can be achieved in about twenty seconds (rather than in two minutes)?

Note. For these matrices, exact transform results (see below) can be obtained symbolically.

for n from 0 to 12 do
    m := LinearAlgebra:-HankelMatrix(<$ (1 + 1 .. 2**n + 2**n)>, datatype = complex[8], shape = []): gc();
    print(n, andseq(abs(_) < HFloat(1, -10, 2), _ in SignalProcessing:-FFT(m, normalization = none, inplace = true) - Matrix(2^n, <2^(2*n)*(2^n + 1), <'2^(2*n - 1)*(:-cot((k - 1)/2^n*Pi)*I - 1)' $ 'k' = 1 + 1 .. 2^n>>, shape = symmetric, storage = sparse, datatype = complex[8])) (* faster than `rtable_scanblock` and `ArrayTools:-IsZero` and much faster (🎊!) than `comparray` and `verify/Matrix` with testfloat *) )
od:
 = 
                            0, true

                            1, true

                            2, true

                            3, true

                            4, true

                            5, true

                            6, true

                            7, true

                            8, true

                            9, true

                            10, true

                            11, true

                            12, true

However, the main goal is to test the numerical efficiency of Maple's fast Fourier transform algorithm.

First 6 7 8 9 10 11 12 Last Page 8 of 19