acer

32313 Reputation

29 Badges

19 years, 315 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@Ronan You speak of a "package", and use the word "export". But in the context of packages the word "export" has a very special meaning for procedures. Apparently you don't intend that meaning.

Your followup Reply indicates that you want to be able to provide the procedure's as source code. Thank you.

It's not clear what you mean here by "export".

What value did you obtain using Matlab?

How accurate do you think it is?

@janhardo I'll add another reason, which is perhaps the most important:

Many important packages in Maple use Vector/Matrix/Array. Most if not all of the few packages (eg. linalg) which use vector and matrix are themselves deprecated, as are those structures.

For linear algebra you might also look at an example worksheet on migrating from linalg to LinearAlgebra, which is also directly accessible in your Maple's Help system.

If you have additional problematic examples then feel free to ask about them.

@tomleslie The OP had previously expliciyly mentioned the PointInPolygon command, and also the fact that it isn't present in his Maple 2018.

@animeplot It's possible to implement an algorithm for it, as a procedure.

If I recall correctly, the (new, as of Maple 2020) PointInPolygon command of the ComputationalGeometry package implements the Winding Number algorithm (a.k.a. Nonzero-rule). It might even be an implemention of this variant.

It might be fun to try also the Ray-casting algorithm. Maple's variable precision floating-point arithmetic might even be used to make that more numerically robust.

@Carl Love Using your IsInInterior approach, this incorrect result is returned,

PS:= PolyhedralSets:
PS:-IsInInterior(
    PS:-PolyhedralSet([[300,300]]), #point being tested
    PS:-PolyhedralSet(
        [[0,0],[200,0],[200,300],[250,400],
        [500,300],[500,500],[0,500]
    ])
);

               true

plots:-display(
plots:-pointplot([[300,300]],color=red,symbol=solidcircle,symbolsize=15),
plots:-display(plottools:-polygon([[0,0],[200,0],[200,300],[250,400],
        [500,300],[500,500],[0,500]]), color=yellow), size=[350,350]);

@C_R This approach happens to work for this example, but in general it is faulty because it does not account for the possibility that mixed units are present, eg. millimeters and meters, possibly in different elements of say a list. For such examples this approach can produce a wrong result.

edit. In general it is better to first change to common units for the given dimensions, to avoid such mismatches in scale. Some ways to accomplish that preliminary step involve utilizing combine(...,'units') or simplify.

@tomleslie Your code has,

  title=typeset( "Opt x= %1, r=%2, Area = %2", x, r, A(x,r))

but perhaps you intended,

  title=typeset( "Opt x= %1, r=%2, Area = %3", x, r, A(x,r))

using %3.

I had trouble searching by author.

Additionally, when the mouse goes over a tile it goes all blue. I don't find that useful or appealing. It also prevents me from right-click-opening the link to the author's name.

@mmcdara I don't understand what you are talking about, with respect to a "personal license" having effect here. What precisely do you mean, and how do arrive at your conclusion?

The Open in New Window menu choice appears upon right-click of a Help link in Maple 2017.3 onward, but not if you are still using Maple 2015. Even in Maple 2017.3 that works for me in both a text Help-url link in a Worksheet as well as a Help cross-reference in an open Help page -- but not to the page names in the left-panel tree. That's what I wrote before.

I would agree that it would be an improvement to allow opening of Help pages in separate windows, upon right-click on the names in the left-panel tree (in addition to how it currently already works for url links).

Also, with regard to what Christopher2222 has (inaccurately) claimed, one can in fact launch two instances of Maple's GUI that don't interact with each other. Each can then open its own Help viewer separately. One way to get this effect is to add   -standalone   to the call to the Maple executable in the launcher. (That undocumented option causes each Maple Standard GUI to use its own Java vitual machine instance. I like using this because a crash in one does not crash the other.)

If I right-click on a cross-reference link within an open Help page then it offers me the choice Open in New Window, which works and opens a new window.

That also works if I right click on a Help hyperlink in text in an open Worksheet.

I don't get any right-click menu for the topics in the Browser menu (left-panel).

I used Maple 2021.1.

Is that adequate for your needs? (With effort it might be possible to concoct a procedure that does it...)

There is a "Multiple Help Windows=" item in the plainttext file in which GUI options are stored (on Linux that is file ~/.maple/2021/maplerc but on MS-Windows its a maple.ini somewhere I forget...). But editing that rhs to be "true" doesn't seem to have any effect, anyway. This might be a holdover from the Classic GUI (Standard Java GUI was introduced in Maple 9).

Calling your procedure assigns to global names r1,r2, etc. It is better to use indexed names r[i] where you have r declared local. Assigning to concatenated names within a proc is a bad habit.

Also, your procedure uses several names unprotected by quotes, and will have problems if they are assigned at the higher level.

Waterfall_ed.mw

Tell us what numeric values you used for r, z, and k0, when you performed numeric quadrature.

What result did your other software obtain for that?

ps. I changed your Post into a Question.

@Joe Riel The OP's very original code almost appeared to be an attempt to deal with some (incorrect, if purported) notion of all Vector element references as being merely references to an indexed name, as if explicit evaluation might help. And so we eventually got around to discussing element access, which (naturally) is by value.

Your example seems (to me) to have more to do with the distinction between top-level evaluation of assigned (global) names and 1-level evaluation of assigned local names than it has to do with Vector entry access.

When I wrote, "When entries of a Vector are accessed individually they get evaluated" I meant, naturally, that they are accessed by value and evaluation is like normal (for the running environment, be it top-level or within a procedure call). I made this statement only because the OP had tried to fix his original problem by apply eval at the point of accessing the Vector entries.

First 119 120 121 122 123 124 125 Last Page 121 of 591