Axel Vogt

5906 Reputation

20 Badges

19 years, 305 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are answers submitted by Axel Vogt

Can one not handle this by providing an (initialized) array and handle it in the code? May be that is oldish.

I think it is 2.695678478*hypergeom([1., 1., 1.645396648],[2., 2.],-1.549434760*exp(-677.0138340*t))*exp(-677.0138340*t)+.95671881+1887.991395*t

find MP_231348.mws attached

 

Added 03. Jan 2021:

Changing coordinates by 1+57154/36887*exp(-342569/506*t)=s instead of 1+57154/36887*exp(-342569/506*t)=1+s gives the solution involving LerchPhi (instead of the more complicated 3F2 hypergeom) or likewise a 2F1, which is valid as well:

SolNum := -.4073509876e-1+62.97977396*t+4.176777934/(exp(677.0138340*t)+1.549434760)^.6453966478*exp(436.9424590*t)*(1.-1.*Re(hypergeom([-.6453966478, 1.],[.3546033522],1.+1.549434760*exp(-677.0138340*t))))

NB: Using Re = real part avoids spurious numerical imaginaries for LerchPhi.

 

Correction 03. Jan 2021

I made an error through copy + paste and took 62.97... instead of 862.97... for the constant.

So 800*t has to be added to both the posted anti-derivatives

@mmcdara 

If you say "expand" then it is written as polynomial and it should work

Plot it, "see" there is no solution and ask yourself whether you ask the correct question

-Pi/2 - arctan(25*x) - Pi +2*Pi/3; plot(%,x, -2*Pi .. 2*Pi);

 


 

 

That does not converge I think:

If you look at your E2 (in your sheet, but without feeding z) it is ~ e0 + rational in exp(z), exp(-z), then squared. For z ---> +- infinity that fraction tends to some constant*exp(-+z), but e0 survives. Thus the integral over the real line can not be finite. Now your z is just a linear function of your actual integration variable t. But a linear transform only changes the magnitude.

Likewise you may use MultiSeries:-asympt for your integrand to find similar reasoning.

Just use convert(left, Int), dito for the other term

Not sure if that helps for your situation - but I (always) use a pdf-printer, it works for any application (except for some odd web pages). For the example given by tomleslie for Maple 2020 the result is also complete and of size ~ 350 KB only for somewhat dated "pdfcreator"

Your AAA is linear in y, hence the integral is also linear in y.

The following works in Maple 18 (and should work in Maple 2015 as well)


 

# https://www.mapleprimes.com/questions/230226-Evaluation-Of-Double-Integral

restart; interface(version); Digits:=15;

`Standard Worksheet Interface, Maple 18.02, Windows 7, October 20 2014 Build ID 991181`

 

15

(1)

L := 1;
AAA := 3.888022*10^(-42)*p*q-4.75389*10^(-42)*y*p*q+7.4699*10^(-43)*y*p*q^2+9.1169*10^(-43)*y*p^2*q:
evalf[7](%): collect(%, y): # more easy to read and you have only 7 decimals as input
A:=%;

1

 

(-0.4753890e-41*p*q+0.7469900e-42*p*q^2+0.9116900e-42*p^2*q)*y+0.3888022e-41*p*q

(2)

A0:=remove(has, A, y);
A1:= (A - A0)/y;

'A=A0 + A1*y'; is(%);

0.3888022e-41*p*q

 

-0.4753890e-41*p*q+0.7469900e-42*p*q^2+0.9116900e-42*p^2*q

 

A = A1*y+A0

 

true

(3)

'Int(q*A0/sqrt(p^2 + q^2 + 1), [p = 0 .. L, q = 0 .. L])' +
y*'Int(q*A1/sqrt(p^2 + q^2 + 1), [p = 0 .. L, q = 0 .. L])';
evalf(%);

Int(q*A0/sqrt(p^2+q^2+1), [p = 0 .. L, q = 0 .. L])+y*(Int(q*A1/sqrt(p^2+q^2+1), [p = 0 .. L, q = 0 .. L]))

 

0.453450449270490e-42-0.421144446461726e-42*y

(4)

 


 

Download MP_230226.mw

If you integrate rationalize(expr) it works fine, seems not restricted to Reals

I guess that this may be caused by a = +-1 and Maple does not handle that *removable* singularity (limit is quite simple).

You may try

MultiSeries:-series(1/z^4/(1-z), z=0, 2);

                           -4    -3      -2
                          z   + z   + O(z  )

 

For example:

L:=[1,2,3,4,5]:
convert(L, `+`);
                                  15

But you should try to understand / learn Maple's syntax and notations, studying your lectures (or the book).

 

Product(lambda(i)-lambda(k), k=1 .. i-1)*Product(lambda(i)-lambda(k), k=i+1 .. n)

and no extra tweak if i < 1 or n < i

That is a problem of linear algebra (no polynomial division is need): both sets are a base for a linear vectorspace (polynomials of degree <= d) and you have to invert the matrix for base change.

For your case it can be done directly

myP:=x^5+x^4+2*x^2;

OrthogonalSeries:-ChangeBasis(myP,LegendreP(v, x)):
OrthogonalSeries:-ConvertToSum(%):
convert(%,polynom):
'myP'=%;
is(simplify(%));

        13   3 x   40
  myP = -- + --- + -- LegendreP(2, x) + 4/9 LegendreP(3, x)
        15    7    21

         + 8/35 LegendreP(4, x) + 8/63 LegendreP(5, x)


                                 true

For Gegenbauer you can use a tweak (find it in the attached sheet).

convert_OrthoPoly_229641.mws

 

I look at it as rolling dices with d sides, for d = 2^4 = 16 (and 100/4 = 25 rolls) the Chi^2 test rejects uniformity for B.


 

# https://www.mapleprimes.com/questions/229612-A-Probability-Riddle

restart:
with(Statistics):

A:=[0,1,0,1,0,1,1,0,1,1,1,0,0,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,1,1,1,1,0,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,0,0,1,1,1,1,0,0,0,1,0,1,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,1,0,0,0,1,1,0,1,0]:
B:=[0,1,1,0,1,1,0,1,1,1,0,1,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,0,1,0,1,1,0,1,1,0,0,0,0,0,0,1,0,1,1,1,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,1,0,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,0,0,1,0]:

'nops(A)': '%'= ifactor(%);

nops(A) = ``(2)^2*``(5)^2

(1)

# group as 4 bits and convert them to decimals 0 ... 15
# this gives 25 dice rolls, 2^4 = 16 sided, which should be uniform

bin2dec:=q -> add(q[4-k]*2^k, k= 0 .. 3);  
#bin2dec:=q -> add(q[nops(q)-k]*2^k, k= 0 .. nops(q)-1);

[ListTools:-LengthSplit( A, 4 )]:
a:=map(bin2dec, %);

[ListTools:-LengthSplit( B, 4 )]:
b:=map(bin2dec, %);

proc (q) local k; options operator, arrow; add(q[4-k]*2^k, k = 0 .. 3) end proc

 

[5, 6, 14, 7, 10, 10, 11, 5, 1, 5, 7, 12, 10, 10, 14, 10, 3, 12, 5, 0, 7, 5, 5, 1, 10]

 

[6, 13, 13, 3, 0, 15, 0, 0, 1, 13, 1, 5, 11, 0, 2, 14, 2, 8, 4, 2, 15, 12, 7, 15, 2]

(2)

# visualize
#Histogram(a, discrete = true, thickness=10):
#Histogram(map(q -> q+0.15, b), discrete = true, thickness=10, color=grey):
#plots[display](%,%%, title="a = blue, b = grey");

ChiSquareSuitableModelTest(a, DiscreteUniform(0,15), output='hypothesis');
ChiSquareSuitableModelTest(b, DiscreteUniform(0,15), output='hypothesis');

true

 

false

(3)

# detailed report
ChiSquareSuitableModelTest(b, DiscreteUniform(0,15), summarize=true):

Chi-Square Test for Suitable Probability Model

 

----------------------------------------------

 

Null Hypothesis:
Sample was drawn from specified probability distribution

 

Alt. Hypothesis:
Sample was not drawn from specified probability distribution

 

 

 

Bins:                    5

 

Degrees of Freedom:      4

 

Distribution:            ChiSquare(4)

 

Computed Statistic:      10.6266666666667

 

Computed p-value:        .0310962037164312

 

Critical Values:         9.48772903678116

 

 

 

Result: [Rejected]
This statistical test provides evidence that the null hypothesis is false.

 

 


 

Download MP_229612.mw

For example you can convert it to a name:

"6T1": convert(%, name);
                                 6T1

 

5 6 7 8 9 10 11 Last Page 7 of 93