Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 364 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@Feenix 

What do mean by your title "It is doesnt work"?? If it doesn't work, then you need to show what you got when you used it, so that I can attempt to fix it. It worked for me (in Maple 18).

My name is Carl Love, exactly like my avatar.

My Answer assumes that you simply want to remove or discard any solution sets that contain RootOf. Doug Meade's Answer assumes that you want to reprocess the RootOfs into more-standard algebraic forms and then discard any nonreals. It's not clear to me which of these alternatives you want. Doug's Answer seems to me the more-usual request, but my Answer seems to correspond more closely to the actual wording of your Question: "remove Complex and RootOf from this list".

@tomleslie Thanks for the correction, and I corrected the original.

@vv It's an excellent question that I don't know the answer to. My knowledge about the matter is pretty much limited to what I've gleaned from the help pages ?Heaviside, ?NumericEvent, and ?NumericEventHandler. I think it'd make a good thread-starting Question.

Essentially the same question applies to signum(0).

@nMaple Then your use of NumericEventHandler is appropriate. It will affect the evaluation of the resulting function, but I don't think that it'll affect the ability of int to find the symbolic integral. I'm not sure about that last part; anyway, the solution with convert works regardless of NumericEventHandler.

 

@vv 

'f()' $ 5;

No index variable is needed.

@tomleslie If you're attempting a numeric integration of an analytic integrand over a finite hyperrectangle and it returns unevaluated, that almost certainly means that you need to adjust epsilonDigits, or digits or some subset of those. If you're using one of the four cuba methods, you may also adjust absepsilon and maximalpoints.

By setting infolevel[`evalf/int`]:= 4;, you can often get some hints on how much adjustment is needed.

@Markiyan Hirnyk What is the signifiicance of your epsilon= .2? That's means not even one significant digit.

@Axel Vogt Maple can easily duplicate your result in under one second using only 1,273,383 integrand evaluations. (My seventh digit differs from yours, and both are insignificant with relative error set at 1e-6.)



restart:

Digits:= 15:

n:= 6:

infolevel[`evalf/int`]:= 4:

Int(exp(-add(x[i], i= 1..n)^3), [seq(x[i]= 0..1, i= 1..n)], method= _CubaCuhre, epsilon= 1e-6);

Int(exp(-(x[1]+x[2]+x[3]+x[4]+x[5]+x[6])^3), [x[1] = 0 .. 1, x[2] = 0 .. 1, x[3] = 0 .. 1, x[4] = 0 .. 1, x[5] = 0 .. 1, x[6] = 0 .. 1], method = _CubaCuhre, epsilon = 0.1e-5)

CodeTools:-Usage(evalf(%));

Control_multi: integrating on [0, 0, 0, 0, 0, 0] .. [1, 1, 1, 1, 1, 1] the integrand

exp(-(`x[1]`+`x[2]`+`x[3]`+`x[4]`+`x[5]`+`x[6]`)^3)

cuba: transformed original integrand

exp(-(`x[1]`+`x[2]`+`x[3]`+`x[4]`+`x[5]`+`x[6]`)^3)

cuba: with lower bounds [0., 0., 0., 0., 0., 0.] and upper bounds [1., 1., 1., 1., 1., 1.], to the following integrand to be integrated over the unit n-cube:

exp(-(`x[1]`+`x[2]`+`x[3]`+`x[4]`+`x[5]`+`x[6]`)^3)

cuba: integration completed successfully
cuba: # of integrand evaluations: 1273383
cuba: estimated (absolute) error: 2.74115e-009
cuba: chi-square probability that the error is not reliable: 0
cuba: number of regions that the domain was divided into: 1406
memory used=1.49MiB, alloc change=0 bytes, cpu time=718.00ms, real time=764.00ms, gc time=0ns

HFloat(0.002744073810540752)

 



Download CubaCuhre.mw

 

@Kitonum 

I am highly suspicious of your claim about better results. Yes, solve will return more-accurate roots of the polynomial, but the coefficients of that polynomial are already corrupted by round-off error. The Eigenvalues (or Eigenvectors) command will return more accurate eigenvalues. Please see the post that I just made: Use Eigenvalues, not fsolve@Determinant.

How are you measuring memory usage? Please show your code for that.

@H-R I don't know how to fix this. My guess is that it is a design flaw. Unfortunately, there's no interface variable associated with this. That's a major design flaw. If there were an interface variable, then this could be fixed by a setting in your initialization file.

@Markiyan Hirnyk 

He means the same thing as is meant by "Atomic Variables" on the View menu; it's the eighth item there (in Maple 18, at least). I don't know what that means, but it's clear that the OP means the same thing. When he places a check mark next to this menu item, he'd like that selection to persist across sessions.

@baharm31 

I don't see any uploaded worksheet.

I wasn't saying that you'd necessarily be able to solve the equation by using solve and eval together. I can't know that without having the worksheet. What I'm saying is that you should use eval instead of assuming, in any command, when you want to set the parameters to specific values. 

@nm Please see my addendum about using with inside procedures. That is why you need to execute twice.

@baharm31 You asked:

[I]s it correct to say:

solve(function, x) assuming A=..., B=..., C=...?

No, that's not correct, unfortunately. It's certainly understandable why you might think that that's correct, but it's not. Assumptions of equality are very often ignored, and they're certainly ignored by solve. Use eval instead:

solve(eval(function, [A= ..., B= ......]), x);

Regarding the implicitplot, surely numpoints= 10^8 is a ridiculously large and impossible-to-achieve value. It means that your rectangular region of the xy-plane is subdivided into 100 million subrectangles and every one of these is searched for points that satisfy the equation. There are many subtle options to implicitplot worth exploring. One mentioned already is gridrefine. Try also crossingrefine and rational.

Please post a worksheet.

 

First 439 440 441 442 443 444 445 Last Page 441 of 709