MaplePrimes Questions

In a recent question (a few hours ago) Teep failed to compute quantiles of a negative binomial random variable as soon as the probability of success is small (even for a value of 0.05 the computational time is very prohibitive).
Teep used the package Statistics:

I discovered inadvertently that the package Student[Statistics] worked perfectly on the same problem, even for a success probability as small as 3e-10

What is the necessity to have two packages that share theoritically some features especially if one of them (Statistics) contains a lot of flaws and is not capable to return an answer as the other (Student[Statistics]) does?
In the present case of numerically computing quantiles, why people decide to implement a good algorithm in one package and a poor one in the other? Or why they didn't verify if the two packages gave identical answers on the same problem?

Hi all,

Anyone knows how to see a manual for DirectSearch:-GlobalSearch that explains what is done inside the function?

I tried to write "help(DirectSearch:-GlobalSearch)" and nothing. It opened an empty page written (no matches found). Is there any help for this function so I can know what's going on there?

More specifically, I'm trying solve the optimization probelm min(||Ax-b||_p) s.t. ||x||=1.

where A is a given matrix of size (n \times d)

b is a given vector of size (n \times 1)

p>0 is a scalar

and x is an unkown vector of size (d \times 1) that should be a unit vector.

I used DirectSearch:-GlobalSearch to solve this optimization problem. But since it's a non-convex optimization probelm, the function doesn't always return the optimal value. I want to read the manual of the function to understand what is done there and for which cases there are most chances that the function will not return the optimal value.

Thanks

 

Given any threshold value, I am interested in obtaining a quantity of interest using the inverse negative binomial distribution. This requires extracting the value from the discrete CDF and I am using the Quantile(X, threshold value) function.

The parameters of the NBD are given as r and p and the routine I have written (attached) works in some cases, but I have noticed that, for small values of p, the Maple program runs for excessive times to attempt to output the Quantile solution. For instance, if p = 0.3, the solution is fast but when p = 0.003, Maple continues to evaluate the solution with no result (I have interrupted computations after 2 hours).

In the attached example, p is set to 1.965 and r is 0.5. The threshold value is 0.98 and the associated solution, Q, for this value is determined to be Q=7.

Does anybody know how to help with this? I would be grateful for any help along the way. 


 

restart; with*Statistics; with(plots)

r := 1.965; p := .5

1.965

 

.5

(1)

with(Statistics)

R := RandomVariable(NegativeBinomial(r, p))

ProbabilityFunction(R, u)

Set the value of the CDF probability, α.

Evaluate the inverse CDF to return the quantity of interest, Q.

 

alpha := .98

.98

(2)

X := NegativeBinomialVariable(r, p); X := RandomVariable(NegativeBinomial(r, p))

CumulativeDistributionFunction(X, alpha)``

Q := Quantile(X, alpha)

7.

(3)

DensityPlot(X, title = "PDF")

 

plot(CDF(X, s), title = "CDF")

 

``

``NULL

``

``


 

 

Is it possible to output to the console without a new line being added. The code:

prints each number on a separate line. I want to print them all on the same line.

I am unable to integrate this equation

restart:
with(DETools):
with(IntegrationTools):
u[1](r,z):=(C[o]^2*exp(2*lambda*z)-D[o]^2*exp(-2*lambda*z))+(lambda/2)*(C[o]*exp(lambda*z)-D[o]*exp(-lambda*z))*(1-r^4)+A[1](z)*r^2:
M1:=int(u[1](r,z), z):
 

 

Hi

I want to write a code to show that

Please check the following code:

restart;
with(VectorCalculus):
SetCoordinates(cartesian[x, y, z]): 
g1 := proc (u1, u2, u3, s)
local N, u, n, intr1, intr2, intr3, R1, R2:
u := VectorField([u1, u2, u3]): 
N := Gradient(s): 
n := N/sqrt(add(N[k]^2, k = 1 .. 3)): 
intr1 := solve(subs(z = 0, s), y): 
intr2 := solve(subs(z = 0, y = 0, s)): 
R1 := int(int(subs(z = solve(s, z)[1], u . n), y = intr1[1] .. intr1[2]), x = intr2[1] .. intr2[2], numeric):
intr1 := solve(s, z): 
intr2 := solve(subs(z = 0, s), y):
intr3 := solve(subs(z = 0, y = 0, s)): 
R2 := evalf(int(int(int(Del . u, z = intr1[1] .. intr1[2]), y = intr2[1] .. intr2[2]), x = intr3[1] .. intr3[2])):
print(R1, R2) 
end proc

It seems that different answers are obtained.

g1(x, 1, z, x^2+y^2+z^2-2);
                   6.664324407, -23.69537567
 

Hello!

I am trying to determine the type of Lie algebra originating from Killing vectors. However, Maple says that some variable x is protected (though, I guess, it shouldn't even be in the L). Is there any way to solve this issue?

Best regards, 
Nick

error.mw

restart

with(DifferentialGeometry); with(Tensor); with(LieAlgebras); with(GroupActions); with(Library)

DGsetup([x, y], M)

g := evalDG((`&t`(dx, dx)+`&t`(dy, dy))/y^2)

_DG([["tensor", M, [["cov_bas", "cov_bas"], []]], [[[1, 1], 1/y^2], [[2, 2], 1/y^2]]])

(1)

kv := KillingVectors(g)

[_DG([["vector", M, []], [[[1], (1/2)*x^2-(1/2)*y^2], [[2], y*x]]]), _DG([["vector", M, []], [[[1], x], [[2], y]]]), _DG([["vector", M, []], [[[1], 1]]])]

(2)

L := LieAlgebraData(kv, Poincare)

_DG([["LieAlgebra", Poincare, [3]], [[[1, 2, 1], -1], [[1, 3, 2], -1], [[2, 3, 3], -1]]])

(3)

DGsetup(L); MultiplicationTable("LieTable")

Query(Poincare, "Semisimple")

true

(4)

CSA := CartanSubalgebra(Poincare)

[_DG([["vector", Poincare, []], [[[2], 1]]])]

(5)

RSD := RootSpaceDecomposition(CSA)

Error, (in MultiSet:-Entries) attempting to assign to `x` which is protected.  Try declaring `local x`; see ?protect for details.

 

``


 

Download error.mw

 

Hi,

I have this fonction  solve({f(x,y)});  giving this  for example { x = 13, y =259 }

how can reuse the result for a an other fonction.

Thanks

 

 


                              
                     
                                   
 

Hi, 

 

I would like to have some references about the function PolyhedralSets:-PolyhedralSet.
I used it very recently before constructing the convex hull  (PolyhedralSets:-ConvexHull) of a set of 50 points.
After some minutes spent to wait for a solution, I was forced to stop the computation.
I randomly sampled 10 points, next 20, 30, ... from the original set of points and observed that the computational time was growing very fast with the number of points.

Could you please inform me about the algorithm Maple uses and about its complexity?

Last point: the original points are floating numbers and I used the transformation  T: x -->  rounf(10k*x) / 10(PolyhedralSets:-PolyhedralSet operates only on rationals).
It seems that the computational time increases strongly as k increases too.

What are the limitations and best practices to use PolyhedralSets:-PolyhedralSet?

TI1

Hello, 

I am fairly new to using the Maple software, so I apologize if my question is completely idiotic. Apologies, also, because I could not manage to enter my code as code. When I pressed the button it made the whole text as a code. 

I run the following code to seek -if there are any- analytic solutions for the following differential equation.

odeplus := (r^2+L^2)^(5/2)*(diff(f(r), `$`(r, 2)))+((15/4)*r*(r^2+L^2)^(1/2)+3*(r^2+L^2)^(5/2)/r)*(diff(f(r), r))+M^2*f(r)/(r^2+L^2)^(5/2)-((5/2)*((r^2+L^2)^(1/2))(l-1)+(55/64)*r^2/(r^2+L^2)^(3/2)+(r^2+L^2)^(5/2)*(l^2+3*l+3/2)/r^2)*f(r)+(((r^2+L^2)^(1/2))(5+(5/2)*l)+(5/8)*r^2/(r^2+L^2)^(3/2)-(r^2+L^2)^(5/2)*(3/2+l)/r^2)*f(r) = 0

and then I do 

dsolve(odeplus, f(r))

The solutions that Maple returns is given in terms of DESol. Could anyone try and break it down for me? What is this telling me and if I can indeed from the output obtain analytic solutions? Is this some sort of operator acting on something? 

Thank you in advance. 

Hello ,

Iam new with maple, and iam trying to solve an equation using prime numbers. The equation is display as follow.

eqns := {G = x*q, 8695*y = 1341*q};

Iam trying to solve with the condition p and q are prime numbers

So is it posible to add condition prime in the solve fonction ? solve(eqns*[x, y]); 

Thank you for your help

I hate it when a user bumps every Question that they've ever asked over the past five years to the top of Recent (aka Active Conversations) stack! This is not the first time that this has happened. I rely heavily on that stack being truly the threads with the most-recent material. Can't something be done about this short of deleting the threads? That seems too drastic: While this user has occasionally been a pest in the past, they've also posted some decent material. There should be some way for a moderator to just reset the stack positions to what they were previously.

hi.

I can not gain answer for integral.

Best

int.mw
 

restart

PDE := (12*kappa^2*psi^2*(-upsilon^2+1)*((3*Pi^2*Q^2*(nu*psi^2+1)/(32*(-nu^2+1))+Q^2*(Pi^2*cos(2*Pi*y)/(8*psi^2)+psi^2*cos(2*Pi*x)*Pi^2*cos(2*Pi*y)/(4*(psi^2+1)^2)+Pi^2*cos(4*Pi*y)/(32*psi^2)+psi^2*cos(2*Pi*x)*Pi^2*cos(4*Pi*y)/(2*(4*psi^2+1)^2)+psi^2*cos(4*Pi*x)*Pi^2*cos(2*Pi*y)/(8*(psi^2+4)^2)))*(2*Q*Pi^2*sin(Pi*x)^2*cos(Pi*y)^2-2*Q*cos(Pi*x)^2*cos(Pi*y)^2*Pi^2)+(2*Q*cos(Pi*x)^2*Pi^2*sin(Pi*y)^2-2*Q*cos(Pi*x)^2*cos(Pi*y)^2*Pi^2)*(3*Pi^2*Q^2*(psi^2+nu)/(32*(-nu^2+1))+Q^2*((1/8)*psi^2*cos(2*Pi*x)*Pi^2+psi^2*cos(2*Pi*x)*Pi^2*cos(2*Pi*y)/(4*(psi^2+1)^2)+(1/32)*psi^2*cos(4*Pi*x)*Pi^2+psi^2*cos(2*Pi*x)*Pi^2*cos(4*Pi*y)/(8*(4*psi^2+1)^2)+psi^2*cos(4*Pi*x)*Pi^2*cos(2*Pi*y)/(2*(psi^2+4)^2)))-8*Q^3*cos(Pi*x)*cos(Pi*y)*Pi^2*sin(Pi*x)*sin(Pi*y)*(-psi^2*Pi^2*sin(2*Pi*x)*sin(2*Pi*y)/(4*(psi^2+1)^2)-psi^2*Pi^2*sin(2*Pi*x)*sin(4*Pi*y)/(4*(4*psi^2+1)^2)-psi^2*Pi^2*sin(4*Pi*x)*sin(2*Pi*y)/(4*(psi^2+4)^2)))+beta*V^2/(1-Q*cos(Pi*x)^2*cos(Pi*y)^2)^2-8*Q*Pi^4*cos(Pi*x)^2*cos(Pi*y)^2+8*Q*Pi^4*sin(Pi*x)^2*cos(Pi*y)^2-2*psi^2*(4*Q*Pi^4*sin(Pi*x)^2*sin(Pi*y)^2-4*Q*Pi^4*sin(Pi*x)^2*cos(Pi*y)^2-4*Q*cos(Pi*x)^2*Pi^4*sin(Pi*y)^2+4*Q*Pi^4*cos(Pi*x)^2*cos(Pi*y)^2)-psi^4*(-8*Q*cos(Pi*x)^2*Pi^4*sin(Pi*y)^2+8*Q*Pi^4*cos(Pi*x)^2*cos(Pi*y)^2))*(1-Q*cos(Pi*x)^2*cos(Pi*y)^2)^2*cos(Pi*x)^2*cos(Pi*y)^2

int(int(PDE, y = -1/2 .. 1/2), x = -1/2 .. 1/2)


 

Download int.mw

 

I've been googling for a while for a built-in function that computes {binomial(n,k) mod p} in Maple. The closest I've come to finding an answer is here: https://www.mapleprimes.com/questions/200986-Binomial-Coefficients , where the answer is given for p=2 and the method uses Lucas' theorem and relies completely in the binary nature of the problem. Is there any such function? If not, what would the most efficient way to handle this numbers be? Thanks for the help!

This is probably a silly question, but...

given 

GST := AE+AI-ANB-AR-CP

how do i append [i] to each element of the list so I get

AE[i]+AI[i]-ANB[i]-AR[i]-CP[i]

this nearly gets it

(GST@`[]`)~(i);
 

First 758 759 760 761 762 763 764 Last Page 760 of 2428