Mac Dude

1506 Reputation

17 Badges

10 years, 247 days

MaplePrimes Activity

These are replies submitted by Mac Dude

@Carl Love @acer Thanks very much to both of you... this will go a long way towards solving my issue.


edit: spelling

@mmcdara The construction

0.78*Unit('kg')*`CO__2`*`per kg`

will lead to a missing-operator error when evaluating 'per kg' (which sooner or later it will), or if 2-d input is used an implicit * will be added, also iffy is either per or kg get assigned a value. In fact, I have had similar typesetting issues (trying to typeset something like "deltan" where delta was to be the greek letter". Never got a good solution.

It may be possible to define a unit "`CO__2`*`per kg`" and use that for typesetting purposes. I have not tried that.


Since you seem to have access to an old version of Maple, can you save the sheet as a .mpl file? In recent versions of Maple this would presumably be exporting as Maple input.


@Anthrazit At this point the scale of the whole thing becomes important. If you are looking at a sizeable and extensible system an approach using XML may well be the right choice even if in my limited experience XML-based systems can be quite slow (and I hasten to add that I have zero experience with XML and Maple). If your needs are limited and you know already what needs to be stored and transferred then I think a simpler approach may well be sufficient. I have not seen enough of your needs, and probably do not have the experience to be of much more help here.


@DoingMath2018 If you want docs written for people familiar with programming, consider the Maple Programming Guide available on the MapleSoft site. I have found it to be an excellent source.

If you don't mind using emacs, consider Joe Riel's maplev package for emacs. It is a nice editor for Maple code with (some) syntax coloring, indentation and other niceties. This is what I use for my large packages.

Beyond that, CAS are very complex tools. Invest the time to learn one. It'll pay off.

I hope this helps,


@Anthrazit I did not read this latest reply of yours before posting my suggestion. But fundamentally, the mechanism I outlined there could work since the material properties you transfer are probably not that many (i.e. not large arrays).

In reading through this, I am wondering whether a modular approach could also work. The sheets that deal with material properties are probably static in the sense that, once a material is defined, its properties don't change (and if things like temperature sensitivites are relevant you can save these as expressions). So you could have a module that has a number of procs that return material-specific modules or records for use in your sheet doing the structural analysis. Handing info back to the materials section would require some thought.

A code snippet showing how you could implement this:

export Concrete;

    return (module()
                # here is the code making up your module named Concrete
                # can be constants, functions, submodules, you name it.
                # A Set proc. can be used to set certain properties
               end module)
  end proc; # Concrete

end module;

You load the module and access its members with


(whatever would be a member of Concrete.)

I hope this helps,


I wrote the answer at the time and I believe it is still valid.
I suggest to try. Read the whole thread as there are intricacies that you need to watch out for.

I am not aware that Maplesoft changed the Help file format since the major change made for 2015.

Mac Dude


@Pascal4QM , @ecterrab , @Kitonum Thanks much everybody for the quick answers.

I did in the meantime do some work along the lines that Kitonum suggested; in my case the problem is that it ends up with somewhat messy expressions that do not elucidate the underlying structure and symmetries I atrongly expect to be there.

I shall need to dig into the Physics package. I did some work with it a long time ago but eventually for my work (which isn't quantum physics by a long shot) I really did not need it. But now I am motivated to try again.

Stay safe & healthy,


I'd like to commend Maplesoft for doing his. I'd also like to report that I could put this to good use as I will have a Summer Student this year, and he is putting the time to good use by learning the physics behind his project now. So I was able to point him towards the Maple Student License and also towards the Accelerator Physics course that I and a colleague wrote a number of years ago and held twice at the US Particle Accelerator School ( While I will try to get him a paid Student License so he can keep it; the free license allows us to get a head start until his internship actually starts and allows him to get familiar with the program.

Many thanks,

Mac Dude

PS: I'll point him to Edgardo's course also, which has been quite helpful for my teaching activities.


Harsd to tell without having  the Maple program that generates the plot. Checking one of the example plots in help:plot3d I can see that 2015 generates vector data, i.e. a PostScript program. Maybe 2017 adds a big bitmap? I don't have my 2017 version around so I can't check right now. You could look at the eps files with a suitable editor (emacs, Textwrangler).

There are proggrams around that can compress a pdf; usually at the expense of some quality loss.


If one looks at this naively, it is a 5-dimensional construct; 4 parameters with ranges (x,y,z,t) plus the value u. To do a carpet or a space curve you need to fix two variables. Or you encode the u value in the color onlly and plot against x,y,z (and I don't know how to do this, but I think it can be done). If t is time you could do this as a movie generating one plot for each value of t and then plots:-display(seq of plots,insequence=true).


@acer Yes, I have four different instances of the pair of tables Beams and Beams2. What I did not elaborate on was that they are generated by the same code, but from different input conditions. These runs are proceeding in parallel on different cores of the same machine. I use something like maple -c BeamIndex:=1 <programfile> when I start the runs (with obviously different values for BeamIndex). This is how I generate the filenames. Since these processes run in parallel, using separate files avoids access clashes that would be unavoidable if all processes wrote to the same file.

I suppose I could generate different variable names and use assign to generate them, but I don't like doing that, debugging that is always a PITA.

Yes, I think your suggested additional tables is probably the way to go. I have also been thinking about using doubly indexed tables e.g. BeamTable[procno,turnno]. But your proposal may be easier to do & implement. The reason I asked is so I could avoid missing a nearby solution I wasn't aware of... but it does not look like there is.

Incidentally; this is now going way beyond my original aim. Originally (when I asked my pervious question) I wanted to separate the CPU-heavy part from the graphics (visualization) part. Once I got that going I realized that I had a framework for running the CPU-heavy part in parallel on my MacPro. Splitting the job & running it works; my challenge is to get access to the results (and I know using LibraryTools:-Browse() that the results are there in the way I anticipate them to be).

Anyway, thanks much for your insight,


@acer So I am able to indeed store my Record & retrieve it in an unrelated Maple process. So +1!

There do seem to be weird and undocumented restrictions at to what can be stored: Record: yes. Scalar: yes; Vector: No. Array (of Records): No. Table (of Records): yes. Element of an Array (of Records): No (!). Is there any rhyme or reason to this; or at least documentation? You are absolutely right that I have to collect many Records in a structure under one name, lest they become unmanageable; eventually I want to treat throusands of these Records per run. With a Table this seems feasible.

You mentioned that nested Records may cause issues; I actually have those as well but they have different functions than the ones I am attempting to deal with right now. In time I'll probably get to such things.

Anyway; I can see this as quite a powerful feature of Maple & am looking forward to use it more often.



Well, maybe you could mention your platform (Windows/macOS/Linux, os version), which version of Maple is involved, and under what exact circumstances you experience slowness. I have experienced some slowness of Maple 2019 on macOS Mojave in the presence of anti-virus software.


@acer Ah, the missing piece for me was the ability to reference by its name the content of a .mla file. Thanks much for taking the time making the example.

And I realize I wrote very sloppily equating a .mla file with a package, which I know it isn't. I am using and making packages all the time, which I store in .mla files. I just never considered .mla files for other items. I do wonder if I just overlooked it or the docs indeed nowhere mention how to retrieve something out of a .mla file. Seems like it should be prominent.

I am also quite familiar with Records being special cases of a Module. In some of my packages I even have the same object (object in a generic sense) being implemented as either Record or a Module depending on its detailed properties and behaviours.

Anyway; I think your proposed approach will get me where I need to go, so please accept my thanks,


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