MaplePrimes Questions


Here is an example where evalf ( Int(....) ) fails to compute an in integral.
The function to integrate is very smooth and, except method=_Gquad, all the others seem to fail (even method=_MonteCarlo fails, which is probably the most surprising thing!)

Is it a weakness of evalf+Int or a misusse of my own ?



`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`


plot3d(cos(x*y), x=-1..3, y=-1..-0.2)


int(cos(x*y), [x=-1..3, y=-1..-1/5]);





CodeTools:-Usage( evalf[10](Int(cos(x*y), [x=-1..3, y=-1..-0.2], method=_Gquad)) );

memory used=1.24KiB, alloc change=0 bytes, cpu time=0ns, real time=0ns, gc time=0ns




CodeTools:-Usage( evalf[10](Int(cos(x*y), [x=-1..3, y=-1..-0.2], method=_CubaVegas)) );

memory used=22.14KiB, alloc change=0 bytes, cpu time=16.99s, real time=17.01s, gc time=0ns


Int(Int(cos(x*y), x = -1. .. 3.), y = -1. .. -.2)


CodeTools:-Usage( evalf[10](Int(cos(x*y), [x=-1..3, y=-1..-0.2], method=_MonteCarlo)) );

memory used=12.79KiB, alloc change=0 bytes, cpu time=1000.00us, real time=0ns, gc time=0ns


Int(Int(cos(x*y), x = -1. .. 3.), y = -1. .. -.2)


N := 10^6:
X := Statistics:-Sample(Uniform(-1, 3), N):
Y := Statistics:-Sample(Uniform(-1, -0.2), N):
Z := cos~(X*~Y):
add(Z) / N * (4*0.8);







I'm using variable names that have subscripts, not as a table index but literal i.e. R__1 as a unique variable name.  It seems whenever I make assumptions on variables that have subscripts, when I use them the variables that have subscripts are printed twice:


Can anyone explain why this happens and how to get around it?


Thanks in advance.


My problem in package error, does anyone had a solution ping this!

Dear Friends

I want to know that how can I plot a 2D curve in 3D? 

I need to plot the curve for example z=y^2, in a 3D space and exactly in the plane x=0. The ranges are -1<y<1, -1<x<1, 0<z<1

(I want to copy and paste this curve in another 3D figure.) 

Thanks a lot
I have a double about this alternating series.
According to maple this series converges:


However limit ln(n)/n + 1 does not equal to zero, it equals 1. Therefore the series should diverge.

Also while I am on the subject of series and limits, why is limit (-1)^n  as n goes to infinity a range between -1-I and 1 + I.

limit((-1)^(n), n=infinity)
                        -1 - I .. 1 + I



Hello, I am having a bit of difficulty simplifying some calculations in Maple 2019. In short, in order to verify that the tensors that I am trying to use are indeed inverses of each other, I am simply trying to multiply component wise, for example the tensor component e[2,~2] with the tensor component f[~2,2], since they are essentially inverses of each other, i.e. the matrix defining f is actually the inverse of the matrix e, i.e. f=e^(-1), should give back 1 as an answer. Nonetheless, when I attempt to take this simple multiplication Maple does not reduce it, but rather just gives multiplies the terms with no simplification. Is there anything I can do so that Maple may simplify its calculations? I have already tried the "eval" calling sequence but that didn't do the trick, and I fear that when escalating the calculations I will get a bunch of long expressions rather than concise solutions. Thank you for your help in advance,

Lets say you have this simple list here 

L := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];


Which command would you use to partion into intervals? 

L_g := [1..2,3..4,5..6,7..8,9..10]


Although I am (remotely) running the following piece of code in a linux machine with 256 GB of ram, the error msg "Execution stopped: Stack limit reached" comes out 


NestList:= proc(f, x, n::nonnegint)
local R:= rtable(0..n, [x]), k;
   for k to n do R[k]:= simplify(f(R[k-1])) od:
end proc:
yreal:=NestList(y-> 4*y*(1-y),1/8,n):

I have tried to increase stacklimit issuing the command "kernelopts(stacklimit=256000)" but to no avail.  Is there anything else I can do?  A similar code run successfully in a mac with Mathematica. 

Many thanks 



PS. The default kernelopts(stacklimit) shows 8192 on the linux machine and  but 32736 on the mac pro.  I was expecting a higher number on the linux machine.  


G := Matrix([[beta1^2, 0, -beta2^2, 0], [0, beta1*(b^2 - beta1^2), 0, beta2*(b^2 + beta2^2)], [beta1^2*cosh(beta1*l), beta1^2*sinh(beta1*l), -beta2^2*cos(beta2*l), -beta2^2*sin(beta2*l)], [beta1*sinh(beta1*l)*(b^2 - beta1^2), beta1*cosh(beta1*l)*(b^2 - beta1^2), -beta2*sin(beta2*l)*(b^2 - beta2^2), beta2*cos(beta2*l)*(b^2 + beta2^2)]]);
S := Determinant(G);
S := simplify(S);
S1 := S/(beta1^2*beta2^2);
F := Pi*d^2/4;
Q := F*d^2/8;
u := E/(2*(1 + v));
lambda := sqrt(w^2/c^2);
j := v*d*lambda/sqrt(8);
y1 := 1 - j^2 + sqrt((j^2 - 1)^2 + 4*j^2*u/(c^2*p))/(2*j^2*u/(c^2*lambda^2*p));
y2 := 1 - j^2 - sqrt((j^2 - 1)^2 + 4*j^2*u/(c^2*p))/(2*j^2*u/(c^2*lambda^2*p));
b := 2*(1 + v)*(8/(v^2*d^2) - w^2/c^2);
beta1 := sqrt(y1);
beta2 := sqrt(-y2);
d := 24.8;
c := 5100;
v := 0.34;
l := 2000;
E := 2.1*10^5;
p := 7700;
plot(S, w = 0*2*Pi .. 100000*2*Pi);

# Here I get an error

Error, (in plot) incorrect first argument (-HFloat(2.757556062608314e294)-HFloat(2.757556062608314e294)*I)*(HFloat(2.757556062608314e294)-HFloat(2.757556062608314e294)*I+(HFloat(2.918216722364015e-174)+HFloat(7.045198389075166e-174)*I)*(HFloat(1.2899139595562734e220)+HFloat(1.2899139595562734e220)*I+(HFloat(2.345679734289597e162)+HFloat(9.71612358926469e161)*I)*(.3015529528-0.1030372934e-6*w^2)^2)+(HFloat(2.739493386336394e-116)+HFloat(2.739493386336394e-116)*I)*(HFloat(1.5009648027561687e-231)-HFloat(2.757556062608314e294)*I+(-HFloat(5.478986772672788e-116)+HFloat(5.478986772672788e-116)*I)*(.3015529528-0.103 ... HFloat(2.739493386336394e-116)*I)*(.3015529528-0.1030372934e-6*w^2)^4)

w1 := fsolve(S, w = 0*2*Pi .. 100000*2*Pi);

# Here I get an error 

Error, (in fsolve) Digits cannot exceed 38654705646

I want to substitute the solution back into the original equation.  I get caught up in RootOf and have to manually do the substitutions.

F := [x^2+y+z-1, y^2+x+z-1, z^2+x+y-1];

soln1 := solve(F);

for s in soln1 do


end do;

The 4th soln has RootOf.

soln2 := solve(_Z^2 + 2*_Z - 1);

for s in soln2 do


end do;

How do I do this all in one step?

I was starting to set up a curved axisymmetric metric using the Physics package and came across an error message that I could not resolve. I was actually writing the metric in the form given after output line (5) in the code attcahed below. This returned the error message:

Error, (in Physics:-Setup) invalid subscript selector

Then I started fiddling and discovered that somehow braces and order of coefficients are making a difference in the metric. I have written the flat space metric in three different ways after output line (2). The difference is only in the coefficient of the last $d\phi^2$ term. For some reason, $r^2 (sin(\theta))^2$ is shown as $r (sin(\theta))^4$ in output line (3). Removing the brackets around $sin(theta)$ or writing $r^2$ after it is resolving the problem. Is this in someway related to the whole square operation? Can you please help me understand why this is happening?

The original error message I was getting went away after I similarly changed the order of coefficients in the second term of the curved metric to get output (6). Here again, there was a whole square operation!

Thank you!




[`*`, `.`, Annihilation, AntiCommutator, Antisymmetrize, Assume, Bra, Bracket, Cactus, Check, Christoffel, Coefficients, Commutator, CompactDisplay, Coordinates, Creation, D_, Dagger, Decompose, Define, Dgamma, Einstein, EnergyMomentum, Expand, ExteriorDerivative, Factor, FeynmanDiagrams, Fundiff, Geodesics, GrassmannParity, Gtaylor, Intc, Inverse, Ket, KillingVectors, KroneckerDelta, LeviCivita, Library, LieBracket, LieDerivative, Normal, Parameters, PerformOnAnticommutativeSystem, Projector, Psigma, Redefine, Ricci, Riemann, Setup, Simplify, SpaceTimeVector, StandardModel, SubstituteTensor, SubstituteTensorIndices, SumOverRepeatedIndices, Symmetrize, TensorArray, Tetrads, ThreePlusOne, ToFieldComponents, ToSuperfields, Trace, TransformCoordinates, Vectors, Weyl, `^`, dAlembertian, d_, diff, g_, gamma_]


Setup(signature = `-+++`, coordinates = (X = [t, r, theta, phi]))

`* Partial match of  'coordinates' against keyword 'coordinatesystems'`


`Default differentiation variables for d_, D_ and dAlembertian are: `*{X = (t, r, theta, phi)}


`Systems of spacetime Coordinates are: `*{X = (t, r, theta, phi)}


[coordinatesystems = {X}, signature = `- + + +`]


Setup(g_ = -dt^2+dr^2+r^2*dtheta^2+r(sin(theta))^4*dphi^2)

[metric = {(1, 1) = -1, (2, 2) = 1, (3, 3) = r^2, (4, 4) = r(sin(theta))^4}]


Setup(g_ = -dt^2+dr^2+r^2*dtheta^2+sin(theta)^2*r^2*dphi^2)

[metric = {(1, 1) = -1, (2, 2) = 1, (3, 3) = r^2, (4, 4) = sin(theta)^2*r^2}]


Setup(g_ = -dt^2+dr^2+r^2*dtheta^2+sin(theta)^2*r^2*dphi^2)

[metric = {(1, 1) = -1, (2, 2) = 1, (3, 3) = r^2, (4, 4) = sin(theta)^2*r^2}]


Setup(g_ = -exp(2*nu(r, theta))*dt^2+(exp(2*psi(r, theta)))(dphi-omega(r, theta)*dt)^2+(exp(2*mu(r, theta)))(dtheta)^2+exp(2*lambda(r, theta))*dr^2)

Error, (in Physics:-Setup) invalid subscript selector


Setup(g_ = -exp(2*nu(r, theta))*dt^2+(dphi-omega(r, theta)*dt)^2*exp(2*psi(r, theta))+exp(2*mu(r, theta))*dtheta^2+exp(2*lambda(r, theta))*dr^2)

[metric = {(1, 1) = -exp(2*nu(r, theta))+omega(r, theta)^2*exp(2*psi(r, theta)), (1, 4) = -omega(r, theta)*exp(2*psi(r, theta)), (2, 2) = exp(2*lambda(r, theta)), (3, 3) = exp(2*mu(r, theta)), (4, 4) = exp(2*psi(r, theta))}]





For some reason machine thinks that I am trying to add a matrix to an equal sign.

Is it italic when copied and pasted?  Is it bold when copied from maple 8?  I just ahve not been able to work it out.

The only way that I can think of doing it is by multiplying by a tetrad.  Even then it does not work well see my worksheet:  The Dirac Equation in Robertson-Walker spacetime.



into your Maple worksheet and copy and paste the Maple output into the answer box below.

First 287 288 289 290 291 292 293 Last Page 289 of 2132