Mac Dude

1506 Reputation

17 Badges

10 years, 247 days

MaplePrimes Activity

These are replies submitted by Mac Dude

@acer Interesting idea. I am familiar with .mla libraries for sure; in fact most of the code that makes these Records is in a big .mla library.

If the .mla is a package, then with(); loads it and makes its exports available in the namespace.

With my Records, I am not sure how I can get at them. with() won't work because there is no package. A quick check in Help does not reveal any mechanism how to retrieve stuff; only how to add or remove things from libraries.

So, how can I get at the Records?


@Stretto I am kind-of curious about your remarks regarding memory issues of Maple. I don't think I ever ran into real limits even on 8 GB systems (and I have analyzed datasets that run 100s of MB from a number of experiments in Maple, and I use it to model rather complex physical systems). I have been tripped up by Maple's ability to do symbolic math: if I wanted a numeric result but accidentally haad an unassigned name, Maple would merrily try to create maybe a huge expression, or maybe a Vector with thousands of entries, each one a long expression. So I learned the hard way to e.g. declare dataype=float when I expect an array of numbers. IMHO Maple is qualitatively different than "just another language" (like e.g. Python, C and its descendants, or so). True, with its power come hard-to-find bugs; and sadly the debugging facilities are a bit stone-age. And Maple has bugs for sure, although many a "Maple bug" I would despair over eventually turned out to be my lack of understanding. But, memory usage in itself is not a major issue of Maple.


@Carl Love Your 3rd example can easily be made to work in as far back as Maple 2015:

Last:= module()
local _Last,ModuleApply;
export Init;

ModuleApply:= proc(k::posint)
  _Last:= 4*_Last+k;
end proc;

Init:= proc(N)
 _Last:= N;
end proc;

end module:

seq(Last(k), k= 1..10);

So the principle behind the code already existed in earlier versions of Maple. The important point is that, by declaring Last as a module instead of a proc (and using ModuleApply to invoke it), the variables (i.e. _Last) are local to the module and are persistent. On one hand, this is a powerful technique. On the other hand, reliance on persistence of local variables can make code harder to understand and debug. So I somewhat shy away from ModuleApply in favor of using procs explicitly exported by the module (like Init in the example).

Modules are a powerful feature of Maple that allow creating very large and complex packages in a well structured and maintainable fashion. Since they can be programmatically created, a single command can generate a complete model of e.g. a physical system with chosen parameters and properties, and with methods (i.e. procs) to interact with it. And the same model can run numerically or symbolically depending on the parameters given. It is the feature that got me hooked on Maple.


@Carl Love This (not needing to close the Maple application upon a kernel crash) is my experience as well. It would be even nicer if the worksheet could restart the kernel & attach to it without being closed and re-opened (kind-of like Jupyter); but that does not seem to be the case.


@Stretto What exactly are you trying to achieve?

If it is debugging, I'd typically only print the vars I suspect are not what I would expect. Yes, possibly a ream of lines, but better than nothing.

If a (long) loop errors somewhere in the middle I have had success with putting in print statements printing the loop index at strategic places. This would tell me how far things got an narrows down where the error occurs. Knowing the index at the error allows figuring out what went wrong, since one can then inspect all variables as they are at that point.


I can corroborate this claim. In fact, I was composing an answer to the question. When I hit "submit", I got a "Page not found" error. After that, the question was gone.

Mac Dude

A bit hard to tell what you need since you did not upload the actual sheet (hint: the green up-arrow lets you upload your worksheet), but the _Ci are the constants you will usually find from your initial conditions (assuming you are solving an initial-value problem). E.g. the general solution for phi=0 and its derivative (for a 2nd-order problem).

The term phi=phi in the solution indicates that the solution does not depend on phi. IOW, you can pick any value (angle).

But you really should upload your Maple worksheet.


@HS Yes exactly.

It is actually a nice feature.

However, if you create a worksheet from scratch and then save it somewhere, currentdir is not set to the directory where you save it but remains at its default (Maple's framework directory on macOS). You need to close and reopen  the sheet to get currentdir to change automatically.



@Carl Love Carl, thanks much for the details on why the uneval quotes work. I actually did not know that.


Do note that, when opening an existing worksheet, Maple sets currentdir() to the home directory of the sheet.


I get that dialog when Maple's kernel crashes, or when I kill it deliberately.

Try running a simple "1+1" type worksheet and see if the kernel actually starts up.


@eithne For me the MaplePrimes complaints came too late: I already upgraded (to deal with another issue I found in Maple 2019.0).

The problem in 2019.2 of not running the .mapleinit file is fatal for me: I don't get libname updated (to get at my packages) and therefore I cannot load my packages.

So I have to revert to Maple2018, since 2019.0 of course is gone now for me.

I really hope this gets fixed asap. Otherwise I'd have to consider terminating my subscription.

SCR was filed.

Mac Dude.

Edit: Ok, so now I realize that I had already forgotten what Rouben said 4 days ago... and I even answered to it. This is not good!

Oh well...

@Rouben Rostamian  Rouben, thanks for posting this; that bug is a bit of a killer for me.

Will hold off on upgrading.


@acer Using labels fairly often i can confirm that is exactly the behaviour of Maple.

Using equation labels has a significant advantage over using %, %% etc: You always get the same result. % only works well if it refers to the previous result within the same execution group. If it refers to the previous execution group then % is something different if you evaluate it again; you pretty much have to run the whole notebook every time. Equation labels always refer to the labeled result. Moreover, equation label references get recalculated if you insert expressions, IOW if the label of the result you are referencing changed, all your references also change.

I find equation labels very well implemented and use them regularly. I only use % very rarely and always within an execution group. %, however, can refer to suppressed results; whereas labels cannot.


@dingtianlidi Actually, if the problem can be transformed, it is much more efficient to use the product of Laplace transforms.


2 3 4 5 6 7 8 Last Page 4 of 42