John May

Dr. John May

2616 Reputation

18 Badges

17 years, 33 days
Maplesoft
Pasadena, California, United States

Social Networks and Content at Maplesoft.com

Maple Application Center
I have been a part of the Mathematical Software Group at Maplesoft since 2007. I have a Ph.D in Mathematics from North Carolina State University as well as Masters and Bachelors degrees from the University of Oregon. I have been working on research in computational mathematics since 1997. I currently work on symbolic solvers and visualization as well as other subsystems of Maple.

MaplePrimes Activity


These are replies submitted by John May

Another option here is to convert the expresion to exp form: convert(Eq,exp)

I have fixed this problem in the development version of Maple, and in future versions of Maple the explicit solutions will be found without any workarounds.

@WD0HHU Thanks!  It was really hard to make visualizations that looked this good in Maple 10 years ago, but over time there has been a lot of great work by many people on the team so we're now at the point that is pretty straight forward to put all the pieces together for something like this, as you can see in the worksheet.

@sursumCorda The Steam Desk does okay on this one, but since it churns through a lot of memory (20GB!) I find my Workstation with 32GB of RAM does a little better than the Deck that has only 14GB (2GB is used for  the gpu I believe).

Here's the Steam Deck running almost 7 minutes CPU time when my Xeon E5 does it in just less than 5 minutes, most of the difference being in GC time.

In most applications, it might be better to interactively format one graph at a time and then call DrawGraph with layout=user (or layout=default or no layout option at all) to use the saved positions (you can also grab them using GraphTheory:-GetVertexPositions to use with GraphTheory:-SetVertexPositions in a different session).

@acer said:

A technique used within some routines under int, is, etc, consists of storing (up front) a FAIL result for a call to a procedure that might eventually induce an identical call to itself. If this is performed prior to the first call, and if a suitable check for that value is made upon re-entry, then infinite recursion errors might be prevented.

acer puts their finger on what can cause the second call to int to succeed after the first one fails. There is a FAIL being stored in a remember table somewhere above where the infinite recursion exception occurs. So, the next time an identical calls is made a FAIL gets returned instead and then the computation takes a different path and doesn't trigger the exception.

So, one possible solution is to put the FAIL in a remember table even lower down the call stack so that the infinite recursion doesn't happen at all. But like wrapping code in blanket try-catch statements, that sort of thing should definitely only be used as a last resort. I avoid adding these sorts of remember table based recursive loop traps because in most cases they are not fixing problems but only wallpapering over them and end up creating new cases of unpredictable/non-reentrant/session-dependent behavior while potentially hiding other problems as well.

This particular example is pretty interesting and, I think, instructive: a couple calls after RationalFunction, the integrator is checking if F <> convert(F, parfrac, x) before recursing back to RationalFunction(F,x). The infinite recursion happens in the case that the parfrac conversion returns a rational function not indentical to F but still essentially the same (in this case F:=1/(-10*exp(2)*_z+25*_z^2+exp(4)-50*exp(2)+250*_z+625)). A lot of infinite recursion bugs end up looking a lot like this and the fix is to do a more careful check rather than just checking equality.

> F:=1/(-10*exp(2)*_z+25*_z^2+exp(4)-50*exp(2)+250*_z+625);
                                             1
            F := ----------------------------------------------------------
                                      2
                 -10 exp(2) _z + 25 _z  + exp(4) - 50 exp(2) + 250 _z + 625

> convert(F, parfrac, _z);
                                           1
               ---------------------------------------------------------
                    2
               25 _z  + (-10 exp(2) + 250) _z - 50 exp(2) + exp(4) + 625

# in this case, Maple knew F should have a better partial fraction decomposition
# but it needs special help to get it, since it involves transcendental constants
> frontend(convert, [eval(F,exp(4)=exp(2)^2)], [], parfrac, _z);
                                          1
                                ----------------------
                                                     2
                                (-exp(2) + 5 _z + 25)

# If parfrac had produced this, calling RationalFunction recursively would work

So in this case, you really want to check if the parfrac conversion factored the denominator (or, in general, created a sum) rather than simply checking equality.

@vv @LichengZhang that bug in DrawPlanar was actually fixed last year and so the next version of Maple will work better on this example.

@Scot Gould It's the San Gabriel mountains but west of Baldy.  The picture from is the top of the Brown Mountain fire "road" where it turns into the Ken Burton Trail https://www.mtbproject.com/trail/4902656

You couldn't come up with a better answer than Batman, John? smdh

@Jakey  Jake,

I am not sure whether I can disclose the exact details since that code isn't pubic (but, it is pretty easy to figure out by poking at gmp_isprime with some known Miller-Rabin psuedo-primes). I can say that isprime uses Miller-Rabin to get very fast composite number detection.  As you can see in the code, it only trusts a "true" from gmp_isprime result if N < 5*109. For larger numbers, it throws out the Miller-Rabin answer and does a Lucas pseudoprime test which is implemented in pure Maple code.

I executed this in your worksheet and it seems to work fine:
DocumentTools:-SetProperty(Table1, fillcolor[1,1], [255, 99, 1]);

Nice work.

I was going to suggest adding colors to the numbers, but then I downloaded the worksheet and saw that you already had. :)

It's too bad that the cloud version doesn't seem to support that.  Did you try setting the table cell background color as well as the textArea?  That might partially work in the Cloud (and also look a little better in offline Maple).

@vv Thanks.  I will file a bug report for that.

@vv Oh yeah, SolveTools:-SemiAlgebraic might return them as well (they come from RegularChains), in parametric cases where they can't actually be converted to proper indexes.

Some favorite primes I've seen recently.
Prime burger:

111111111111111111111111111111111111111111111111111111111111111111111111111111
111111111111111111111111111088636806853008808556500111111111111111111111111111
111111111111111111111086038885801800800808008800883868880111111111111111111111
111111111111111118888888083580838388888803880888650038838888811111111111111111
111111111111116658508830068803808856080688080351108580888088380311111111111111
111111111118060068005080600380860880808880588808063005886388088680111111111111
111111111808868608068113888886888388001115880066650888808080836808881111111111
111111118080665550683686885006680000500080806060000888858088830508860311111111
111111188068506806800880866060888806538883588836888888808508666868008051111111
111111083888008068838808688688080088008880600036838888111503808008688800111111
111118008580551188368060868508680850868811153308880868088003060600808083811111
111160860838588800888888860088883088888888508058088080868805006080508888011111
111183883850886888388856080886368888008083860063038888088006338638038880811111
111111111111111111111111111111111111111111111111111111111111111111111111111111
111838868000086586088568888880860808088060880000880856508888685630060880886111
111880388088688808688888888630886680683888068888888080088808003860888800600111
111111111111111111111111111111111111111111111111111111111111111111111111111111
111008003888008880088800380888888006811111111111111111111111111110380830581111
118863558668885008000880858806683008550006868061111111111111111188003888300011
188888008860638388888880808068680886588686838886811111111111150860888380880601
188080808808058880888880803658008600888060038586060811111108880880568650603001
100688808080888088888808668888088008060000060683388605888088806008880808088881
180606856838060680800050888068308668080088588886068586568880308308088008038661
110886685588086006888805083888668858008088068888888330808008860838580863605811
111188668060886086888608880066868008838005583858885883080580868886360585881111
111111111111111111111111111111111111111111111111111111111111111111111111111111
111188008030111111111111111806036088880368300808083560008838806080088000881111
111110880386581111111185886838008633888680850888688508003088008380866006611111
111116808888880111108060660863880080808006088880808800508506308853688880811111
111111885886800336630088880066800006838888868858800368608688868338880005111111
111111188588350080380883808680888886368665880308800838888888686008888381111111
111111111165063008066030068063085888600888055608860888506808365008081111111111
111111111111111305808088605086888066838633080508068000836608880111111111111111
111111111111111111111111111111111111111111111111111111111111111111111111111111

A dangerous vigilante:

111111111111111111111111111111111111111111111111111111111111111111111111111111
111111111111111111111111111111111181111111181111111111111111111111111111111111
111111111111111111113011111111111186111111081111111111110011111111111111111111
111111111111111183838111111111111108811110601111111111111008861111111111111111
111111111111160066880111111111111108086508861111111111111000588001111111111111
111111111136850500006111111111111188588586501111111111111388038588081111111111
111111118008806568338111111111111808888035680111111111111868806880588611111111
111111033008868080068111111111118808008088385811111111111088080886836580111111
111100050088668608008881111111108888008888883801111111186080808600800888331111
111006503608088866886088888008886868068688308088830860656383860800566600080111
118080883380888080883803588586680800088360663808060038650505000806038888888011
158080800886888688883060663000888886080800808606300855303888808688880588836861
150608080885856880008688806868886068088866685068803880808086888885808888886001
188008538660386666888868886608038850888803688808835888388550658068338806800381
108880866868608008806888888888885885688688056886008008000800888888006888008081
108538586038888880888530888856008858388008388588080838660888088800868588088851
168800885808068686835806688688888883808883866680803800580668880860888080605001
118500805858888308036660880658060886388688886036000808680080860803803068088011
111838880858688611111888068611110088805808008011118886860111110035888888580111
111188800006831111111111061111111108000088831111111188111111111108368580801111
111111838688881111111111111111111118665088011111111111111111111153308808111111
111111110868881111111111111111111111868888111111111111111111111185388811111111
111111111118865111111111111111111111163851111111111111111111111888811111111111
111111111111111011111111111111111111118811111111111111111111118111111111111111
111111111111111111111111111111111111111111111111111111111111111111111111111111

The Jet Propulsion Laboratory Logo:

111111111111111111111111111111111111111111111111111111111111111111111111111
111111111111111188080351108888668860086888005608111100860651111111111111111
111111111111111108558861180886386080688806880058811108808881111111111111111
111111111111111188008801160308080865856000686850581100866081111111111111111
111111111111111180888831108680381111111111188565861133865601111111111111111
111111111111111168688681160538601111111111110606388168008881111111111111111
111111111111111138633051155388051111111111118883338183088681111111111111111
111111111111111186083661188880851111111111106866868188808061111111111111111
111111111111111138888381108868008808008508608835501133588631111111111111111
111111111111111180858681138888801008838005888088881188086801111111111111111
111111111111111185806081180300881108888800886088811180000381111111111111111
111111111111111800088001100803801116308008060011111185668881111111111111111
111188880800336500808581160805881111111111111111111108688085088003688851111
111006883888000886830011108880081111111111111111111110630668608883063688111
116608008080830085888111188636801111111111111111111111868880880880588388811
111111111111111111111111111111111111111111111111111111111111111111111111111

Finally <insert joke about Pi being prime>

111111111111111111111111111111111111111111111111111111111111111111111111111111
111111111111111111111111885888808008800000088856888803680888858886886088060811
111111111111118860858866058808088880886880880838888808805860380888606080808811
111111111180080080608088088863860030680503068506850585858888806860860858060611
111111111888680806080883886308063633080058860368806380035688008880688656005311
111111108808833000880600080000803330688058805850008803088888808888688088880511
111111888880008886086860566008006835888583838060856888068088800808085336858811
111111868850063111111111188688881111111111111111300035880311111111111111111111
111118306601111111111111180838881111111111111111808088356811111111111111111111
111168568111111111111111136080081111111111111111606080800611111111111111111111
111886311111111111111111188858611111111111111111880880508011111111111111111111
111808111111111111111111100003611111111111111111068380880611111111111111111111
118081111111111111111111808066011111111111111111008808886611111111111111111111
111111111111111111111111508888311111111111111110086808530811111111111111111111
111111111111111111111111838086611111111111111118863803800311111111111111111111
111111111111111111111111383000811111111111111115608068800111111111111111111111
111111111111111111111118058005111111111111111110080888638111111111111111111111
111111111111111111111118585006111111111111111118668068085111111111111111111111
111111111111111111111118800865111111111111111100688038885111111111111111111111
111111111111111111111186068568111111111111111108800538838111111111111111111111
111111111111111111111055638830111111111111111168888886861111111111111111111111
111111111111111111111888565086111111111111111168308800081111111111111111111111
111111111111111111110558560301111111111111111180830800081111111111111111111111
111111111111111111168858888531111111111111111138600086081111111111111111111111
111111111111111111180588088861111111111111111808085868861111111111111111111111
111111111111111111300656350601111111111111111880568088051111111111111111111111
111111111111111110058808880661111111111111111080888883061111111111111111111111
111111111111111688688806608511111111111111111838888088661111111111111111111111
111111111111110888868888088811111111111111111688086800883111111111111111185611
111111111111188886803606008811111111111111111080303880050111111111111111100011
111111111118360306330800086811111111111111111300008668803811111111111111635111
111111111158808808883000806111111111111111111680088380008801111111111180808111
111111111868005688803300806111111111111111111063888686868806600888803006081111
111111118380880885888008801111111111111111111130388058886830858888868085011111
111111110885836508888886881111111111111111111185865680068088868806808008111111
111111110006888858656658611111111111111111111116388088880000066885038081111111
111111111088858068330868111111111111111111111111180888066850580066608811111111
111111111100658808003811111111111111111111111111111083856008088568811111111111
111111111111160886611111111111111111111111111111111111118865088111111111111111
111111111111111111111111111111111111111111111111111111111111111111111111111111

 

It is easier for people to answer if you copy and paste your problem as plain text or upload your document via the green arrow button.

1 2 3 4 5 6 7 Last Page 1 of 19