Mariusz Iwaniuk

1094 Reputation

14 Badges

5 years, 147 days

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by Mariusz Iwaniuk


 

kernelopts("version")

`Maple 2020.0, X86 64 WINDOWS, Mar 4 2020, Build ID 1455132`

(1)

eq1 := diff(c(x, t), t)-3*(diff(c(x, t), x, x))*(1/2)+1/(20*(x+1/1000)) = 0

diff(c(x, t), t)-(3/2)*(diff(diff(c(x, t), x), x))+1/(20*x+1/50) = 0

(2)

ics := c(x, 0) = 0, c(0, t) = 10, (D[1](c))(20, t) = 0

c(x, 0) = 0, c(0, t) = 10, (D[1](c))(20, t) = 0

(3)

sol := pdsolve([eq1, ics])

c(x, t) = Sum(-(1/300000)*exp(-(3/3200)*Pi^2*(1+2*n)^2*t)*sin((1/40)*(1+2*n)*Pi*x)*(Int(-1000*sin((1/40)*(1+2*n)*Pi*x)*((-x-1/1000)*ln(1000*x+1)+x*ln(3)+x*ln(59)+x*ln(113)+x-300), x = 0 .. 20)), n = 0 .. infinity)+(1/30000)*ln(1000*x+1)*(1000*x+1)-(1/30)*x+10-(1/30)*ln(20001)*x

(4)

SOL := value(eval(op(1, rhs(c(x, t) = Sum(-(1/300000)*exp(-(3/3200)*Pi^2*(1+2*n)^2*t)*sin((1/40)*(1+2*n)*Pi*x)*(Int(-1000*sin((1/40)*(1+2*n)*Pi*x)*((-x-1/1000)*ln(1000*x+1)+x*ln(3)+x*ln(59)+x*ln(113)+x-300), x = 0 .. 20)), n = 0 .. infinity)+(1/30000)*ln(1000*x+1)*(1000*x+1)-(1/30)*x+10-(1/30)*ln(20001)*x)), infinity = 50))

plot3d(SOL, x = 0 .. 20, t = 0 .. 100, labels = [x, t, c])

 

``


 

Download solution.mw

 

Select for Palletes -> Common Symbols -> imaginaryunit:  I (uppercase), or (lowercase).


 

Example 2: Multiplying Complex Numbers

 

``

(2-I)*(4+3*I)

(3+2*I)*(3-2*I)

(4*I)*(-1+5*I)

(3+2*I)^2

11+2*I

 

13

 

-20-4*I

 

5+12*I

(1.1)

-1

(1)

(2-I)*(4+3*I)

11+2*I

(2)

(3+2*I)*(3-2*I)

13

(3)

(4*I)*(-1+5*I)

-20-4*I

(4)

(3+2*I)^2

5+12*I

(5)

``


 

Download Multiplying_Complex_num_ver2.mw

I think that your integral  does not have finite closed-form expression in terms of very large class of special functions.

 Most integrals don't have one. I have only approximation by infinite Sum.


 

Int(x*sqrt(x^2-1)*exp(-x), x = 1 .. y) = BesselK(2, 1)+(1/2)*sqrt(Pi)*(Sum((-1)^(1+m)*GAMMA(3-2*m, y)/(GAMMA(3/2-m)*GAMMA(1+m)), m = 0 .. infinity))

Int(x*(x^2-1)^(1/2)*exp(-x), x = 1 .. y) = BesselK(2, 1)+(1/2)*Pi^(1/2)*(Sum((-1)^(1+m)*GAMMA(3-2*m, y)/(GAMMA(3/2-m)*GAMMA(1+m)), m = 0 .. infinity))

(1)

evalf(eval(lhs(Int(x*(x^2-1)^(1/2)*exp(-x), x = 1 .. y) = BesselK(2, 1)+(1/2)*Pi^(1/2)*(Sum((-1)^(1+m)*GAMMA(3-2*m, y)/(GAMMA(3/2-m)*GAMMA(1+m)), m = 0 .. infinity))), y = 3))

.8038144469

(2)

evalf(eval(rhs(Int(x*(x^2-1)^(1/2)*exp(-x), x = 1 .. y) = BesselK(2, 1)+(1/2)*Pi^(1/2)*(Sum((-1)^(1+m)*GAMMA(3-2*m, y)/(GAMMA(3/2-m)*GAMMA(1+m)), m = 0 .. infinity))), y = 3))

.8038144470

(3)

f := proc (y) options operator, arrow; evalf(Int(x*sqrt(x^2-1)*exp(-x), x = 1 .. y)) end proc

proc (y) options operator, arrow; evalf(Int(x*sqrt(x^2-1)*exp(-x), x = 1 .. y)) end proc

(4)

g := proc (y, N) options operator, arrow; BesselK(2, 1)+(1/2)*sqrt(Pi)*add((-1)^(1+m)*GAMMA(3-2*m, y)/(GAMMA(3/2-m)*GAMMA(1+m)), m = 0 .. N) end proc

proc (y, N) local m; options operator, arrow; BesselK(2, 1)+(1/2)*sqrt(Pi)*add((-1)^(m+1)*GAMMA(3-2*m, y)/(GAMMA(3/2-m)*GAMMA(m+1)), m = 0 .. N) end proc

(5)

plot([f(y), g(y, 10)], y = 1 .. 8, linestyle = [dash, dot], color = ["Red", "Black"], thickness = 3)

 

``


 

Download integral.mw

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))

1 2 3 4 5 6 7 Last Page 2 of 16