acer

32343 Reputation

29 Badges

19 years, 327 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

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

@The function Examples which exhibit this problem can get tricky to simplify, after the poor solution is generated. For example, a fortuitous constant might be found and added which allows the result to factor nicely.

ans := int((v^2-1)*(v^3-3*v+6)^5, v)

(1/18)*v^18-v^16+2*v^15+(15/2)*v^14-30*v^13+180*v^11-(585/2)*v^10-300*v^9+1539*v^8-1350*v^7-(4239/2)*v^6+5994*v^5-4050*v^4-3888*v^3+9720*v^2-7776*v

factor(ans+2592)

(1/18)*(v^3-3*v+6)^6

Download Question_for_maple_primes_6_accc.mw

I won't bother doing trying to automate that, because finding a better methodology for dealing with the unexpanded integrand seems better than dealing with an unfortunate expansion in an answer. There are already heuristics inside int that could handle this example -- if they were properly applied.

@Ronan There are several problems with your answer:

a) The text input has a syntax error, and won't execute if pasted in as 1D code

b) With the syntax corrected, that call to solve returns implicit RootOf's. It seems likely the OP is trying to avoid the implicit RootOf's, if searching for exact solutions.

c) With the syntax corrected, that call to fsolve returns NULL (empty result) because all four roots are complex and nonreal. It seems likely the OP is trying to avoid that NULL result, if searching for approximate solutions.

@eric2399 

The Question was about how to add multi-line input within a single Paragraph or Execution Group -- given that pressing the Enter key causes execution.

You have shown a way to insert a distinct, new Execution Group below the current input, but that is not what was asked here. Your Answer does not address the question that was asked.

The answer was already given: use Shift-Enter instead of just the Enter key. (Or Shift-Return instead of just the Return key, if that's how it's labeled on the keyboard.)

Upload and attach your problematic worksheet, using the Green up-arrow in the Mapleprimes editor.

@Anthrazit 

restart

with(Units:-Simple)

a := 15*Unit('kN')

15*Units:-Unit(kN)

b := 0*Unit('kN')

0

if a < b then "True" else "False" end if

"False"

if b < a then "True" else "False" end if

"True"

if a <= b then "True" else "False" end if

"False"

if b <= a then "True" else "False" end if

"True"

if a = b then "True" else "False" end if

"False"

if a <> b then "True" else "False" end if

"True"

NULL

Download CompareUnits_ac.mw

First 120 121 122 123 124 125 126 Last Page 122 of 592