Mac Dude

1566 Reputation

17 Badges

12 years, 355 days

MaplePrimes Activity


These are questions asked by Mac Dude

Maple has had object-oriented features since about version 15, implemented with modules and records and the ability to define exports of these. Methods can be defined and called using module:-Method() and properties in a similar way including hierarchical constructs. Overloading of functions is possible, although I have run into trouble trying to overload build-in function. While this mechanism is not fully oo, I have found it enormously helpful for larger projects and a distinguishing feature of Maple.

More recently, the option object was added to modules. What are the true new functionalities? I see that the syntax for methods has changed (Method(object,arguments) rather than module:-method(arguments)) but I do not see how that is an improvement. I guess there are also now bona-fide constructors, doing what used to be done with a module factory (a proc that returns an instance of a module). And Object(object) seems to do what copy(module) does.

I am conceptualizing a larger package that will make use of the oo features of modules. I know I can write this using the established :- syntax using modules. Are there any benefits to using the newer objects rather than modules and records (& I know that all these are essentially modules)?

TIA,

M.D.

I am trying to use the element properties Maple has in its ScientificConstants package. I am running into problems with the density of gaseous elements:

with(ScientificConstants);

Units:-UsingSystem(); # returns SI as expected

GetValue(Element('Si',density)); # returns 2329.0000 [kg/m^3] which is 2.329 g/cm^3, which is correct

GetValue(Element('H',density(gas))); # returns 88 [kg/m^3], which is incorrect.

PDG gives the density of hydrogen as 8.376E-5 g/cm^3, which is 0.08376 kg/m^3.  

Even more crazy for Krypton:

GetValue(Element('Kr',density(gas))); # returns 3677.000 [kg/m^3]. Heavy little buggers, these Kypton atoms! Should be 3.486 in the same units.

What gives? Am I missing something here?

Mac Dude

 

 

I would like to create a Maple Workbook of my Lattice Package so I can put it on MapleCloud. I had an email exchange with Daniel Skoog from Maplesoft about this, and he even sent me an example that looked easy enough to adapt to my purposes. Alas, it does not work. Here is the code I wrote to assemble the already extant files:

restart;
                "Maple Initialization loaded..."
# Build Lattice workbook following example from Daniel Skoog, MapleSoft:
currentdir();
 "/Applications/Math_Calc/Maple 2015/Packages/Lattice/Lattice

    Version 1.1.0 release files"
# We have all files already from the App Center submission, so just assemble the workbook
PackageTools:-Create("Lattice.maple",\
"MLA file"="Lattice.mla",\
"Lattice.help",\
"Source"="Lattice1.1.mpl",\
"Build procedure"="Lattice1.1.mw",\
"Manual"="The Lattice Package Users Guide.mw",\
"Release Notes"="V1.1 Release Notes.rtf");
Error, (in march) unable to attach worksheet file The Lattice Package Users Guide.mw


When I look at the created workbook (Lattice.maple), the only members included are Lattice.help, the Build procedure Lattice1.1.mw and the source file Lattice.mpl. In particular, Lattice.mla is not there, which is the most important one.

What am I doing wrong? What does "march" (which sounds like machine architecture) have to do with it??

I also don't quite know how to "install" it. I assume I just put the whole workbook into a directory accessible through libname ?

Mac Dude

PS: I could have sorted this privately with Daniel, but this may be of interest to others as well so I hope he'll answer through this forum.

Lattice1.1_workbook_maker.mw

I am dealing relatively often with vector functions of a variable vector. Specifically these are (in general nonlinear) mappings from R^6 to R^6, and often I have one or more extra parameter that controls the map.

Often I'd like to get a first-order expansion of these. The general scheme I use to do that is to map mtaylor over the components of the function vector. Like so:

map(mtaylor,F(<x1...x6>),[x1...x6,p1...pn],order);# F(<...>)  is  <F1(<..>)..F6(<...>)>

This works fine until I hit a situation where the Taylor expansion for one of the parameters p does not exist. Then it bombs. Actually, I often can use assumptions on the parameters to prevent bombing; however, in that case I often get the unchanged function F returned. This is Bad as the whole thing happens in a loop with many concatenated functions F, and now expression swell makes Maple lock up.

In at least a significant subset of these functions, the series command works where taylor fails. "mseries", however, does not exist in Maple. So my question is whether someone has written an "mseries" command for Maple. I know how to do it in principle (but caution is needed to make it work as intended), however, I wonder whether either someone has done it before and might share his/her code, or whether there is a reason why "mseries" actually cannot work.

TIA,

Mac Dude

 

I am writing a package to define a few Records and collect some quantities and formulae to do some arithmetic with.

At some point I started running into a severe problem: Each time I want to use one of the exports form the module, the Maple kernel dies with a "Stack limit exceeded" message. The issue is: This seems to happen only on Maple 2016. I had some issues in Maple 2015 but that got sorted by rewriting some stuff. I never had any issue like that with Maple 15. I went as far as commenting out most of my .mapleinit code to make sure that did not cause issues. The code works as intended in Maple 15 and in Maple 2015.

I am posting this here and am asking others to see if they can reproduce this. Needless to say I will SCR this. But I actually need to get this to work.

The error can be triggered by simply entering

Booster;

after loading the package. Needless to say, it should just echo the name "Booster", to get more one would need to enter eval(Booster) (due to the last-name evaluation rules).

Thanks,

M.D.

BooMBA.mw

4 5 6 7 8 9 10 Last Page 6 of 23