Joe Riel

9660 Reputation

23 Badges

20 years, 8 days

MaplePrimes Activity


These are replies submitted by Joe Riel

@Christopher2222 That works for me; I copied and pasted it directly into Maple and it returned the modified procedure as expected.

@Robert Israel I should have qualified my blanket statement---it cannot be done without converting to/from an inert form.

@Robert Israel I should have qualified my blanket statement---it cannot be done without converting to/from an inert form.

No, that cannot be done. 

Please show the command you used to subs i<50.

No, that cannot be done. 

Please show the command you used to subs i<50.

@Christopher2222 The reason you cannot use subs to match a local variable in the statement sequence of a procedure is that the name doesn't actually appear in the structure that Maple uses to represent the statement sequence. To better understand that, do

dismantle(proc(p) local i; global g; return [p,i,g]; end proc);

PROC(11)
   EXPSEQ(2)     # parameter sequence
      NAME(4): p
   EXPSEQ(2)      # local sequence
      NAME(4): i
   EXPSEQ(1)
   EXPSEQ(1)      # statement sequence
   RETURN(2)
      LIST(2)
         EXPSEQ(4)
            PARAM(2): [1]
            LOCAL(2): [1]
            NAME(4): g
   EXPSEQ(1)
   EXPSEQ(2)       # global sequence
      NAME(4): g    
   EXPSEQ(1)
   BINARY(2)
      1
   EXPSEQ(1)

I annotated a few of the sequences.  See ?proc for a description of all the elements.

@Christopher2222 The reason you cannot use subs to match a local variable in the statement sequence of a procedure is that the name doesn't actually appear in the structure that Maple uses to represent the statement sequence. To better understand that, do

dismantle(proc(p) local i; global g; return [p,i,g]; end proc);

PROC(11)
   EXPSEQ(2)     # parameter sequence
      NAME(4): p
   EXPSEQ(2)      # local sequence
      NAME(4): i
   EXPSEQ(1)
   EXPSEQ(1)      # statement sequence
   RETURN(2)
      LIST(2)
         EXPSEQ(4)
            PARAM(2): [1]
            LOCAL(2): [1]
            NAME(4): g
   EXPSEQ(1)
   EXPSEQ(2)       # global sequence
      NAME(4): g    
   EXPSEQ(1)
   BINARY(2)
      1
   EXPSEQ(1)

I annotated a few of the sequences.  See ?proc for a description of all the elements.

My mistake.  Because i was declared as local, you won't be able to substitute for it in that way.  You can use ToInert/FromInert, or possibly just substitute for the 30, if it only appears once.

My mistake.  Because i was declared as local, you won't be able to substitute for it in that way.  You can use ToInert/FromInert, or possibly just substitute for the 30, if it only appears once.

By "naked differential" I meant the "dx" and "dy" appearing as algebraic units in your original (handwritten) examples. One doesn't normally use those, as such, in Maple.

As Robert alluded to, I don't use labels, etc, when posting here because in doing so it makes it difficult for someone to cut and paste the output into Maple.  Also, I frequently use the command line (tty) version of Maple for quick computations; it only allows standard ascii input. You should be able to copy and paste the stuff I posted, however, you will have to delete the output sections (it should be clear, from context) which is the output. 

By "naked differential" I meant the "dx" and "dy" appearing as algebraic units in your original (handwritten) examples. One doesn't normally use those, as such, in Maple.

As Robert alluded to, I don't use labels, etc, when posting here because in doing so it makes it difficult for someone to cut and paste the output into Maple.  Also, I frequently use the command line (tty) version of Maple for quick computations; it only allows standard ascii input. You should be able to copy and paste the stuff I posted, however, you will have to delete the output sections (it should be clear, from context) which is the output. 

@soechristian What do you expect the answer to be?  1? Using the Iverson bracket convsion, maybe an expression equivalent to  [ i::integer and 1 <= i and i <= n].

@soechristian What do you expect the answer to be?  1? Using the Iverson bracket convsion, maybe an expression equivalent to  [ i::integer and 1 <= i and i <= n].

@LijiH I assume you entered the input as 2D math.  One way to paste it here as text is to right click on the text, and select 2DMath -> Convert To -> 1D Math from the context sensitive menu. Then copy and paste that here. I normally use 1D math, so don't have to do the conversion.

@LijiH I assume you entered the input as 2D math.  One way to paste it here as text is to right click on the text, and select 2DMath -> Convert To -> 1D Math from the context sensitive menu. Then copy and paste that here. I normally use 1D math, so don't have to do the conversion.

First 72 73 74 75 76 77 78 Last Page 74 of 195