acer

33193 Reputation

29 Badges

20 years, 212 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@vv Sure, and the given Wind procedure can only handle vertical and horizontal lines (which the starting values for the red vertices happen to incur). It might be extended to check for the blue point being on (or close enough) to any of the line segments no matter the slope.

If we allow only  the blue test point to be mouse-dragged, then it can be done with discretized values.  explore_wind_ac2.mw

@vv That is fun.

Attached is a variant in which the red and blue points can be dragged around with the mouse. (I used Maple 2021.1)

explore_wind_ac.mw

@Jean-Baptiste R I'm glad that you're able to make progress.

But note that the alteration sought here is not really a "factorization".

If I do a google search for "efficient polynomial evaluation" then the second hit is to Horner's Method.

Here's another approach, which sometimes turns up something useful,

expr := a*x+6*x^2-10;

a*x+6*x^2-10

codegen['optimize'](unapply(expr,x),'tryhard')(x);

-10+(a+6*x)*x

Download code_opt_fun.mw

Please don't start an entirely new thread on the same question.

@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.)

First 135 136 137 138 139 140 141 Last Page 137 of 607