Joe Riel

9660 Reputation

23 Badges

20 years, 4 days

MaplePrimes Activity


These are replies submitted by Joe Riel

@peter137 Glad we could be of help. A downside to this approach is that if you cut and paste the output, the result is nonsensical. Some of the functionality can be salvaged by using the following alternative procedure:

`print/Unit` := proc(u)
uses Typesetting;
   mstyle(eval(Typeset(EV(u)),mi=(n->mi(n,'italic'="false"))),'fontweight'="bold");
end proc:

Because that typesets the base units as MathML identifiers, rather than text, cutting and pasting will convert the unit to a product of symbols rather than a (nonsensical) product of strings. 

It looks like a right-angle to me.  Both on this web page and in Maple.

The editor is available in a code-edit region.  To insert one into a worksheet, click Insert -> Code Edit Region.  The editor is also available (and used automatically) to edit the startup code region (click the black gear-like symbol on the toolbar).  If you insert a code edit region into a worksheet, use a right-click to open a context-senstive menu that allows the code to be executed.

@Carl Love That approach assumes the vector coordinates have the same form.  It won't work if, say, one vertex was [5.2, 1.2] and another was [5.20, 1.2].  One way around that is to convert all the numbers to rationals.  You can do that with convert(Pts, rational, exact).

@Carl Love Here's one way to do that. I made the units bold to increase their visibility. If you prefer color, change the 'fontweight' = "bold" argument of mstyle to 'mathcolor' = "darkgreen".  

`print/Unit` := proc(u)
uses Typesetting;
   mstyle(subs(mi=mtext, Typeset(EV(u))),'fontweight'="bold");
end proc: 

This procedure should be used only in the worksheet interface. One way to do that is to add a conditional to it to check the interface (via IsWorksheetInterface('Standard')) and then return the appropriate output.  Alternatively, rather than calling that procedure each time a unit is displayed, the conditional could go in the Maple initialization file.  For example, in Linux I can add the following to the ~/.mapleinit file

if IsWorksheetInterface('Standard') then
   (* put assignment to `print/Unit` here *)
end if:

 

@Carl Love I caught the n-1 error shortly after posting, but forgot about the 1/2.  Both have been corrected. I prefer your method of appending the first point versus mine of issuing an error. I wouldn't type the elements as realcons; the procedure also works symbolically, which is nice.

You might consider using the Iterator package I created and uploaded to the Maple Application Center.  It uses compiled code to generate iterations and returns them in a mutable array so the memory usage is minimal.  Alas, the routines were not designed to be readily parallelized, though some of them could be.  

Here is an example of using it to count the number of acceptable combinations in the example that Darin used

with(Iterator):
C := Combination(60,5,accept=(V->andmap(type,V,even))): # this creates an iterator
add(1, c = C); # each iteration assigns c a Vector with the current combination
                                   142506

That took 16 secs on an i5. 

@Alejandro Jakubi As Alejandro mentions, the version there is dated. mdcs has improved quite a bit.  It now permits debugging in the actual source code (not just the interpreted code), provided you have the source code (of course). I'll upload it to the Maple Application Center and create a post when it is available. 

@Alejandro Jakubi As Alejandro mentions, the version there is dated. mdcs has improved quite a bit.  It now permits debugging in the actual source code (not just the interpreted code), provided you have the source code (of course). I'll upload it to the Maple Application Center and create a post when it is available. 

I/m curions, how did you insert the typeset math in the original post?  Looks like TeX, is that an embedded pdf?

A clever and useful technique, thanks Carl.  

Apropos Summation, there is an ?integrate command (aliased to int), though I suspect everyone uses the short form

A clever and useful technique, thanks Carl.  

Apropos Summation, there is an ?integrate command (aliased to int), though I suspect everyone uses the short form

@Carl Love The &^ operator stands for the wedge product (exterior product for differential forms).  It is used in the ?liesymm and ?difforms package (the former is usally easier to work with).  The wedge product is also available in the ?DifferentialGeometry package, though there the neutral operator used is either &wedge or &w (the latter is used in evalDG). It should be possible to use the DifferentialGeometry package to apply Stokes' theorem, as I did manually.

@Carl Love The &^ operator stands for the wedge product (exterior product for differential forms).  It is used in the ?liesymm and ?difforms package (the former is usally easier to work with).  The wedge product is also available in the ?DifferentialGeometry package, though there the neutral operator used is either &wedge or &w (the latter is used in evalDG). It should be possible to use the DifferentialGeometry package to apply Stokes' theorem, as I did manually.

@Paul Any speculation on what accounts for the difference?  Has the lineup been consistent?  Are the individual stats down this year (you used stats from last year)?

Edit: I should have asked if the stats are up this year, since the  actual performance is better than predicted.  If that is the case, it doesn't bode well ... 

First 49 50 51 52 53 54 55 Last Page 51 of 195