Mariusz Iwaniuk

1491 Reputation

14 Badges

8 years, 223 days

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by Mariusz Iwaniuk

From comment by user:vv 7062 

IntegrationTools:-Parts(int(arccos(x)*arcsin(x), x), arcsin(x));

#(x*arccos(x) - sqrt(-x^2 + 1))*arcsin(x) + 2*x + arccos(x)*sqrt(-x^2 + 1)

From Wikipedia see example:

See attached file:

Download integral.mw

 

I found the analytical solution of the double integral,difficult calculations to get solution I will not describe it here.

Numeric integration works ,but is very slow.

See attached file:

Download Maple_question_v1.mw

 

 

 

 

I found a workaround. See attached file.

DIFF_eq.mw


 

restart

with(NumberTheory)

n := 10^13; N := 346065536839

10000000000000

 

346065536839

(1)

evalf(trunc(add(Ei(ln(n)/j)*Moebius(j)/j, j = 1 .. 20)))-N

-5774.

(2)

evalf(trunc(add(Moebius(j)*Li(n^(1/j))/j, j = 1 .. 20)))-N

-5774.

(3)

evalf(trunc(-4*add((-1)^j*j*(ln(n)/(2*Pi))^(2*j-1)/((2*j-1)*bernoulli(2*j)), j = 1 .. 200)/Pi))-N

-5774.

(4)

evalf(trunc(1+add(ln(n)^j/(factorial(j)*j*Zeta(j+1)), j = 1 .. 300)))-N

-5774.

(5)

trunc(evalf(Li(n)))-N

108971

(6)

trunc(evalf(sqrt(exp(1)*n*Li(n/exp(1))/ln(n))))-N

452312

(7)

``


 

Download PrimePi_-approximation.mw

I have analitycal solution only with conditions:

[f3(0,t)=-exp(-2*t),f4(x,0)=exp(-3*x)*cos(2*Pi*x),f1(x,3)=0,f1(3,t)=0,f2(3,0)=0].

last condition You may change in the code from :f2(3,0)=0 to f2(0,3)=0

from eval(rhs(sol[2]), x = 3) = 0 to eval(rhs(sol[2]), t = 3) = 0 in SOL.

See attached file.

EQ_diff.mw

 

I don't have Maple 13.I used Maple 2019.2:

SOL := solve([13/4*m - 7/4*n - 3 = 0, -17/2*n*2^n + 34*m = 0]);

evalf(map(allvalues, {SOL}));

Gives:

{{m = -0.1262032999, n = -1.948663272}, {m = 2., n = 2.}, {m = 1.551915566 - 4.737602358*I, n = 1.167843193 - 8.798404378*I}, {m = 1.551915566 + 4.737602358*I, n = 1.167843193 + 8.798404378*I}}

 

I have no more adequate knowledge about multithreading in Maple,but my code seems to work. 

time give you total CPU time,I used  packages CodeTools to give You a REAL time computation.


 

kernelopts(version)

`Maple 2019.2, X86 64 WINDOWS, Oct 30 2019, Build ID 1430966`

(1)

restart

with(Threads); with(CodeTools)

p1 := proc (x) local i; Add(i, i = 1 .. 5000000) end proc; p2 := proc (x) local i; Add(i, i = 5000001 .. 1000000000) end proc; id1 := Create(p1(), out1); id2 := Create(p2(), out2); Usage(Wait(id1, id2)); out1+out2

memory used=2.51GiB, alloc change=19.69MiB, cpu time=2.76m, real time=20.24s, gc time=17.09s

 

500000000500000000

(2)

NULL

restart

with(CodeTools)

p1 := proc (x) local i; add(i, i = 1 .. 5000000) end proc; p2 := proc (x) local i; add(i, i = 5000001 .. 1000000000) end proc; Usage(p1()+p2())

memory used=2.51GiB, alloc change=30.00MiB, cpu time=65.97s, real time=64.78s, gc time=3.22s

 

500000000500000000

(3)

NULL

NULL


 

Download thread_time_AAA.mw

Using assumption and infinity not Infinity, works fine.

Integrals_Sheet2-A.mw

One way is using this package.

Extract file aene_v1_0.tar to any folder then open a file Sample.mws and copy my code to the file and execute.

eq:=diff(y(t),t$mu)=0.85*sqrt(y(t)^2)-0.85*y(t)^2:
IC:=[y(0)=0.5]:
Asolve([eq],IC,mu=1/2,t=0..1,y=0..1,false,index=10,output=plot,pade=[10,10]);

 

Or workaround:

restart;
T__ln := (1/2)*m__ws*v__l+(1/2)*I__ws*(diff(varphi__l(t), t))^2+((1/2*(m__zs+m__zp+m__wp))*v__l+(1/2*(I__zs+I__zp+I__wp))*(diff(varphi__l(t), t))^2)*z__11*eta/z__12+((1/2*(m__wk+m__zpk+m__k+m__zk))*v__l+(1/2*(I__wk+I__zpk+I__k+I__zk))*(diff(varphi__l(t), t))^2)*z__21*eta/z__22;
eval(diff(eval(T__ln, diff(varphi__l(t), t) = x), x), x = diff(varphi__l(t), t));

 

 

With package: MultiSeries Maple can:

N := 10;
(MultiSeries:-series(sin(x)^a, x = 0, N) assuming (0 < a));

#x^a - a*x^(2 + a)/6 + (-1/180*a + 1/72*a^2)*x^(4 + a) + (-1/2835*a + 1/1080*a^2 - 1/1296*a^3)*x^(6 + a) + (-1/37800*a + 101/1360800*a^2 - 1/12960*a^3 + 1/31104*a^4)*x^(8 + a) + O(x^(10 + a))

Another simpler way to compute this integral:


 

NULL

restart

Int(exp(-I*x*y)*exp(x)/cosh(x)^2, x = -infinity .. infinity)

Int(exp(-I*x*y)*exp(x)/cosh(x)^2, x = -infinity .. infinity)

(1)

with(IntegrationTools)

Change(Int(exp(-I*x*y)*exp(x)/cosh(x)^2, x = -infinity .. infinity), x = ln(z))

Int(4*z^(-I*y+2)/(z^2+1)^2, z = 0 .. infinity)

(2)

value(Int(4*z^(-I*y+2)/(z^2+1)^2, z = 0 .. infinity))

-Pi*(I*y-1)*sech((1/2)*Pi*y)

(3)

int(eval(exp(-I*x*y)*exp(x)/cosh(x)^2, y = 1), x = -infinity .. infinity, numeric)

1.252040331-1.252040331*I

(4)

evalf(eval(-Pi*(I*y-1)*sech((1/2)*Pi*y), y = 1))

1.252040331-1.252040331*I

(5)

``


 

Download Compute_integral.mw

A good question why inttrans does not work in this case? I don't know.

A trick: 

inttrans:-fourier(- diff(erf(x), x)*I/k, x, k);

# -2*I*exp(-k^2/4)/k # A correct answer.

int(erf(x)*exp(-I*x*k),x=-infinity..infinity);

# -2*I*exp(-k^2/4)/k !

evalf[10](Int(exp(-x)*sin(x^2/2)/(3 + x), x = 1 .. infinity));

#0.04279639331

Or:

Digits := 10:

int(exp(-x)*sin(x^2/2)/(3 + x), x = 1 .. infinity, numeric);

#0.04279639331

Execute: ?Digits ,to see more information.

4 5 6 7 8 9 10 Last Page 6 of 19