evalf(Int(...)) seems unable to assess numericall...

Asked by:

Hi,

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 ?

 > restart:
 > interface(version)
 (1)
 > plot3d(cos(x*y), x=-1..3, y=-1..-0.2)
 > int(cos(x*y), [x=-1..3, y=-1..-1/5]); evalf[15](%);
 (2)
 > 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
 (3)
 > 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
 (4)
 > 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
 (5)
 > 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);
 (6)
 >

Download evalf_Int.mw

Duplicate variables shown when assume involves sub...

Asked by:

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.

maple package error...

Asked by:

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

a 2D plot from a 3D plot...

Asked by:

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 doubt about this alternating series....

Asked by:

alternatingseries.mw
I have a double about this alternating series.
According to maple this series converges:

evalf(sum((-1)^(n+1)*(ln(n)/n+1),n=1..infinity))
0.3401310963

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

Trouble Simplifying expressions in Maple 2019...

Asked by:

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,

Christoffel_symbols_of_de_Sitter_metric_research.mw

grouping a list?...

Asked by:

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]

How to set kernelopts for running the following co...

Asked by:

Hello

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

kernelopts(stacklimit);
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:
[seq(R)]
end proc:
n:=34;
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

Ed

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.

Hepl to find values of W by graphic method (plot) ...

Asked by:

restart;
with(LinearAlgebra);
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)]]);
NULL;
NULL;
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);
S;
d := 24.8;
c := 5100;
v := 0.34;
l := 2000;
E := 2.1*10^5;
p := 7700;
S;
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

How do I use Subs with RootOf...

Asked by:

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

subs(s,F)

end do;

The 4th soln has RootOf.

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

for s in soln2 do

evala(subs({x=s,y=s,z=s},F))

end do;

How do I do this all in one step?

Order of coefficients and brackets in metric...

Asked by:

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!

 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 >
 (6)
 >

Download qstn.mw

Adding matrices when one is the result of a previo...

Asked by:

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

What is the difference between an italic red promp...

Asked by:

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.

How do I sum over non-spacetime indices?...

Asked by:

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.

factorize the equation in maple...

Asked by:

Factorise

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
﻿