vv

13977 Reputation

20 Badges

10 years, 37 days

MaplePrimes Activity


These are answers submitted by vv

I posted an answer to your deleted question.
I think that the moderator who deleted it was wrong because:
1. It was answered.
2. The content was distinct from the previous question. Not to mention that the old thread is difficult to follow (and loads slowly) being very long.

So, here is the answer again.

restart;

Digits:=15;

15

(1)

F[1, 1] := (r, theta) -> A[1, 1] + A[1, 2]*cos(theta) + A[2, 1]*(2*r - 1) + A[2, 2]*(2*r - 1)*cos(theta);
L[1, 1] := (r, theta, phi) -> ((2.803059644*10^12*cos(theta)^2*r^2 + 7.474825716*10^11*r^3*cos(theta)^3 + 7.474825716*10^10*r^4*cos(theta)^4 + 4.671766072*10^12*r*cos(theta) + 2.919853795*10^12)*diff(F[1, 1](r, theta), theta, theta) + (1.584823993*10^13*cos(theta)*r^3 + 9.508943959*10^12*cos(theta)^2*r^4 + 2.535718389*10^12*r^5*cos(theta)^3 + 2.535718389*10^11*r^6*cos(theta)^4 + 9.905149957*10^12*r^2)*diff(F[1, 1](r, theta), r, r) + (1.981029991*10^13*r^2*cos(theta) + 1.426341594*10^13*r^3*cos(theta)^2 + 4.437507181*10^12*r^4*cos(theta)^3 + 5.071436778*10^11*r^5*cos(theta)^4 + 9.905149957*10^12*r)*diff(F[1, 1](r, theta), r) + ((-1)*1.167941518*10^12*sin(theta)*r + (-1)*5.606119287*10^11*sin(theta)*r^3*cos(theta)^2 + (-1)*7.474825716*10^10*sin(theta)*r^4*cos(theta)^3 + (-1)*1.401529822*10^12*sin(theta)*r^2*cos(theta))*diff(F[1, 1](r, theta), theta) + ((-1)*5.071436778*10^11*r^4*cos(theta)^4 + (-1)*3.803577584*10^12*r^3*cos(theta)^3 + ((-1)*1.109376795*10^13*r^2 + (-1)*7.474825716*10^10*r^4)*cos(theta)^2 + ((-1)*1.584823993*10^13*r + (-1)*3.737412858*10^11*r^3)*cos(theta) + (-1)*9.905149957*10^12 + (-1)*4.671766072*10^11*r^2)*F[1, 1](r, theta))/((39.0625 + 62.5*r*cos(theta) + 37.5*cos(theta)^2*r^2 + 10.*r^3*cos(theta)^3 + r^4*cos(theta)^4)*r^2):

proc (r, theta) options operator, arrow; A[1, 1]+A[1, 2]*cos(theta)+A[2, 1]*(2*r-1)+A[2, 2]*(2*r-1)*cos(theta) end proc

(2)

for p to 1 do  for s to 1  do
f := L[p, s](r, theta, phi)*F[p, 1](r, theta):
Aij:=[indets(F[p,s](r,theta),indexed)[]];
g1:=expand(f, Aij, distributed);
g2:=coeffs(g1, Aij, 'T'):
C:=int~([g2], theta = 0 .. 2*Pi, r = 0.5 .. 1, epsilon=1e-8, numeric):
kk:=add(C .~ T);
kkk := evalf( int(F[p, 1](r, theta)^2, theta = 0 .. 2*Pi, r = 0.5 .. 1) );
k[p, s] := kk/kkk;
print([p, s] = %);
od od;

[1, 1] = (-1716301349235.42*A[1, 1]^2+745939588799.615*A[1, 1]*A[2, 1]+513374393378.777*A[2, 1]^2+161631455946.711*A[1, 1]*A[1, 2]+427274927473.220*A[2, 1]*A[1, 2]+135421805163.233*A[2, 2]*A[1, 2]+427274927473.220*A[1, 1]*A[2, 2]+406304482715.359*A[2, 1]*A[2, 2]-1120768744270.57*A[1, 2]^2+178063137194.727*A[2, 2]^2)/(1.04719755119660*A[2, 1]^2+.523598775598299*A[2, 2]^2+3.14159265358979*A[1, 1]*A[2, 1]+1.57079632679490*A[2, 2]*A[1, 2]+3.14159265358979*A[1, 1]^2+1.57079632679490*A[1, 2]^2)

(3)
f:=exp(-(sqrt(4*x^2+4*y^2+4*z^2)^3));
F:=eval(f, [x=r*sin(v)*cos(u), y=r*sin(v)*sin(u), z=r*cos(v)]);
int(F*r^2*sin(v), r=0..2, u=0..2*Pi, v=0..Pi);
evalf(%);

4*(1/24 - exp(-64)/24)*Pi

0.5235987756

To obtain a numerical answer you must change the variables to integrate in a cube.
Of course the spherical one is the best here because the new integrand is continuous.
Or, use piecewise:

JJ:=Int(exp(-(sqrt(4*x^2+4*y^2+4*z^2)^3))*piecewise(x^2+y^2+z^2<4,1,0), x=-2..2,y=-2..2,z=-2..2):
evalf(JJ);

0.5235987756

restart;

Digits:=15;

15

(1)

F[1, 1] := (r, theta) -> A[1, 1] + A[1, 2]*cos(theta) + A[2, 1]*(2*r - 1) + A[2, 2]*(2*r - 1)*cos(theta);
L[1, 1] := (r, theta, phi) -> ((2.803059644*10^12*cos(theta)^2*r^2 + 7.474825716*10^11*r^3*cos(theta)^3 + 7.474825716*10^10*r^4*cos(theta)^4 + 4.671766072*10^12*r*cos(theta) + 2.919853795*10^12)*diff(F[1, 1](r, theta), theta, theta) + (1.584823993*10^13*cos(theta)*r^3 + 9.508943959*10^12*cos(theta)^2*r^4 + 2.535718389*10^12*r^5*cos(theta)^3 + 2.535718389*10^11*r^6*cos(theta)^4 + 9.905149957*10^12*r^2)*diff(F[1, 1](r, theta), r, r) + (1.981029991*10^13*r^2*cos(theta) + 1.426341594*10^13*r^3*cos(theta)^2 + 4.437507181*10^12*r^4*cos(theta)^3 + 5.071436778*10^11*r^5*cos(theta)^4 + 9.905149957*10^12*r)*diff(F[1, 1](r, theta), r) + ((-1)*1.167941518*10^12*sin(theta)*r + (-1)*5.606119287*10^11*sin(theta)*r^3*cos(theta)^2 + (-1)*7.474825716*10^10*sin(theta)*r^4*cos(theta)^3 + (-1)*1.401529822*10^12*sin(theta)*r^2*cos(theta))*diff(F[1, 1](r, theta), theta) + ((-1)*5.071436778*10^11*r^4*cos(theta)^4 + (-1)*3.803577584*10^12*r^3*cos(theta)^3 + ((-1)*1.109376795*10^13*r^2 + (-1)*7.474825716*10^10*r^4)*cos(theta)^2 + ((-1)*1.584823993*10^13*r + (-1)*3.737412858*10^11*r^3)*cos(theta) + (-1)*9.905149957*10^12 + (-1)*4.671766072*10^11*r^2)*F[1, 1](r, theta))/((39.0625 + 62.5*r*cos(theta) + 37.5*cos(theta)^2*r^2 + 10.*r^3*cos(theta)^3 + r^4*cos(theta)^4)*r^2):

proc (r, theta) options operator, arrow; A[1, 1]+A[1, 2]*cos(theta)+A[2, 1]*(2*r-1)+A[2, 2]*(2*r-1)*cos(theta) end proc

(2)

for p to 1 do  for s to 1  do
f := L[p, s](r, theta, phi)*F[p, 1](r, theta):
Aij:=[indets(F[p,s](r,theta),indexed)[]];
g1:=expand(f, Aij, distributed);
g2:=coeffs(g1, Aij, 'T'):
C:=int~([g2], theta = 0 .. 2*Pi, r = 0.5 .. 1, epsilon=1e-8, numeric):
kk:=add(C .~ T);
kkk := evalf( int(F[p, 1](r, theta)^2, theta = 0 .. 2*Pi, r = 0.5 .. 1) );
k[p, s] := kk/kkk;
print([p, s] = %);
od od;

[1, 1] = (-1716301349235.42*A[1, 1]^2+745939588799.615*A[1, 1]*A[2, 1]+513374393378.777*A[2, 1]^2+161631455946.711*A[1, 1]*A[1, 2]+427274927473.220*A[2, 1]*A[1, 2]+135421805163.233*A[2, 2]*A[1, 2]+427274927473.220*A[1, 1]*A[2, 2]+406304482715.359*A[2, 1]*A[2, 2]-1120768744270.57*A[1, 2]^2+178063137194.727*A[2, 2]^2)/(1.04719755119660*A[2, 1]^2+.523598775598299*A[2, 2]^2+3.14159265358979*A[1, 1]*A[2, 1]+1.57079632679490*A[2, 2]*A[1, 2]+3.14159265358979*A[1, 1]^2+1.57079632679490*A[1, 2]^2)

(3)

For a solution given implicitely, as in this case, odetest may fail.

Actually the implicit solution is

Int( 1/(y^3 + 1)^(2/3), y) + Int( 1/(x^3 + 1)^(2/3), x) + c = 0;

Int(1/(y^3+1)^(2/3), y)+Int(1/(x^3+1)^(2/3), x)+c = 0

(1)

The problem is that the integrals are computed in terms of hypergeom, and Maple is not able to further manipulate.

f:=1/(x^3 + 1)^(2/3);

1/(x^3+1)^(2/3)

(2)

int(f, x)

x*hypergeom([1/3, 2/3], [4/3], -x^3)

(3)

Z:=diff(% ,x) - f; # Z should be 0

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

(4)

is(Z=0) assuming x>0, x<1;

FAIL

(5)

# It seems that any usual convertion fails here.

Salut Viorel, bine ai venit!

If you are interested in an approximate solution based on series, here it is:

restart;
ode:= diff(g(r),r$2)- r/R*g(r)=0;
ic:=g(2*R)=0, D[1](g)(0)=R;
dsolve([ode,ic],g(r)) assuming R>0;
G:=rhs(%);
Order:=6;
simplify(series(G, r=0));
convert(%, polynom):
g1:=convert(series(%, R=0), polynom);  
R:=1/3;  #############
dsol:=dsolve([ode,ic],g(r), numeric);
plots:-odeplot(dsol, r=0..2*R);
plot(g1, r=0..2*R);

So, for small R and r, an approximation is

RealDomains is not very reliable but it works in this case (Maple 2019).

eq:=(-2*cos(x)^2+2*sin(x+(1/4)*Pi)^2-1)/sqrt(-x^2+4*x) = 0:
RealDomain:-solve({-x^2+4*x > 0, eq}, {x}, allsolutions);
RealDomain:-solve(eq, {x}, allsolutions);

 

If you want a compact solution:

9*x-(1/3)*Pi = (-1)^k*(7*x-(1/3)*Pi) + k*Pi:
solve(%,x); # k in Z

I think that in a package where almost everything is a module, such a COMMAND could exist only if it is provided by the package itself.
But we can use:

X := ''RandomVariable''(Normal(mu, sigma)):
Y := eval(X, mu=1);

 

something like:

plots:-pointplot([x1,y1], color=[seq(COLOR(HUE,(t+1)/2),t=z1)]);

 

It is not that difficult but unfortunately Maple 2019 gives 0 for it.

It can be computed using residues. This must be done by hand because Maple cannot compute residues for essential singularities.

But it can compute the resulting sum, and the result is   2*Pi*BesselJ(m, b)*exp(I/2*m*Pi)

 

F1 := (x, y) -> 9/8*y + 9/8 - 21/8*y*exp(-2*x) - 21/8*exp(-x);

proc (x, y) options operator, arrow; (9/8)*y+9/8-(21/8)*y*exp(-2*x)-(21/8)*exp(-x) end proc

(1)

S1 := y -> fsolve(F1(x, y), x);

proc (y) options operator, arrow; fsolve(F1(x, y), x) end proc

(2)

S1(0.2);

.7548332751

(3)

g := (U,y) -> U + S1(2*y*exp(-U));

proc (U, y) options operator, arrow; U+S1(2*y*exp(-U)) end proc

(4)

g(0.6,0.2);

1.347716146

(5)

fsolve('g'(U,0.3) = 0.2, U);

-.4051840484

(6)

U1 := (x,y) -> fsolve('g(U,y) = x', U);

proc (x, y) options operator, arrow; fsolve('g(U, y) = x', U) end proc

(7)

U1(0.4,0.6);

-.1591368141

(8)

F2 := (x, y) -> 9/8*y + 9/8 - 21/8*y*exp(-2*x) - 21/8*exp(-x) + 3/4*int(F1(x - z, 2*y*exp(-z)), z = 0 .. U1(x,y));

proc (x, y) options operator, arrow; (9/8)*y+9/8-(21/8)*y*exp(-2*x)-(21/8)*exp(-x)+(3/4)*(int(F1(x-z, 2*y*exp(-z)), z = 0 .. U1(x, y))) end proc

(9)

F2(0.2,0.3);

-1.008550780

(10)

####################################################################

X:=[seq(k*0.1, k=0..10)];
Y:=[seq(k*0.1 ,k=0..10)];

[0., .1, .2, .3, .4, .5, .6, .7, .8, .9, 1.0]

 

[0., .1, .2, .3, .4, .5, .6, .7, .8, .9, 1.0]

(11)

F1_:= Interpolation:-SplineInterpolation( [X, Y],  [seq([seq(F1(x,y),y=Y)],x=X)] );

Interpolation:-SplineInterpolation([_rtable[18446744074399121150], _rtable[18446744074399121270]], _rtable[18446744074399113214], verify = false)

(12)

plot3d([F1(x,y), '1+F1_(x,y)'], x=0..1, y=0..1);

 

S1_:=Interpolation:-SplineInterpolation( X,  [seq(fsolve(F1_(x, y), x), y=Y)] );

Interpolation:-SplineInterpolation([_rtable[18446744074449580390]], Vector[row](11, {(1) = .8471962164, (2) = .7961144432, (3) = .7548618542000001, (4) = .7211061446, (5) = .6931443837, (6) = .6697004904, (7) = .6498166028, (8) = .6327736053999999, (9) = .6180256179, (10) = .6051531019, (11) = .593829713}), verify = false)

(13)

S1_(1/2);

HFloat(0.6697004904)

(14)

solu:=(x,y)->fsolve(U + 'S1_'(2*y*exp(-U))=x, U);

proc (x, y) options operator, arrow; fsolve(U+('S1_')(2*y*exp(-U)) = x, U) end proc

(15)

solu(0.3,0.4);

-.2865364247

(16)

U1_:= Interpolation:-SplineInterpolation( [X, Y],  [seq([seq(solu(x,y),y=Y)],x=X)] );

Interpolation:-SplineInterpolation([_rtable[18446744074439092814], _rtable[18446744074439092934]], _rtable[18446744074439093054], verify = false)

(17)

U1(0.1,0.2); U1_(0.1,0.2);

-.5354543130

 

HFloat(-0.5354485486)

(18)

F2_:=proc(x,y)
  local z, u:=evalf(U1_(x,y));
  evalf(9/8*y + 9/8 - 21/8*y*exp(-2*x) - 21/8*exp(-x)) + 3/4*int(''F1_''(x - z, 2*y*exp(-z)), z = 0 .. u, numeric)
end:
 

F2(0.1,0.2), F2_(0.1,0.2);

-1.139973599, HFloat(-1.1400076769496776)

(19)

 


 

Download int_iters.mw

 

On my Windows 7&10, the Maple commands work as expected:

!cmd
                               -1

!calc # ==> opens a console and launch calc.exe (the Windows calculator)
                               0
system(calc);
                               0
system("calc.exe");
                               0
!"cmd /c dir";
                               0
!"cmd /c calc";
ssystem("dir"); # ==>  contents of the current directory (Maple)

 

restart;
vars := [x,y,z]:
m1,m2,m3 := (a-b)*x*y*z^2, c*x^3, 3*b*x*y*z^2:
EqMon := (m1,m2,vars::list(name)) -> not depends(m1/m2, vars):
EqMon(m1,m2,vars), EqMon(m2,m3,vars), EqMon(m1,m3,vars);
#                       false, false, true

 

SOL:= u(x, t) = limit(op(1,rhs(sol)),n=0) + subs('n=0..infinity' = 'n=1..infinity', rhs(sol)):
plot3d(subs(infinity=100, rhs(SOL)), x=0..3, t=0..2);

You should inspect visually the integrals.
It's easy to see that the integral wrt phi can be computed symbolically (and actually ==> some integrals are 0).
Then compute numerically wrt theta and r. It will be much faster.

Also, for other 3 dimensional int, try a fast (low precision)  e.g.
Int( ...,  epsilon=1e-2, method=_CubaDivonne)

 

 

First 50 51 52 53 54 55 56 Last Page 52 of 120