Joe Riel

9660 Reputation

23 Badges

20 years, 4 days

MaplePrimes Activity


These are replies submitted by Joe Riel

@Preben Alsholm Yes, subsindets and evalindets are now builtins; as such they are considerably more efficient. However, I don't know that the changed behaviour was intentional.  Thanks for the bug submission.

@Kitonum I've occasionally---but only occasionally---wished that the step argument to seq worked with an expression form. Note that it is probably a good habit to use numelems(A) rather than nops(A); the latter won't work with a Vector. Rather it will work, but the result is not expected.

@Kitonum I'd probably use the variation

[seq(a[1]/a[2],a = A)]

@acer I wasn't aware that ifelse existed; I've always used `if`.  The former is slightly easier to type, I'll have to consider it.

@jiggity I get a plot using your latest. Try evaluating the following at various times, does it return a list of three floats?

eval([x[1,1],x[1,2],x[1,3]](t),sol(200));
 [-8.167984673049948e8, -3.526050543133094e8, 4.612993607365726e7]

Does that extend to deleting spam?  I flag spam when it appears, but wonder if I could kill it. If so, how?

@acer Thanks for that; I'm sure I'll miss the less than sign a few times.

I've been using Chrome for a while and generally prefer it to Firefox, but may try it with this site. Thanks for noting the difference, Carl.

To simplify the process, I added the "Edit with Emacs" extension to Chrome, then installed edit-server on Emacs and wrote procedures to convert to/from html entities in the selected region. Now, when posting, I can select html mode, then click the edit button (that appears because of the Chrome extension) and am editing the html code in an Emacs buffer. Much nicer.

Nice writeup.  A comment on the examples of map. Because the expression being mapped over is algebraic, rather than a more conventional sequence-like expression (list, set, Vector, etc), one has to be careful about the edge cases.

For example,

 map(f, 3*x+y) returns f(3*x) + f(y),

 map(f, 3*x) returns f(3)*f(x).  

The point being, if you are using map in a procedure and applying it to what you expect to be a sum, but is actually a single expression (because of cancellation or whatever), the result is, mathematically, completely different. The maptype procedure could be used to avoid that.  

  maptype(`+`, f, 3*x) returns f(3*x)

  maptype(`+`, f, 3*x+y) returns f(3*x) + f(y).

@acer Thanks, that works well. Losing the white space has been keeping me away from this site, it was such a pain to have to insert it manually, particularly after the third revision 8-).

@Carl Love That can work for very simple packages, where each procedure is standalone.  It does not permit calling one module procedure from another. 

I recommend not writing package code in Maple worksheets, which is too limiting for that---use the worksheet for doing computations with your package.  Save the source in text files and build the package either via shell and/or maple scripts.  The advantage of text files is that they are small, robust, editable with your preferred editor, and permit using version control.

The one nice feature of the old table-based packages is that, for other users, they can be readily modified without the source code because all the procedures are globals. However, for the most part that isn't much of a benefit. Writing structured packages using modules is much nicer.

@Bendesarts Note that the structures you are working with are sets, not lists. You should convert the original to a list convert(some_set, 'list'), then map it.  Alternately, use the subsindets command I suggested later in this thread.

@Carl Love Mostly superfluous. It can have an effect, e.g y(t) = y(t) + x(t).

@Bendesarts 

One way is zip(`=`,ListVariables, ListVariablesMod). 

With newer versions of Maple you can do ListVariables =~ ListVariablesMod.

@AmirHosein Sadeghimanesh Your example could be better. The kernel of that ring homomorphism is clearly zero, regardless the base ring (here C).

A relatively nice way to pass specific keyword options is with _options['keyword'].  For Jacques case, that would be _options['ctx']. Note the forward quotes (necessary).  More than one keyword can be included in the indices: _options['keyword1', 'keyword2'].

First 39 40 41 42 43 44 45 Last Page 41 of 195