Carl Love

Carl Love

28070 Reputation

25 Badges

13 years, 33 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@Rouben Rostamian  It looks like the OP is already using abs.

The OP should post the function in a reproducible format so that we can work with it.

@_Maxim_ Correct, as far as type is concerned RealRange(0,2) might as well be foo(0,2)---it's just a function.

You should also read ?in, which describes an operator SetOf whose argument is a type; however, I've never encountered a situation where a computation using SetOf couldn't be expressed more succinctly without it.

@acer The McCarthy short-circuit evaluation rules for boolean operators apply to the infix forms of and, or, and implies but not to their prefix forms. Thus, with the infix forms, if the truth of the whole expression can be determined from the left operand, then the right operand isn't even evaluated; whereas with the prefix forms, all arguments are evaluated regardless. This explains some of Maxim's anomalies.

I don't think that it applies to this Question, but a further source of anomalies is that in 2D Input (at least in some versions) the infix boolean operators are translated to their prefix forms.

 

 

 

@_Maxim_ RealRange per se isn't a type, but RealRange(1,2) is a type because it's a function, and all functions are types. (I'm using function in the Maple sense: an unevaluated function call or invocation.)

Just looking at this quickly (for less than a minute) and thinking how I'd express it in terms of z "by hand", I'm seeing a lot "argument of z" and "modulus of z". Do you see any possibility of an analytic expression in z?

@Carl Love Sorry, I had failed until now to notice that your plot was 3-D. The instructions that I gave work for 2-D plots. I don't know if it's possible for 3-D plots.

@Preben Alsholm Any such integral can be reduced to a pair of real integrals, like below, provided that evalc understands how to break it down. The integral in Question can be thus encoded

assume(Y>0);
Limit(
   (evalc@Complex)(
      Int~(evalc~([Re,Im](subs(s= x+I*y, x= 1, 1/(s^2+1)))), y= -Y..Y)[]
   ),
   Y= infinity
);

Limit(
   Int((-y^2+2)/((-y^2+2)^2+4*y^2), y = -Y ..Y) +
      I*Int(-2*y/((-y^2+2)^2+4*y^2), y = -Y .. Y),
   Y = infinity
)

It's clear at this point that both integrals converge at both infinities, so taking the limit uniformly in both directions is safe. It's also clear that the imaginary integral is 0 (for all Y).

applyop(value, 1, %);

Limit((1/2)*ln(Y^2+2*Y+2)-(1/2)*ln(Y^2-2*Y+2), Y = infinity)

value(%);

0

 

@_Maxim_ The documentation at ?timelimit contradicts what you say. It says directly in the first paragraph

  • For efficiency reasons, the timelimit bound is ignored while in built-in routines.

That's the documentation; I'm not sure what the reality is.

@Preben Alsholm Assuming that every builtin procedure has a positive integer index (from its option builtin= ... declaration) and that there are not huge gaps in the number sequence so that none has an index greater than 9999, the following constructs a list of all of them with both their names and index numbers.

restart:
interface(warnlevel= 0):
UL:= 9999:
B:= map(
   P-> [[op(3, eval(P))], eval(P)],
   select(
      P-> op(3,eval(P)) <> NULL,
      [seq(parse(sprintf("proc() option builtin=%d; end", k)), k= 1..UL)]
   )
): 
nops(B);

I count 314 in Maple 2016. They seem to be indexed alphabetically, ranging from 199 = ASSERT to 583 = zip.

@Carl Love Here is my corrected Answer. We need to create a new type, subscripted, which is akin to suffixed but tries to match a symbol's end rather than its beginning.

restart:
TypeTools:-AddType(
   subscripted,
   (x, S)->
      x::symbol and 
     `if`(
        S::set, 
        ormap(s-> type(x, subscripted(s)), S), 
        substring(x, -length(__||S)..) = __||S
     ) 
):             
poly:= a__b + b__a + a__b^2:
select(hastype, poly, subscripted(b));

To further the analogy with suffixed, I coded it so that {subscripted(a), subscripted(b)} is equivalent to subcripted({a,b}), and likewise for sets of any size. Also note that the subscripts need not be symbols; anything that can be appended by || will do; in particular, integers are allowed as subscripts.

Nearly every day I have some situation where I need to manually terminate an mserver.exe, so specific cases where this happens are hardly worth mentioning. The design flaw is that interruptions don't work while kernel code is executing.

@vv I think that kernel and external code can't be interrupted. In other words, interruptions can only occur while transitioning from one Maple-level statement to another. Nearly all floating-point evaluations of transcendental functions pass the job off to the kernel procedure `evalf/hypergeom/kernel`.

@Kitonum You're missing a parse command. The final result should be a list of two-element lists.

@erik10 For the word in your language, did you include the extra space and backquotes, like I did? So, I used `Slope `, not `Slope` or Slope.

@Carl Love My Answer above is wrong, and those who gave it a thumbs up should retract them. The set {unames()} doesn't necessarily contain the prefixes; it merely coincidentally contained them in the cases that I tested. I've thought of a way to correct this, which I'll post later today; I need to go to sleep now.

First 354 355 356 357 358 359 360 Last Page 356 of 709