Mac Dude

1122 Reputation

13 Badges

7 years, 243 days

MaplePrimes Activity

These are replies submitted by Mac Dude

@tomleslie This may be a deficiency of Windows, where the HiDPI support seems not quite there yet. I have several Retina-display Macs as well as a non-Retina monitor, and the interface elements come out right on all of them, just with higher resolution on the Retinas. It will even work in a mixed environment. I am not sure this is something Maplesoft can fix; I think it is a system issue. But then, what do I know about Windows.

Mac Dude

PS: Retina is Apple's moniker for HiDPI displays.

@Preben Alsholm Thanks much, Preben.

My own work around for the time being is to use the densities from another table that I got from the PDG. This works for me as I am building a separate table anyway to include some properties not in Maple's own system. So I take those values & modifyElement to put these numbers and their units in, essentially overwriting Maple's numbers.


@Ronan Hmm... I am not in a position to check this right now. Some things to check upon: In libname, I have my own directory first, so my routines cannot get masked by Maple's routines. I don't think that is an issue here, however. Your "with(Rtestm)" call returns [Rtest] which would indicate that the with() succeeded, but somehow Rtest does not get the assignment.

I do wonder whether you would need to use the ModuleLoad function. In fact, I first thought one would need to use that but found that it wasn't necessary in this case. you can read up on ModuleLoad in help until I get around to checking this further.


@Ronan Here is a minimum working example how to read a proc into a module:


restart; # the message is from my own .mapleinit file
                "Maple Initialization loaded..."
test(); # not defined  so just returns unevaluated
  export test;

     read("test.mpl"); # This reads (and executes!) test.mpl
end module;

test(); # now it is defined
                        "this is a test"


test.mpl looks like this:

  print("this is a test");
end proc;

As for using an external editor, that is obviously your own call. Personally I use Emacs and Joe Riel's maplev.el package for Emacs. maplev mode does syntax coloring and code-indentation; Emacs allows to split a window; all very convenient features when coding. But then, I have known Emacs for a long time... But you can presumably also use Notepad on Windows.

I find editing in Maple and then writing the code out not very satisfactory. Small packages I just keep in the Maple environment & save directly to the .mla file (I call that "compile it" although nothing of that sort is going on), keeping the .mw file in case I want to make changes whereas large ones I do in Emacs.

I am surprised about the mess with the directory separators in Windows. Maple used to deal quite well with the old ":" separator in Max OS 9 and earlier so it certainly knows how to handle different separators. Maybe it is just a bug? I don't do Windows so I don't know.



@Preben Alsholm Thanks much for the investigation & explanation & SCR, thus sparing me the effort of doing it. I do wonder how many people are using these constants... maybe not so many. But be that as it may, if it is in Maple, it should be correct so hopefully they fix it with 2017.3. It should not be a difficult fix.


@Ronan Your problem with the dot is simply syntax: you need to specify filenames as strings i.e. use double quotes (").

I am uploding a Maple worksheet showing how you can save and read your function Antisym, and also how you can wrap it into a module (RatTrig), declare it a package, save it as a .mla file, and then use Antisym as as a member of the RatTrig package. You need to declare the function as export to be able to use it. You can have many procedures and even, as John Fredsted suggests, have modules within modules to get a hierarchy of functions, although I do suggest starting somewhat simple until you get the hang of it. If you want to delve deeper get the Maple Programming Guide (from Maplesoft's documentation area), it is invaluable if you want to do more programming in Maple.

Note that this sheet uses my own defaults esp. for libname so you need to adapt it before use. I set libname in my .mapleinit file.

And I use Mac OS X. It looks like you use Windows so your file specs look different, esp. you need the backslash instead of slash as directory separator.


@tomleslie With MathType it works, I do this often, although usually into Ppt.

In Word, select "Insert MathType Equation" (which you will be able to do with MathType installed correctly).

An empty MathType wondow opens.

In Maple, select your equation & "Copy as MathML"

Paste into MathType.

There are some issues with this: First, Maple variables & such appear in blue. Looks kind-of pretty but usually unwanted. Trivial to fix in MathType. More annoying is that everysooften I get Greek letters as something approaching ML markup: β or similar where a Greek beta should be. So I have to select & paste the correct character by hand. Not nice.

At least the general layout is preserved.

There are instructions on the DesignScience website. Also, I found their cust. service to be quite responsive.



Doing as you propose would have far-reaching consequences.

E.g., often one takes sin(x)=x to first order. This would lead to confusion if sin would take degrees as argument. Also, the radian has unit [1]; if you are doing dimensional analysis then the degrees obfuscate the issue significantly, to say nothing about Taylor series.

While I am sympathetic to the plight of students; if they do math sophisticated enough that Maple is a viable tool, either as a teaching tool or to be used in analysing math problems, then they should be taught to grasp the idea of radians. In the end, learning that a right angle is Pi/2 vs 90 deg is maybe not that big a deal.

I grew up with degrees. This did not make my life in physics easier. On the plus side, becoming bilingual with units (as in degF vs degC, inches vs metric, and rad vs degrees) is actually quite a useful skill.


@vv Slick! I love it.


@Rouben Rostamian  Let's see... assume t counts the iterations.

Then the first equation calculates y[t+2] as a function of y[t+1] and x[t].

The second one calculates x[t+2] as function of x[t] and y[t+1]...??

Turns out when you play this through you can's do the next iteration as x[1] never gets calculated. You can chose x[1] of course also, but then this becomes a rather weird system. It seems to need an internal state to work.


I am also hopelessly confused by the OP's writing of the function e(x). It seems it is being redefined as E(x)..?? and e is declared global... a mess.

To the OP: First, make sure your map equations are written correctly. The way you have them does not look right.

Then you need to write the procedure that gets handed to DataPlot as Map. Obviously z refers to either a two-element Vector or to a complex number, so the mapping functions have to be rewritten accordingly. There is probably someone here who can help with that, but with the way the mapping equations are written it seems not right. If this is really to be something like a phase-space plot for a dynamic system then Map should only depend no x[t] and y[t].

Then: Rewrite your e(x) function so it can be understood. DON'T USE GLOBALS!! The only global for which there is justification would be N as it is basically a constant. Anything else needs to be an argument if really necessary. And what is this business of e and E (which are declared as globals in some functions)??




@nm you are absolutely correct; this issue will occur when there are Maple-generated symbols involved. As I said; I haven't run into this, but I do see your point and it is a valid one.



You are not telling us what u is. But in the call to NonlinearFit you enclose u in square brackets which makes it a list; that seems fishy. For NonlinearFit to work, the function has to evaluate to values that can be compared to the dependent values of your data set (i.e. veloc in your case). If these are anything else than simple numbers I don't know whether NonlinearFit will work; you may need to use one of the other optimization routines and build your "penalty function" (i.e. the sum of the squares of the differences) yourself.

You also don't give us your data set so we cannot try this ourselves.




@optoabhi Attachment? Also, read the addition I just edited into my answer.



@leafgreen Actually, it is the other way around. First there were indices. Printing them as subscripts is actually quite a natural way and how it is often done in paper-pencil math. But sometimes people want to use a subscript that is not an index. Maple only fairly recently addressed that typesetting desire by introducing the double underscore. Since a single underscore is a valid character in a name they pretty much could not use a single underscore for that, lest they would break tons of extant code. Double-underscored names are what Maple calls atomic, meaning these are just names as any other one.

The reason your original function definition fails actually makes a lot of sense: a parameter to a function is either a Vector (say) or a scalar. For a scalar argument the indexing makes little sense; it only would acquire an index by being called in that way. So you can call your parameters x1, x2 etc. without any loss. When you call the function you can say f(x[1],x[2],...). and get it pretty-printed nicely. Or you define the arglist in terms of x and y and use x[1], x[2] etc. in the formula; that works also.

BTW, do not use a name as both indexed name (x[1]) and non-indexed name (x). Confusion will arise as Maple will treat x as a table & x[1] as an entry.

Maple has weirdnesses. This is not one of them. It is quite logical, dear Watson.


@DSkoog Thanks much again. You are right, Install has an option where, which can be either the users homedir or the Maple installation directory. Feels slightly restrictive but is ok for my purposes. I actually now agree with your recommendation about the location for the libraries except that historically I have put them into Maple's installation directory for a long time so I'd need to move stuff... maybe I am too lazy to do this... it is actually not so difficult since I set libname anyway... oh, well.

So, now I need Maple2017.2 with the page-break issue fixed. Until then I cannot really upload my package to MapleCloud since I don't want to carry around two different users guides, one with & one without the page breaks. Think that will actually happen?

Anyway, thanks much, I have learned a few things.


3 4 5 6 7 8 9 Last Page 5 of 37