Mac Dude

1506 Reputation

17 Badges

10 years, 249 days

MaplePrimes Activity


These are answers submitted by Mac Dude

Herer is your MWE back. The only thing I did was adding a semicolon after the first expression. Without the semicolon, Maple appears to use implied multiplication of your two lines. This is a "feature" of 2-D input.

The way Maple works is that all results generated in an evaluation group is shown at the end of the group. Your first two expressions are in one group. The second two are in separate groups, hence you get the results after each expression.

Constructs like if or do loops always occupy just one group so your options to use grouping as a typesetting tool are limited. Also, if you use equation numbers, only the last result of an evaluation group is accessible by the equation number.

M.D.

MWE.mw

 

It is not clear what you mean by problem 1. The equation numbers are inserted by Maple automatically, as undoubtedly you noticed. You do not get to pick these. If you put an equation into your section, they will be (1.1), (1.2) and so on.

If you refer to a forward reference; i.e. referencing 7 before you get there: Maple does not know these numbers until it evaluates the line. So you cannot reference (7) before Maple has actually assigned it.

Problem 2 is easier: The boldened words are Maple keywords. The italic print indicates that you maybe in an evaluation group. Maple would try to evaluate the section (hit the !!! button to see what it is doing). Since you work in 2-D input mode you can use F5 to switch between text (no evaluation, typeset in roman) and math (evaluation, typeset in italic).

Be aware that Maple also has 1-D input mode; much easier to use if all you want is to perform a calculation. In the Prefs, Interface tab, set Default format for new worksheets to "Worksheet" and on the Display tab, set Input display to Maple Notation. Of course  if you want the typesetting you want the Document type and 2-D input.

I don't know Mma well, but I do not see where Maple lacks flexibiility with the exception of list and array handling, where Maple is much more strongly typed: it has lists, Vectors, Sets, Arrays, Matrix, ... whereas for Mma apparently most of these are lists.

M.D.


I get these all the time although not from Maple. My standard answer is "no". The request is for unsolicited incoming connection requests, i.e. those that your computer or program did not initiate.

My Firewall is "on" & I allow Maple to receive incoming requests (hence no questions). I suspect your system is denying incoming requests for Maple. Check your firewall settings (you'll need to be administrator for that). I bet Maple is in there as being denied. If things work for you, just leave the settings as they are & say "no".

My $0.02,

Mac Dude

 


I am not sure this suits you, but I plot the Y-axis labels in vertical orientation (labeldirections=[default,vertical]). In general the label then moves out when the axis values get long. Sometimes it is a bit too far out. This is in my .mapleinit file so always works like this.

If not that, I would use the crude method of padding with spaces you already mentioned.

Mac Dude

 

Peeling the outer map() off your statement the code produces output and does not throw an error. So I'd conclude the thaw happens in is. I have never used is so I have no direct experience with it.

Now the output is a long sequence of seemingly identical matrix equalities like this:

seq(seq(map(eval, Matrix(3, omega[1]) = Matrix(3, omega[0]), [n = i, m = j]), i = 1 .. 10), j = 1 .. 10);

which may or may not be what is intended.

Mac Dude

 

limit(arcsin(x)/tan(Pi*x/2),x=1);

0

Mac Dude

 

Use Int with a capital I, the so-called inert form. This prevents evaluation & preserves the integral notation. When yo are ready to evaluate it, use value(integral expression).

Mac Dude


if you assign something to f(i,j) it becomes a proc, i.e. it is the same or at least close to the arrow notation f:=(i,j) -> something;

If you assign to f[i,j] it becomes a table, or associative array, or in Perl lingo a hash.

Your third construct just produces an error message as does the last.

I do point out that you can easily test this yourself. In the sidebar on the left side you can see all variables as they are created & see what they are

M.D.

 

 

 

You treat f1 as a function in ode1 but as a table in the F1xx etc. That is not consistent.

M.D.

 

Please lookup ExportMatrix in Maple's help facility. It can do this for you.

M.D.

 

Maple has the MmaTranslator package that you will want too investigate for this purpose.

Having said that; it is by far not able to take a program like yours & just translate it. Since the structure of your Mma program seems relatively straightforward the strategy I would use is to translate and test each of the defined functions by themselves & build up the Maple code in this way.

It is worth studying the Maple Programming Guide beforehand. While Maple has similar keywords as Mma has they can mean different things. E.g. to me (who has very little knowledge of Mma) the Mma Module definitions look more like Maple's proc() (procedure or function definitions) where local variables are declared with the local keyword. The Programming Guide lets you figure out which Maple constructs are best for your task.

In other words, you need to understand the Mma code and to learn enough Maple to replicate the code structure in Maple. MmaTranslator can then help with the mundane tasks like changing [] to (), := to = where appropriate etc. A purely mechanical translation does not and cannot work (in my experience, having done similar things before) as Mma seems to work differently than Maple in a number of ways.

M.D.

 

I don't know of a way to prevent wrap-around. But I wrap my own code by hand (I use the \ continuation operator although in many cases it is optional) so I can format it the way t suits me.

You can also write your code in Emacs (using Joe Riel's maplev mode). Emacs lets you control line wrapping. I do this for my large libraries, but not for interactive Maple code.

M.D.

With the caveat that I use Maple on macOS, it is my experience that the readout can freeze on operations that cause large amounts  of output. My understanding/explanation is that the GUI, being a Java process, is essentially single-threaded, so if it is busy typesetting it won't update the status line.

Another, more sinister reason can be that the Maple kernel stops updating these values. I have seen that as well, and often (but not always) it idicates that the kernel evaluation is trapped in some endless loop at a low level.

You mention 9 hours accumulated run time. Is that expected for your task? I have Maple programs that can run this long, but those are simulations with a high number of iterations. A linear Maple program taking this long is almost certainly either stuck or up against an exponentially growing expression swell. Is Maple gobbling up memory? That would cause excessive paging, which also can slow the status update but at the same time would make your system sluggish to respond. If you have a parameter that governs the size of your problem you can gradually increase that (from a value where things work) to detect this condition.

M.D.

There is apparently a Maple Toolbox for Matlab, that gets installed when you install Maple. Maple's help facility has some info on it. Maybe it can help.

You can also check out the CodeGeneration:-Matlab() function, that supposedly outputs Maple code translated into Matlab code.

I haven't used either...

M.D.

 

Probably not a full answer, but in your example I would write:

unapply(eval(D(y->sin(y^2))(y)),y);

%~(x);

which, for a Vector or list x, is only marginally slower than your first expression. You want to avoid that Maple evaluates the derivativation for each element of the argument Vector so you do it for a (scalar) variable. I can see that there might be cases where this fails, although, you are not deriving by a vector anyway, so in most cases I'd think this works.

The tilde (~) creates new elementwise operators. subs substitutes variable names, not operators so it cannot work in the way you are trying in your last attempt.

If you want a float in the end, wrap the whole thing in evalf~().

Mac Dude
 

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