acer

32385 Reputation

29 Badges

19 years, 334 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

An alternative for showing a Matrix or Array of plots by the plots:-display command is to use the DocumentTools:-Tabulate command.

tabulated_plots.mw

The plots:-display command also renders within a GUI Table. But it can sometimes behave a little goofy when the available worksheet width makes it squeeze the plots (...one effect being extra vertical white-space, unless you manually resize the Table).

I added a size option to the individual plots, and so you could also see some effect on the plots:-display result.

Check whether I typed in the equations correctly.

If I typed in the equations correctly and this doesn't work then tell us what Maple version you're using.

If the explicit solutions are too long to print nicely you can try line-printing them. (lprint command).

It looks to me as if the factors E*h are common to all terms and could be divided out.

It looks to me as if expanding the expressions gets rid of the ugly powers of 10.

restart;

kernelopts(version);

`Maple 2019.0, X86 64 LINUX, Mar 9 2019, Build ID 1384062`

Digits:=15:

A[1]:=-1/b^16*(4.5e-59*E*h*(-3.920128459e57*b^20*f[2]^3-8.939358414e58*b^14*f[0]^3+1.489947089e58*b^18*e*f[2]
                            -4.392312294e58*b^16*f[2]*f[0]^2-2.451841920e58*b^18*f[0]*f[2]^2+9.481481484e58*b^16*e*f[0]));

-0.45e-58*E*h*(-0.3920128459e58*b^20*f[2]^3-0.8939358414e59*b^14*f[0]^3+0.1489947089e59*b^18*e*f[2]-0.4392312294e59*b^16*f[2]*f[0]^2-0.2451841920e59*b^18*f[0]*f[2]^2+0.9481481484e59*b^16*e*f[0])/b^16

A[2]:=-1/b^16*(4.5e-59*E*h*(-6.383509582e57*b^22*f[2]^3+1.083597880e58*b^20*e*f[2]-1.464104097e58*b^16*f[0]^3                                               +1.489947089e58*b^18*e*f[0]-2.451841920e58*b^18*f[2]*f[0]^2-1.176038539e58*b^20*f[2]^2*f[0]));

-0.45e-58*E*h*(-0.6383509582e58*b^22*f[2]^3+0.1083597880e59*b^20*e*f[2]-0.1464104097e59*b^16*f[0]^3+0.1489947089e59*b^18*e*f[0]-0.2451841920e59*b^18*f[2]*f[0]^2-0.1176038539e59*b^20*f[2]^2*f[0])/b^16

AA[1]:=expand(A[1]);

.176405780655*b^4*E*h*f[2]^3+4.02271128630*E*h*f[0]^3/b^2-.67047619005*b^2*E*h*e*f[2]+1.97654053230*E*h*f[2]*f[0]^2+1.10332886400*b^2*E*h*f[0]*f[2]^2-4.26666666780*E*h*e*f[0]

AA[2]:=expand(A[2]);

.287257931190*b^6*E*h*f[2]^3-.48761904600*b^4*E*h*e*f[2]+.65884684365*E*h*f[0]^3-.67047619005*b^2*E*h*e*f[0]+1.10332886400*b^2*E*h*f[2]*f[0]^2+.52921734255*b^4*E*h*f[2]^2*f[0]

# First way, using the `solve` command

sol:=solve([AA[1],AA[2]],[f[0],f[2]],explicit):

nops(sol);
indets(sol,name);

9

{b, e, f[0], f[2]}

# Let's evaluate the solutions at particular values of `b` and `e`.
eval(sol,[b=1.2,e=3.7]);
seq(eval(eval([AA[1],AA[2]],[b=1.2,e=3.7,E=1,h=1]),K),K=%);

[[f[0] = 0., f[2] = 0.], [f[0] = -.409356940020345, f[2] = 2.08608780159616], [f[0] = .409356940020344, f[2] = -2.08608780159616], [f[0] = -2.40189174132054, f[2] = .106563308000001], [f[0] = 2.40189174132053, f[2] = -.106563308000001], [f[0] = -3.37901933995627-.192870808728881*I, f[2] = 1.30538469421104+3.30053342365476*I], [f[0] = 3.37901933995626+.192870808728880*I, f[2] = -1.30538469421104-3.30053342365476*I], [f[0] = -3.37901933995627+.192870808728881*I, f[2] = 1.30538469421104-3.30053342365476*I], [f[0] = 3.37901933995626-.192870808728880*I, f[2] = -1.30538469421104+3.30053342365476*I]]

[0., 0.], [0.1e-13, -0.5e-13], [0.1e-13, 0.6e-13], [0.3563e-9, 0.798469e-10], [-0.3567e-9, -0.799380e-10], [0.7e-12+0.44e-12*I, 0.1e-12+0.1e-12*I], [-0.14e-11+0.8e-13*I, -0.2e-12+0.5e-12*I], [0.7e-12-0.44e-12*I, 0.1e-12-0.1e-12*I], [-0.14e-11-0.8e-13*I, -0.2e-12-0.5e-12*I]

 

# Maybe you also know some helpful property of parameter `e`?
# For example, let's consider that e is real and positive,
# or real and negative.
#
simplify(combine(sol)) assuming e>0;

[[f[0] = 0., f[2] = 0.], [f[0] = -.177345449540584*e^(1/2)*b, f[2] = 1.30140648811037*e^(1/2)/b], [f[0] = .177345449540583*e^(1/2)*b, f[2] = -1.30140648811037*e^(1/2)/b], [f[0] = -1.04057004772783*e^(1/2)*b, f[2] = 0.664795510137929e-1*e^(1/2)/b], [f[0] = 1.04057004772783*e^(1/2)*b, f[2] = -0.664795510137929e-1*e^(1/2)/b], [f[0] = (-1.46389042242960-0.835572991032833e-1*I)*b*e^(1/2), f[2] = (.814364625125733+2.05903874634754*I)*e^(1/2)/b], [f[0] = (1.46389042242960+0.835572991032835e-1*I)*b*e^(1/2), f[2] = (-.814364625125733-2.05903874634754*I)*e^(1/2)/b], [f[0] = (-1.46389042242960+0.835572991032833e-1*I)*e^(1/2)*b, f[2] = (.814364625125733-2.05903874634754*I)*e^(1/2)/b], [f[0] = (1.46389042242960-0.835572991032835e-1*I)*e^(1/2)*b, f[2] = (-.814364625125733+2.05903874634754*I)*e^(1/2)/b]]

simplify(evalc(simplify(combine(sol)))) assuming e<0;

[[f[0] = 0., f[2] = 0.], [f[0] = (-0.83557299103281e-1-1.46389042242960*I)*(-e)^(1/2)*b, f[2] = (2.05903874634754+.814364625125736*I)*(-e)^(1/2)/b], [f[0] = (0.83557299103282e-1+1.46389042242959*I)*(-e)^(1/2)*b, f[2] = (-2.05903874634754-.814364625125736*I)*(-e)^(1/2)/b], [f[0] = (-0.83557299103281e-1+1.46389042242960*I)*(-e)^(1/2)*b, f[2] = (2.05903874634754-.814364625125736*I)*(-e)^(1/2)/b], [f[0] = (0.83557299103282e-1-1.46389042242959*I)*(-e)^(1/2)*b, f[2] = (-2.05903874634754+.814364625125736*I)*(-e)^(1/2)/b], [f[0] = -(1.04057004772783*I)*(-e)^(1/2)*b, f[2] = (0.664795510137929e-1*I)*(-e)^(1/2)/b], [f[0] = (1.04057004772783*I)*(-e)^(1/2)*b, f[2] = -(0.664795510137929e-1*I)*(-e)^(1/2)/b], [f[0] = -(.177345449540584*I)*b*(-e)^(1/2), f[2] = (1.30140648811037*I)*(-e)^(1/2)/b], [f[0] = (.177345449540584*I)*b*(-e)^(1/2), f[2] = -(1.30140648811037*I)*(-e)^(1/2)/b]]

 

# Second way, using the `eliminate` command.
# Try this if the `solve` approach above doesn't work
# in your version.

#sol2:=eliminate(convert({AA[1],AA[2]},rational),{f[0],f[2]}):

#W:=[allvalues(sol2[1][1]), allvalues(sol2[2][1])]:

#nops(W);
#indets(W,name);

#eval(evalf(W),[b=1.2,e=3.7]);
#seq(evalf(eval(eval([AA[1],AA[2]],[b=1.2,e=3.7,E=1,h=1]),K)),K=%);

 

Download solve_examp.mw

 

Your attachment was last saved in Maple 2017 it seems, so that's what I used below.

The overall conclusion seems to be that modestly increasing working precision of the integrand above the evalhf (hardware double-precision cutoff of Digits=15) doesn't seem to make a significant difference.

But it's unclear whether you really expect to be able to take into account any effects of values on the order of 1.0e-15264332 etc.

restart;

kernelopts(version);

`Maple 2017.2, X86 64 LINUX, Jul 19 2017, Build ID 1247392`

F1 := 0.1e10 * (0.55776153956804000740336392666745e0 * r ^ 2 - 0.18915469024923561670746189899598e-134609736 * BesselJ(0.0e0, 0.15157937163140142799278350422223e3 * r) + 0.10159683864017545475828989384714e-98384011 * BesselJ(0.0e0, 0.12958780324510399675374141784136e3 * r) + 0.59829761821461366846048256106725e-56462782 * BesselJ(0.0e0, 0.98170950730790781973537759160851e2 * r) + 0.14811094053601555275542685914404e-80227782 * BesselJ(0.0e0, 0.11702112189889242502757649460146e3 * r) + 0.33892512681723589723181533606428e-7313754 * BesselJ(0.0e0, 0.35332307550083865102634479022519e2 * r) - 0.51262328796358933950059817332311e-2254297 * BesselJ(0.0e0, 0.19615858510468242021125065884138e2 * r) - 0.12881247566594125484600726823569e-19254076 * BesselJ(0.0e0, 0.57327525437901010745090504243751e2 * r) + 0.11118751423887112574088244798447e-31252221 * BesselJ(0.0e0, 0.73036895225573834826506117569092e2 * r) - 0.51777724984261891154172697895593e-33998785 * BesselJ(0.0e0, 0.76178699584641457572852614623535e2 * r) + 0.12182571270348008146031905708415e-42932343 * BesselJ(0.0e0, 0.85604019436350230965949425493380e2 * r) + 0.40737194122764952321439991068058e-36860993 * BesselJ(0.0e0, 0.79320487175476299391184484872488e2 * r) - 0.50622470024129990724764923292822e-6070573 * BesselJ(0.0e0, 0.32189679910974403626622984104460e2 * r) - 0.46336835054606228289459855037304e-46141486 * BesselJ(0.0e0, 0.88745767144926306903735916434854e2 * r) + 0.13326755919882635551499433439984e-71843536 * BesselJ(0.0e0, 0.11073775478089921510860865288827e3 * r) - 0.51549643524094258017297656487619e-15264332 * BesselJ(0.0e0, 0.51043535183571509468733034633224e2 * r) + 0.63020619016879105779529017065422e-17201382 * BesselJ(0.0e0, 0.54185553641061320532099966214534e2 * r) - 0.34143530857990731804462883496266e-75977837 * BesselJ(0.0e0, 0.11387944084759499813488417492843e3 * r) + 0.29817206128159554191843363526765e-49466273 * BesselJ(0.0e0, 0.91887504251694985280553622214490e2 * r) - 0.32466998108445575875801048023258e-52906705 * BesselJ(0.0e0, 0.95029231808044695268050998187174e2 * r) - 0.18661427630098737592148946513116e-60134503 * BesselJ(0.0e0, 0.10131266182303873013714105638865e3 * r) - 0.88067954684538428870806207522441e-67824881 * BesselJ(0.0e0, 0.10759606325950917218267036427761e3 * r) + 0.13287757851408088906808371290053e-1290876NULL98 * BesselJ(0.0e0, 0.14843772662034223039593927702627e3 * r) - 0.28491383339723867983586755114008e-93671487 * BesselJ(0.0e0, 0.12644613869851659569779448049584e3 * r) + 0.44151440493072282554074854252808e-21422416 * BesselJ(0.0e0, 0.60469457845347491559398749808383e2 * r) - 0.25433459757254658126695515265514e-23706400 * BesselJ(0.0e0, 0.63611356698481232631039762417874e2 * r) + 0.31838472287249562307154488541348e-118390557 * BesselJ(0.0e0, 0.14215442965585902903270090809976e3 * r) + 0.24664036351722993558633516210405e-26106029 * BesselJ(0.0e0, 0.66753226734098493415305259750042e2 * r) - 0.35291670105094410350434844041935e-8672580 * BesselJ(0.0e0, 0.38474766234771615112052197557717e2 * r) + 0.58664491893391140222815167210588e-10147051 * BesselJ(0.0e0, 0.41617094212814450885863516805060e2 * r) - 0.15835272073861680035000959411566e-11737166 * BesselJ(0.0e0, 0.44759318997652821732779352713212e2 * r) + 0.70213789662657167106991346854437e-13442927 * BesselJ(0.0e0, 0.47901460887185447121274008722508e2 * r) + 0.20203042047105171656770921613101e-86016 * BesselJ(0.0e0, 0.38317059702075123156144358863082e1 * r) + 0.45595799288913858149685893872177e-140247419 * BesselJ(0.0e0, 0.15472101451628595352476655565184e3 * r) - 0.18611154629569865685380386607775e-146000746 * BesselJ(0.0e0, 0.15786265540193029780509466960866e3 * r) + 0.98529688671644920915913795962299e-63921870 * BesselJ(0.0e0, 0.10445436579128276007136342813961e3 * r) - 0.15806285101030450527944027463056e-123681305 * BesselJ(0.0e0, 0.14529607934519590723242215085501e3 * r) - 0.40315574736579460691059726643094e-28621303 * BesselJ(0.0e0, 0.69895071837495773969730536435500e2 * r) + 0.62723521218202757338090566184844e-108155995 * BesselJ(0.0e0, 0.13587112236478900059180156821946e3 * r) - 0.10859734567264554119513113490716e-113215453 * BesselJ(0.0e0, 0.13901277738865970417843354613596e3 * r) - 0.54175511325922018873646654014932e-39838846 * BesselJ(0.0e0, 0.82462259914373556453986610648781e2 * r) + 0.11283650227585469604741653680022e-4943036 * BesselJ(0.0e0, 0.29046828534916855066647819883532e2 * r) - 0.61345791140260163801601678872534e-103212181 * BesselJ(0.0e0, 0.13272946438850961588677459735175e3 * r) - 0.10878629914720505255262338938331e-84593372 * BesselJ(0.0e0, 0.12016279832814900375811940782917e3 * r) - 0.35054349658929943485990383440882e-3931145 * BesselJ(0.0e0, 0.25903672087618382625495855445980e2 * r) + 0.13529453916914935758397358737774e-89074607 * BesselJ(0.0e0, 0.12330447048863571801676003206877e3 * r) + 0.13471689526126410315073637771645e-3034898 * BesselJ(0.0e0, 0.22760084380592771898053005152182e2 * r) - 0.21295581245266175979652384428576e-288353 * BesselJ(0.0e0, 0.70155866698156187535370499814765e1 * r) + 0.46293568384524693637583038682636e-606366 * BesselJ(0.0e0, 0.10173468135062722077185711776776e2 * r) - 0.65373336840252622743371660187403e-1040030 * BesselJ(0.0e0, 0.13323691936314223032393684126948e2 * r) + 0.12271878942218097649114096289979e-1589340 * BesselJ(0.0e0, 0.16470630050877632812552460470990e2 * r) + 0.30096533794321654779481815801012e5) * (-0.84195432401461277308031602263610e-5 * r ^ 2 - 0.59149959490724929627371164952978e-2 * r ^ 6 * cos(0.6e1 * theta) + 0.44528672504236299477606103483348e-2 * r ^ 9 * cos(0.9e1 * theta) + 0.2112306765385091377525007041829e-2 * r ^ 25 * cos(0.25e2 * theta) - 0.67200617360940427597733246769568e-3 * r ^ 4 * cos(0.4e1 * theta) + 0.8077651557524848874997646779728e-4 * r ^ 38 * cos(0.38e2 * theta) + 0.6431431133931729186611840353106e-3 * r ^ 39 * cos(0.39e2 * theta) + 0.6638764085868884552072751263020e-3 * r ^ 40 * cos(0.40e2 * theta) + 0.3077586813267194148977094233961e-3 * r ^ 41 * cos(0.41e2 * theta) - 0.1856408707409825202502168626613e-3 * r ^ 42 * cos(0.42e2 * theta) - 0.4195028383398335941571877904622e-3 * r ^ 43 * cos(0.43e2 * theta) - 0.3706398326158304378037548737582e-3 * r ^ 44 * cos(0.44e2 * theta) - 0.7999587757612915190037434403564e-4 * r ^ 45 * cos(0.45e2 * theta) + 0.1737050010593172373976692973078e-3 * r ^ 46 * cos(0.46e2 * theta) + 0.2156346448293426610250334073280e-3 * r ^ 47 * cos(0.47e2 * theta) + 0.8688707406587637755715273073496e-4 * r ^ 48 * cos(0.48e2 * theta) - 0.2566545888070136544474329645476e-4 * r ^ 49 * cos(0.49e2 * theta) + 0.10879633813910334336257501999693e-1 * cos(theta) * r + 0.1887562703232630941270016328998e-2 * r ^ 24 * cos(0.24e2 * theta) + 0.9513343462787182229625573235371e-3 * r ^ 26 * cos(0.26e2 * theta) - 0.6163648649547716429383661026270e-3 * r ^ 27 * cos(0.27e2 * theta) - 0.1638476483444926784339005153548e-2 * r ^ 28 * cos(0.28e2 * theta) - 0.1544747773264052898936010069036e-2 * r ^ 29 * cos(0.29e2 * theta) - 0.5206686266979668543527923877478e-3 * r ^ 30 * cos(0.30e2 * theta) + 0.7031766719478684183248753358164e-3 * r ^ 31 * cos(0.31e2 * theta) + 0.1364403772746535517159915014059e-2 * r ^ 32 * cos(0.32e2 * theta) + 0.10540246948583098852767644351809e-2 * r ^ 33 * cos(0.33e2 * theta) + 0.1949337811874134263703020015791e-3 * r ^ 34 * cos(0.34e2 * theta) - 0.7191715359288498000802128285804e-3 * r ^ 35 * cos(0.35e2 * theta) - 0.10227876151057534138247065986153e-2 * r ^ 36 * cos(0.36e2 * theta) - 0.6867126825080510201446558832207e-3 * r ^ 37 * cos(0.37e2 * theta) - 0.51907452513946892830363140141895e-2 * r ^ 5 * cos(0.5e1 * theta) + 0.15481206149695126077925147166938e-2 * r ^ 11 * cos(0.11e2 * theta) - 0.18891064144929437714573633077525e-2 * r ^ 12 * cos(0.12e2 * theta) - 0.3811736195725823688361734620913e-2 * r ^ 13 * cos(0.13e2 * theta) - 0.32257343081162300403533436479469e-2 * r ^ 14 * cos(0.14e2 * theta) - 0.6456518231629053621129825002098e-3 * r ^ 15 * cos(0.15e2 * theta) + 0.20319096805014454478199422911684e-2 * r ^ 16 * cos(0.16e2 * theta) + 0.3233144446775015541635116158538e-2 * r ^ 17 * cos(0.17e2 * theta) + 0.23137228128708316785559166203584e-2 * r ^ 18 * cos(0.18e2 * theta) + 0.6898483226498941349817978084256e-4 * r ^ 19 * cos(0.19e2 * theta) - 0.20285262491678306920628881668352e-2 * r ^ 20 * cos(0.20e2 * theta) - 0.2671173199674743523515178373090e-2 * r ^ 21 * cos(0.21e2 * theta) - 0.15775142288031750532503075313091e-2 * r ^ 22 * cos(0.22e2 * theta) + 0.3622094777240520457049718035053e-3 * r ^ 23 * cos(0.23e2 * theta) + 0.14579067481459940998484958894370e-2 * r ^ 8 * cos(0.8e1 * theta) + 0.43385218600667457865829805287215e-2 * r ^ 10 * cos(0.10e2 * theta) - 0.29324228962818139404116534560943e-2 * r ^ 7 * cos(0.7e1 * theta) + 0.54771662980043457997274959739776e-2 * r ^ 3 * cos(0.3e1 * theta) - 0.11907324829492592983826593268542e-1 + 0.99737018277250342942042004599405e6 * (0.10375843065514893709650453544669e-7 * r ^ 4 - 0.24066724220589275560649004814238e-8 * r ^ 2) * cos(0.2e1 * theta) / r ^ 2 - 0.18524693450872080736996040590111e-1589345 * BesselJ(0.0e0, 0.16470630050877632812552460470990e2 * r) - 0.20335836094200343189896872255293e-3034903 * BesselJ(0.0e0, 0.22760084380592771898053005152182e2 * r) + 0.32146186927377989454999075542184e-288358 * BesselJ(0.0e0, 0.70155866698156187535370499814765e1 * r) - 0.69881243704258704205303920297122e-606371 * BesselJ(0.0e0, 0.10173468135062722077185711776776e2 * r) + 0.98682608468381340045946744187651e-1040035 * BesselJ(0.0e0, 0.13323691936314223032393684126948e2 * r) - 0.20423032817438260168628393904163e-89074612 * BesselJ(0.0e0, 0.12330447048863571801676003206877e3 * r) + 0.16393027894394588837550747507414e-113215458 * BesselJ(0.0e0, 0.13901277738865970417843354613596e3 * r) + 0.81779224239606095156885663441587e-39838851 * BesselJ(0.0e0, 0.82462259914373556453986610648781e2 * r) - 0.17032938676879018403348115316985e-4943041 * BesselJ(0.0e0, 0.29046828534916855066647819883532e2 * r) + 0.92602932340297485357655867631396e-103212186 * BesselJ(0.0e0, 0.13272946438850961588677459735175e3 * r) + 0.16421550871268572218657911635481e-84593377 * BesselJ(0.0e0, 0.12016279832814900375811940782917e3 * r) + 0.52915375437527581357423578813141e-3931150 * BesselJ(0.0e0, 0.25903672087618382625495855445980e2 * r) + 0.77815414272085141864206462412262e-15264337 * BesselJ(0.0e0, 0.51043535183571509468733034633224e2 * r) - 0.95131124896907983486241420998755e-17201387 * BesselJ(0.0e0, 0.54185553641061320532099966214534e2 * r) + 0.51540472771347914200070162230077e-75977842 * BesselJ(0.0e0, 0.11387944084759499813488417492843e3 * r) - 0.45009782583936088946734982085640e-49466278 * BesselJ(0.0e0, 0.91887504251694985280553622214490e2 * r) + 0.49009706668463083583947296301775e-52906710 * BesselJ(0.0e0, 0.95029231808044695268050998187174e2 * r) + 0.28169869327339522936720076403132e-60134508 * BesselJ(0.0e0, 0.10131266182303873013714105638865e3 * r) + 0.13294067445237467596212175135530e-67824885 * BesselJ(0.0e0, 0.10759606325950917218267036427761e3 * r) - 0.20058186851887448492658350947366e-129087703 * BesselJ(0.0e0, 0.14843772662034223039593927702627e3 * r) + 0.43008421517583172146652387481621e-93671492 * BesselJ(0.0e0, 0.12644613869851659569779448049584e3 * r) - 0.66647650649066255093532041895905e-21422421 * BesselJ(0.0e0, 0.60469457845347491559398749808383e2 * r) + 0.38392413062141555362678468281752e-23706405 * BesselJ(0.0e0, 0.63611356698481232631039762417874e2 * r) - 0.48060931976467196435085585083844e-118390562 * BesselJ(0.0e0, 0.14215442965585902903270090809976e3 * r) - 0.37230950111886614086127736374754e-26106034 * BesselJ(0.0e0, 0.66753226734098493415305259750042e2 * r) + 0.53273616301499657528989740768063e-8672585 * BesselJ(0.0e0, 0.38474766234771615112052197557717e2 * r) - 0.88555447286690435479201942884554e-10147056 * BesselJ(0.0e0, 0.41617094212814450885863516805060e2 * r) + 0.23903720225781678909977638730792e-11737171 * BesselJ(0.0e0, 0.44759318997652821732779352713212e2 * r) - 0.10598938725267772368055360453741e-13442931 * BesselJ(0.0e0, 0.47901460887185447121274008722508e2 * r) - 0.30496972994915901977125629292157e-86021 * BesselJ(0.0e0, 0.38317059702075123156144358863082e1 * r) - 0.68827944640884252540240135035619e-140247424 * BesselJ(0.0e0, 0.15472101451628595352476655565184e3 * r) + 0.28093981036064987725074202641260e-146000751 * BesselJ(0.0e0, 0.15786265540193029780509466960866e3 * r) - 0.14873291099481638062068892057166e-63921874 * BesselJ(0.0e0, 0.10445436579128276007136342813961e3 * r) + 0.23859963700126918177896460503756e-123681310 * BesselJ(0.0e0, 0.14529607934519590723242215085501e3 * r) + 0.60857319959503281138409206408861e-28621308 * BesselJ(0.0e0, 0.69895071837495773969730536435500e2 * r) - 0.94682648696048924172260521336169e-108156000 * BesselJ(0.0e0, 0.13587112236478900059180156821946e3 * r) + 0.28553350861432233569650200943679e-134609741 * BesselJ(0.0e0, 0.15157937163140142799278350422223e3 * r) - 0.15336284689969342456370426833116e-98384016 * BesselJ(0.0e0, 0.12958780324510399675374141784136e3 * r) - 0.90314449987634539477129986599199e-56462787 * BesselJ(0.0e0, 0.98170950730790781973537759160851e2 * r) - 0.22357699119008062011176340166029e-80227787 * BesselJ(0.0e0, 0.11702112189889242502757649460146e3 * r) - 0.51161554857649418772612124539227e-7313759 * BesselJ(0.0e0, 0.35332307550083865102634479022519e2 * r) + 0.77381705849741819343661724258774e-2254302 * BesselJ(0.0e0, 0.19615858510468242021125065884138e2 * r) + 0.19444549898144465612468716205102e-19254081 * BesselJ(0.0e0, 0.57327525437901010745090504243751e2 * r) - 0.16784020006534355647552255243370e-31252226 * BesselJ(0.0e0, 0.73036895225573834826506117569092e2 * r) + 0.78159708666719140456536882061442e-33998790 * BesselJ(0.0e0, 0.76178699584641457572852614623535e2 * r) - 0.18389881393811040868057686236036e-42932348 * BesselJ(0.0e0, 0.85604019436350230965949425493380e2 * r) - 0.61493764461507094694745129374163e-36860998 * BesselJ(0.0e0, 0.79320487175476299391184484872488e2 * r) + 0.76415823798329557427383241351545e-6070578 * BesselJ(0.0e0, 0.32189679910974403626622984104460e2 * r) + 0.69946555772905592227422733556311e-46141491 * BesselJ(0.0e0, 0.88745767144926306903735916434854e2 * r) - 0.20117055364775216522977716192738e-71843541 * BesselJ(0.0e0, 0.11073775478089921510860865288827e3 * r) + 0.24003433134624560908493351044670e-2 * cos(0.2e1 * theta)) * r:

 

F1 := subsindets(F1,specfunc(BesselJ),u->BesselJ(`if`(op(1,u)=0.,0,u),op(2,u))):

 

forget(evalf);
evalf[10](subs(r=1,theta=Pi/4,F1));

0.7135632389e12

Digits:=15;

15

forget(evalf);
evalf[15](subs(r=1,theta=Pi/4,F1));

713563241020.984

forget(evalf);
tmp:=subs(r=1,theta=Pi/4,F1):
evalhf(eval(tmp,1));

713563241020.989624

forget(evalf);
evalf[16](subs(r=1,theta=Pi/4,F1));

713563241020.9775

# Feel free to comment out this one. It's just here to demonstrate the worst
# scenario, which happens with the original attempt.
#
# When top-level Digits>15 and using expression form for the integrand then
# it reverts to iterated univariate integrals, which is very slow even for
# a very coarse `epsilon` accuracy tolerance.
# (Mostly it is slow because it may try and find discontinuities of the
# instantiated univariate integrands, and partly because that's generally
# not as efficient. The discont attempt allocates a lot of memory. Below I'll
# force operator form and the _cuhre method.)
#
# This is set time-out after roughly 120 seconds, so I don't have to bother
# interrupting it when it takes too long. If I try to just let it run then
# it allocates so much memory that my machine gets unresponsive.
#
forget(evalf); forget(`evalf/int`);
Digits := 16; infolevel[`evalf/int`]:=1:
int_F1:=timelimit(20, evalf(Int(F1,[theta=Pi/4..2*Pi-Pi/4,r=0..1], epsilon=1e-3)) );
Digits := 15; infolevel[`evalf/int`]:=0:
gc(): # memory clean up.

16

trying DCUHRE (TOMS algorithm 698)
evalf/int: multiple int routines failed, try iterated integrals

Error, (in convert/rational) time expired

15

forget(evalf); forget(`evalf/int`);
Digits := 15; infolevel[`evalf/int`]:=1:
int_F1:=CodeTools:-Usage( evalf(Int(unapply(F1,[theta,r]),[Pi/4..2*Pi-Pi/4,0..1], epsilon=1e-13)) );
Digits := 15; infolevel[`evalf/int`]:=0:

15

trying DCUHRE (TOMS algorithm 698)

cuhre: result=-1116001007191.79761
memory used=249.98KiB, alloc change=0 bytes, cpu time=2.28s, real time=2.30s, gc time=0ns

-1116001007191.80

15

# Notice that operator form of the integrand fails when Digits>15
# and it doesn't fall back to any other method.
# Below we'll work around this by raising Digits only inside
# a specially crafted non-evalhf'able procedure for the integrand.
#
forget(evalf); forget(`evalf/int`);
Digits := 16; infolevel[`evalf/int`]:=1:
int_F1:=CodeTools:-Usage( evalf(Int(unapply(F1,[theta,r]),[Pi/4..2*Pi-Pi/4,0..1], epsilon=1e-13)) );
Digits := 15; infolevel[`evalf/int`]:=0:

16

trying DCUHRE (TOMS algorithm 698)

Error, (in evalf/int) expect Digits<=15 for method _cuhre but received 16

15

F1high:=proc(TH,R)
   global dig;
   []; # non-evalhf'able
   if dig::posint then
     Digits:=dig;
   else
     Digits:=16;
   end if;
   evalf(eval(F1,[theta=TH,r=R]));
end proc;

forget(evalf);
dig:='dig': F1high(Pi/4,1);
forget(evalf);
dig:=115; F1high(Pi/4,1); dig:='dig':
evalhf(F1high(Pi/4,1)); # I want this to fail.

proc (TH, R) global dig; []; if dig::posint then Digits := dig else Digits := 16 end if; evalf(eval(F1, [theta = TH, r = R])) end proc

713563241020.9773

115

713563241020.9778560362960301660200858874997346260582705706835330026616868776989266246656729998821789242844726256079

Error, unable to evaluate expression to hardware floats: []

forget(evalf); forget(`evalf/int`);
dig:=15; infolevel[`evalf/int`]:=1:
int_F1:=CodeTools:-Usage( evalf(Int(F1high,[Pi/4..2*Pi-Pi/4,0..1], epsilon=1e-3, method=_cuhre)) );
dig:='dig': infolevel[`evalf/int`]:=0:

15

trying DCUHRE (TOMS algorithm 698)
cuhre: evalhf callback failed, trying evalf callback

cuhre: result=-1115952079406.81030
memory used=5.37GiB, alloc change=8.00MiB, cpu time=44.34s, real time=40.32s, gc time=6.71s

-1115952079406.81

forget(evalf); forget(`evalf/int`);
dig:='dig': infolevel[`evalf/int`]:=1:
int_F1:=CodeTools:-Usage( evalf(Int(F1high,[Pi/4..2*Pi-Pi/4,0..1], epsilon=1e-3, method=_CubaCuhre)) );
dig:='dig': infolevel[`evalf/int`]:=0:

memory used=5.35GiB, alloc change=-2.00MiB, cpu time=42.23s, real time=38.37s, gc time=6.39s

HFloat(-1.1159479385735142e12)

forget(evalf); forget(`evalf/int`);
dig:='dig': infolevel[`evalf/int`]:=1:
int_F1:=CodeTools:-Usage( evalf(Int(F1high,[Pi/4..2*Pi-Pi/4,0..1], epsilon=1e-4, method=_CubaCuhre)) );
dig:='dig': infolevel[`evalf/int`]:=0:

memory used=10.30GiB, alloc change=0 bytes, cpu time=80.91s, real time=73.63s, gc time=12.19s

HFloat(-1.1159989908099993e12)

# Now we can increase the working precision during evaluations of the
# integrand and restrict the `epsilon` accuracy tolerance. Both of those
# slow things down, but at least we can force the _curhe method and avoid
# iterated integrals and discont search overhead (which are prohibitively
# expensive for this example).
#
forget(evalf); forget(`evalf/int`);
dig := 15; infolevel[`evalf/int`]:=1:
int_F1:=CodeTools:-Usage( evalf(Int(F1high,[Pi/4..2*Pi-Pi/4,0..1], epsilon=1e-4)) );
dig:='dig': infolevel[`evalf/int`]:=0:

15

trying DCUHRE (TOMS algorithm 698)
cuhre: evalhf callback failed, trying evalf callback

cuhre: result=-1116000688749.40381
memory used=13.21GiB, alloc change=0 bytes, cpu time=113.17s, real time=103.36s, gc time=17.15s

-1116000688749.40

# Now we can increase the working precision during evaluations of the
# integrand and restrict the `epsilon` accuracy tolerance. Both of those
# slow things down, but at least we can force the _curhe method and avoid
# iterated integrals and discont search overhead (which are prohibitively
# expensive for this example).
#
forget(evalf); forget(`evalf/int`);
dig := 20; infolevel[`evalf/int`]:=1:
int_F1:=CodeTools:-Usage( evalf(Int(F1high,[Pi/4..2*Pi-Pi/4,0..1], epsilon=1e-4)) );
dig:='dig': infolevel[`evalf/int`]:=0:

20

trying DCUHRE (TOMS algorithm 698)
cuhre: evalhf callback failed, trying evalf callback

cuhre: result=-1116000688749.40405
memory used=17.94GiB, alloc change=0 bytes, cpu time=2.30m, real time=2.08m, gc time=21.86s

-1116000688749.40

# So it's not clear that using 20 digits of working precision
# produces a significantly different result than using (roughly 15-digits)
# hardware double precision evalhf. But at least we now have a working
# mechanism for trying it.
#
# Forcing a higher software-float working precision of the integrand incurs
# much more memory management (ie. "bytes used") than does using evalhf
# double-precision, but at least memory allocation doesn't go through the roof.
#

 

Download Maple_prime_integration_ac.mw

Yes, there is.

Click on your handle/name. Then click on the tab that says Questions.

Have you tried adding the frames option to the calls to the plots:-odeplot command?

restart:

with(linalg):
with(DEtools):

#Sonde
Position := [x(t), y(t)]:

#Terre
omega1 :=2*Pi:
r1 := [cos(omega1*t), sin(omega1*t)]:
x1(t) := innerprod([1, 0], r1):
y1(t) := innerprod([0, 1], r1):

#Mars
omega2 := sqrt(2)*Pi/2:
phi2 := Pi/2:
r2 := [2*cos(omega2*t + phi2), 2*sin(omega2*t+ phi2)]:
x2(t):= innerprod([1, 0], r2):
y2(t):= innerprod([0, 1], r2):

#Les couplages gravitationnelles (masse).
c1 := 1.0:
c2 := 0.2:
c0 := 100:

#Les forces appliqués sur la sonde
ForceGravitationnelle1 := -c1*(Position-r1)/(sqrt((x(t)-x1(t))^2+(y(t)-y1(t))^2))^3:
ForceGravitationnelle2 := -c2*(Position-r2)/(sqrt((x(t)-x2(t))^2+(y(t)-y2(t))^2))^3:
ForceGravitationnelle0 := -c0*(Position)/(sqrt((x(t))^2+(y(t))^2))^3:

#La somme des forces.
Force := ForceGravitationnelle1 + ForceGravitationnelle2 + ForceGravitationnelle0:

Fx := innerprod([1, 0], Force):
Fy := innerprod([0, 1], Force):

#L'interval de temps.
TempsInit := 0:
TempsFinal := 3:

#Les équations différentielles de deuxieme ordre.
eq1x := (D(D(x)))(t) = Fx:
eq1y := (D(D(y)))(t) = Fy:

#Les conditions initiales..
phi0 :=(Pi)/2:
V0 := 12.946802:
x0 := 1:
y0 := 0.1:
Vx0 := V0*cos(phi0):
Vy0 := V0*sin(phi0):

ConditionsInit := x(0) = x0, y(0) = y0, D(x)(0) = Vx0, D(y)(0) = Vy0:

#La trajectoire de la sonde.
Trajectoire := dsolve({eq1x, eq1y, ConditionsInit}, {x(t), y(t)}, numeric, range = TempsInit..TempsFinal, maxfun=0):

#Tracage du graphique de la trajectoire en 2D
plots[odeplot](Trajectoire, [[0,0],[x1(t),y1(t)],[x2(t), y2(t)], [x(t), y(t)]],
TempsInit..TempsFinal,
frames = 49,
numpoints = 1000, axes = boxed, scaling = constrained, thickness = [2],
color = ["Black", "Green", "Blue", "Red"],
labels = ["X (L)", "Y (L)"], gridlines=false,
labelfont = ["Times", 14], title = "Mouvement de la sonde dans le plan",
titlefont = ["Helvetica", 14], style=[point,line,line,line], symbol = solidcircle);

#Tracage du graphique en 3D:
plots[odeplot](Trajectoire, [[0,0,t],[x1(t),y1(t), t],[x2(t), y2(t), t], [x(t), y(t), t]],
TempsInit..TempsFinal, numpoints = 1000, axes = boxed, scaling = constrained, thickness = [3],
frames = 39,
color = ["Black", "Green", "Blue", "Red"],
labels = ["X (L)", "Y (L)", "t"],
labelfont = ["Times", 14], title = "Mouvement de la sonde dans le plan",
titlefont = ["Helvetica", 14], style=[point,line,line,line], symbol = solidcircle);
 

 

 

 

 

Download SondeII_ac.mw

A:=Matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]);

Matrix(4, 3, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (2, 1) = 4, (2, 2) = 5, (2, 3) = 6, (3, 1) = 7, (3, 2) = 8, (3, 3) = 9, (4, 1) = 10, (4, 2) = 11, (4, 3) = 12})

A[[4,3,2,1],..];

Matrix(4, 3, {(1, 1) = 10, (1, 2) = 11, (1, 3) = 12, (2, 1) = 7, (2, 2) = 8, (2, 3) = 9, (3, 1) = 4, (3, 2) = 5, (3, 3) = 6, (4, 1) = 1, (4, 2) = 2, (4, 3) = 3})

A[5-~[$1..4],..];

Matrix(4, 3, {(1, 1) = 10, (1, 2) = 11, (1, 3) = 12, (2, 1) = 7, (2, 2) = 8, (2, 3) = 9, (3, 1) = 4, (3, 2) = 5, (3, 3) = 6, (4, 1) = 1, (4, 2) = 2, (4, 3) = 3})

A[[seq(i,i=4..1,-1)],..];

Matrix(4, 3, {(1, 1) = 10, (1, 2) = 11, (1, 3) = 12, (2, 1) = 7, (2, 2) = 8, (2, 3) = 9, (3, 1) = 4, (3, 2) = 5, (3, 3) = 6, (4, 1) = 1, (4, 2) = 2, (4, 3) = 3})

ArrayTools:-FlipDimension(A,1);

Matrix(4, 3, {(1, 1) = 10, (1, 2) = 11, (1, 3) = 12, (2, 1) = 7, (2, 2) = 8, (2, 3) = 9, (3, 1) = 4, (3, 2) = 5, (3, 3) = 6, (4, 1) = 1, (4, 2) = 2, (4, 3) = 3})

 

Download rowrev.mw

ee,ff,gg,hh := 22*Pi/3, Pi/2, -22*Pi/3, -Pi/2;

                     22 Pi   Pi     22 Pi     Pi
   ee, ff, gg, hh := -----, ----, - -----, - ----
                       3     2        3       2

trunc(ee/Pi), trunc(ff/Pi), trunc(gg/Pi), trunc(hh/Pi);

                     7, 0, -7, 0

frac(ee/Pi), frac(ff/Pi), frac(gg/Pi), frac(hh/Pi);

                1/3, 1/2, -1/3, -1/2

If you pass a list of two imported images to the ImageTools:-Embed command then it should embed them side by side in a GUI Table.

Anther choice would be to make them both subimages of an otherwise purely white (or black, etc) image.

When you write that they were created in another program I take it that you mean you have a pair of image files produced by that other program.

When you talk of creating the plots in Maple do you mean doing all the computation, or simply importing the underlying numeric data?

For what general interest it might have, here is an example of taking two previously constructed animations (with the same number of frames) and merging them into a single animation of so-called array-plots.

I used Maple 2019.0 for this. It's possible that it'd function differently in another version.

restart;

kernelopts(version);

`Maple 2019.0, X86 64 LINUX, Mar 9 2019, Build ID 1384062`

A1 := plots:-animate(plot,[sin(x*t),x=-5..5],t=0..1):
A2 := plots:-animate(plot,[cos(x*t),x=-5..5],t=0..1):

plots:-display(seq(plots:-display(Array([PLOT(op([1,i,..],A1)),
                                         PLOT(op([1,i,..],A2))])),
                   i=1..nops(op([1],A1))),insequence=true,size=[800,400]);

 

Download merged_anim_2019.0.mw

Adjustments could be made to the seq generation, to accomodate the case that the two animations had a differering number of frames.

It seems that it's possible to right-click export the above an obtain a single animated GIF file that shows both plots.

[edit] I think I might recall now how/why this works, and so I've deleted some of my earlier commentary. IIRC there is some code inside plots:-display which can "merge" multiple 2D plots in an array-plot by stuffing them into a single PLOT structure (by translating them horizontally and faking the tickmarks). I doubt works for 3D plots. So in this example each frame is one of these things. That'd also explain why it can export them both to a single animated GIF. I'll note that it gives the effect of allowing the (apparent) separate animations to show with a dynamic "view", as opposed to the view being global across frames. I suspect that more truly global qualities like gridlines cannot be different for the "separate" plot things here. [/edit]

Note the syntax := rather than just = for the assignment to sys.

sys := {1800*40+15*(300*30)-30*Biy = 0, -1800+Biy+Ciy-300*30 = 0};

   sys := {207000 - 30 Biy = 0, -10800 + Biy + Ciy = 0}

ans := fsolve(sys);

          ans := {Biy = 6900., Ciy = 3900.}

eval(Biy, ans);

                   6900.

If you use equals rather than colon-equals then you're just creating an equation and not performing an assignment.

restart;

sys = {1800*40+15*(300*30)-30*Biy = 0, -1800+Biy+Ciy-300*30 = 0};

   sys = {207000 - 30 Biy = 0, -10800 + Biy + Ciy = 0}

sys; # was not assigned
                   sys

There are several aspects to improving performance here.

One aspect is the Maple level overhead that occurs before the external call to the compiled cuhre library. Another aspect is the what optimizations can be gained by parallelization.

It's often a good idea to make sure that the serial version runs as fast as possible before trying to paralellize.

Let's consider Library-level overhead first.
 - Don't load all of Student:-MultivariableCalculus. If you need one of its exported commands (and it appears that you don't) then call by its explicit long-form name.
 - Ensure that the integrand is evalhf'able (yours was, so good).
 - Use the operator form calling sequence, rather than expression form, for the integrand. (That saves Maple from having to figure out just how to call `makeproc`.)

I am not sure that the usual entry-points of evalf(Int(...) or int(...,numeric) are thread-safe at the Library level, even when using operator form. At least once I got a seg-fault from the external routine, which I suspect is because the threads were mashing data at the Library level (but I'm not 100% sure why).

If I get time I may look at what overhead could be avoided by calling `evalf/int/MultipleInt`:-cuhre directly with operator form integrand, or possibly even duplicate its methodology. I suspect that Library-level overhead is a measurable portion even for the best timing I show below.

As far as parallelization goes, there is still the distinction between the timing cost of the external code and the preliminary Library-level lead-up the external call.
 - The call_external to the cuhre library may be thread-blocking (I haven't checked yet) and if so then there may also be even greater parallelization benefit in toggling that off (presuming it's thread-safe).
 - There are some small float[8] Arrays that get created each time, and it's plausible that making them be thread-local to a rewritten module implementation of `evalf/int/MultipleInt`:-cuhre could allow them to be be re-used and save on memory management overhead.
 - For this kind of work I'm often only satisfied when I see the amount of garbage collection ("memory used") get very small. At N=30000 it is still 500MB in the best below. The total gc real-time may be only 0.25-0.5sec but I'd prefer it were closer to 0sec.

Anyway, there's lots to consider. Maybe I'll find some spare time for it.

Your original with operator form: thread_mp_ac1.mw

Here's a larger example (starting from Carl's example), with various flavors of operator versus expression form. Run in 64bit Linux Maple 2019.0 on a quad-core i5.

Using Threads:-Add along with operator form integrands has the best performance of these.

restart; randomize(37):

L1:=10: N:=30000: xx:=Statistics:-Sample(Uniform(0,100),N):

# without Threads, expression form
CodeTools:-Usage(
   add(int(sin(beta)/(100+ZZ*sin(beta)-xx[i]*cos(beta))^(5/2),
           [beta=0..1,ZZ=0..L1],numeric,epsilon=0.01,method=_cuhre),
       i=1..N));

memory used=0.97GiB, alloc change=36.00MiB, cpu time=12.64s, real time=12.64s, gc time=391.34ms

313.5727603

restart; randomize(37):

L1:=10: N:=30000: xx:=Statistics:-Sample(Uniform(0,100),N):

# with Threads, expression form
CodeTools:-Usage(
   Threads:-Add(int(sin(beta)/(100+ZZ*sin(beta)-xx[i]*cos(beta))^(5/2),
                    [beta=0..1,ZZ=0..L1],numeric,epsilon=0.01,method=_cuhre),
                i=1..N));

memory used=1.00GiB, alloc change=414.57MiB, cpu time=16.97s, real time=4.86s, gc time=1.17s

313.5727603

restart; randomize(37):

L1:=10: N:=30000: xx:=Statistics:-Sample(Uniform(0,100),N):

# without Threads, operator form without scoping
F:=(beta,ZZ)->sin(beta)/(100+ZZ*sin(beta)-__XX*cos(beta))^(5/2):
CodeTools:-Usage(
   add(int(subs(__XX=xx[i],eval(F)),
           [0..1,0..L1],numeric,epsilon=0.01,method=_cuhre),
       i=1..N));

memory used=0.51GiB, alloc change=36.00MiB, cpu time=7.61s, real time=7.61s, gc time=209.40ms

313.5727603

restart; randomize(37):

L1:=10: N:=30000: xx:=Statistics:-Sample(Uniform(0,100),N):

# with Threads, operator form with scoping
CodeTools:-Usage(
   Threads:-Add(int((beta,ZZ)->sin(beta)/(100+ZZ*sin(beta)-xx[i]*cos(beta))^(5/2),
                    [0..1,0..L1],numeric,epsilon=0.01,method=_cuhre),
                i=1..N));

memory used=508.07MiB, alloc change=206.57MiB, cpu time=10.28s, real time=3.91s, gc time=580.84ms

313.5727603

restart; randomize(37):

L1:=10: N:=30000: xx:=Statistics:-Sample(Uniform(0,100),N):

# with Threads, operator form without scoping

F:=(beta,ZZ)->sin(beta)/(100+ZZ*sin(beta)-__XX*cos(beta))^(5/2):
CodeTools:-Usage(
   Threads:-Add(int(subs(__XX=xx[i],eval(F)),
                    [0..1,0..L1],numeric,epsilon=0.01,method=_cuhre),
                i=1..N));

memory used=0.53GiB, alloc change=318.57MiB, cpu time=10.56s, real time=3.44s, gc time=685.54ms

313.5727603

 

Download cuhreperf.mw

 

(It's more polite to include a link to your uploaded worksheet, so that nobody else has to type it all out.)

There are a variety of possible ways.

There's less need for extra care and effort if you know that j+1 won't appear anywhere but as an index of T.

restart;

PDE:=k*diff(T(x,t),x$2)=diff(T(x,t),t);

k*(diff(diff(T(x, t), x), x)) = diff(T(x, t), t)

tay2_imp:=(T[i+1,j+1]-2*(T[i,j+1])+T[i-1,j+1])/(Dx^2);

(T[i+1, j+1]-2*T[i, j+1]+T[i-1, j+1])/Dx^2

taylot:=(T[i,j+1]-T[i,j])/(Dt);

(T[i, j+1]-T[i, j])/Dt

PDE_imp:=expand(subs({diff(T(x,t),x$2)=tay2_imp,diff(T(x,t),t)=taylot},PDE));

k*T[i+1, j+1]/Dx^2-2*k*T[i, j+1]/Dx^2+k*T[i-1, j+1]/Dx^2 = T[i, j+1]/Dt-T[i, j]/Dt

# crude way
(lhs-rhs)(map[2](select,has,PDE_imp,j+1))
= (rhs-lhs)(map[2](remove,has,PDE_imp,j+1));

k*T[i+1, j+1]/Dx^2-2*k*T[i, j+1]/Dx^2+k*T[i-1, j+1]/Dx^2-T[i, j+1]/Dt = -T[i, j]/Dt

mytype:=And(typeindex(identical(T)),patindex[reverse](anything,identical(j+1))):

 

# somewhat more robust way
ans := (lhs-rhs)(map[2](select,hastype,PDE_imp,mytype))
= (rhs-lhs)(map[2](remove,hastype,PDE_imp,mytype));

k*T[i+1, j+1]/Dx^2-2*k*T[i, j+1]/Dx^2+k*T[i-1, j+1]/Dx^2-T[i, j+1]/Dt = -T[i, j]/Dt

# and for fun
collect(ans,[indets(ans,typeindex(identical(T)))[]]);

(-2*k/Dx^2-1/Dt)*T[i, j+1]+k*T[i+1, j+1]/Dx^2+k*T[i-1, j+1]/Dx^2 = -T[i, j]/Dt

Download isol_index.mw

Here is something you might be able to work with.

The basic idea is this. If both sides of the equation are products of terms then do as follows:
 - freeze the multiplicands of both sides
 - divide both sides by the intersection of those multiplicands
 - thaw and simplify

It's quite possible that the freezing/thawing might not be necessary. I put them in to strive for generality. I would not be surprised if there were examples where it helped and other examples where it hindered.

I used simplify(expand(...),size) up front to try and get both sides to be simplified products. But for other examples that might be helped by other means, eg. factor.

By the way, why do you start out with (black) active sum calls instead of (gray) inert Sum calls. Those sum calls don't seem to compute closed forms (ie, they return as unevaluated sum calls). But every time you manipulate or simplify the expressions you have to wait while it tries in vain to compute closed forms for the newer sum calls.

restart;

E2 := (sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(j+1)*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(j-1)*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)-4*(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*(l+1)*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*(l-1)*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L) = h^2*(sum(sum(`#mover(mi("&rho;",fontstyle = "normal"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)

(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(j+1)*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(j-1)*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)-4*(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*(l+1)*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*(l-1)*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L) = h^2*(sum(sum(`#mover(mi("&rho;",fontstyle = "normal"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)

E3 := E2*J*L; E4 := simplify(lhs(E3)) = simplify(rhs(E3))

J*L*((sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(j+1)*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(j-1)*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)-4*(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*(l+1)*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*(l-1)*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)) = h^2*(sum(sum(`#mover(mi("&rho;",fontstyle = "normal"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))

sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*(m*(j+1)*L+l*n*J)*Pi/(J*L)), n = 0 .. L-1), m = 0 .. J-1)+sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*(m*(j-1)*L+l*n*J)*Pi/(J*L)), n = 0 .. L-1), m = 0 .. J-1)-4*(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L)), n = 0 .. L-1), m = 0 .. J-1))+sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(n*(l+1)*J+m*L*j)/(J*L)), n = 0 .. L-1), m = 0 .. J-1)+sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(J*n*(l-1)+m*L*j)/(J*L)), n = 0 .. L-1), m = 0 .. J-1) = h^2*(sum(sum(`#mover(mi("&rho;",fontstyle = "normal"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L)), n = 0 .. L-1), m = 0 .. J-1))

 

T := subsindets(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*(m*(j+1)*L+l*n*J)*Pi/(J*L)), n = 0 .. L-1), m = 0 .. J-1)+sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*(m*(j-1)*L+l*n*J)*Pi/(J*L)), n = 0 .. L-1), m = 0 .. J-1)-4*(sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L)), n = 0 .. L-1), m = 0 .. J-1))+sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(n*(l+1)*J+L*j*m)/(J*L)), n = 0 .. L-1), m = 0 .. J-1)+sum(sum(`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(J*n*(l-1)+L*j*m)/(J*L)), n = 0 .. L-1), m = 0 .. J-1) = h^2*(sum(sum(`#mover(mi("&rho;",fontstyle = "normal"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L)), n = 0 .. L-1), m = 0 .. J-1)), specfunc({Sum, sum}), proc (S) options operator, arrow; op(1, S) end proc)

`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*(m*(j+1)*L+l*n*J)*Pi/(J*L))+`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*(m*(j-1)*L+l*n*J)*Pi/(J*L))-4*`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L))+`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(n*(l+1)*J+m*L*j)/(J*L))+`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(J*n*(l-1)+m*L*j)/(J*L)) = h^2*`#mover(mi("&rho;",fontstyle = "normal"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L))

 

simplify((`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*(m*(j+1)*L+l*n*J)*Pi/(J*L))+`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*(m*(j-1)*L+l*n*J)*Pi/(J*L))-4*`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L))+`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(n*(l+1)*J+L*j*m)/(J*L))+`#mover(mi("u"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(J*n*(l-1)+L*j*m)/(J*L)) = h^2*`#mover(mi("&rho;",fontstyle = "normal"),mo("&circ;"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L)))*(1/exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L))))

2*`#mover(mi("u"),mo("&circ;"))`[m, n]*(-2+cos(2*Pi*m/J)+cos(2*Pi*n/L)) = h^2*`#mover(mi("&rho;",fontstyle = "normal"),mo("&circ;"))`[m, n]

TT := simplify(expand((T)),size):
if lhs(TT)::`*` and rhs(TT)::`*` then
  TTT := map[2](map,freeze,TT);
  comm := `*`(op({op(lhs(TTT))} intersect {op(rhs(TTT))}));
  new := simplify(thaw(lhs(TTT)/comm=rhs(TTT)/comm));
end if:
new;

2*`#mover(mi("u"),mo("&circ;"))`[m, n]*(-2+cos(2*Pi*m/J)+cos(2*Pi*n/L)) = h^2*`#mover(mi("&rho;",fontstyle = "normal"),mo("&circ;"))`[m, n]

 

Download common_factors_ac.mw

restart;

kernelopts(version);

`Maple 2019.0, X86 64 LINUX, Mar 9 2019, Build ID 1384062`

T:=JSON:-ParseFile("https://api.myjson.com/bins/16knzm");

[table( [( "proc" ) = "getName := proc() return 'Maple' end proc:" ] ), table( [( "proc" ) = "getAge := proc() return 2018 end proc:" ] )]

parse(T[1]["proc"],statement);

proc () return 'Maple' end proc

proc () return 'Maple' end proc

getName();

Maple

parse(T[2]["proc"],statement);

proc () return 2018 end proc

proc () return 2018 end proc

getAge();

2018

# Alternative to JSON:-ParseFile
Import("https://api.myjson.com/bins/16knzm");

[table( [( "proc" ) = "getName := proc() return 'Maple' end proc:" ] ), table( [( "proc" ) = "getAge := proc() return 2018 end proc:" ] )]

 

Download JSON_example.mw

The red spam square appears visible to you because you have elevated moderator status on this site. Most members do not.

The red box only shows for postings by new members which have not yet received vote-ups (and possible Answers, I'm not sure).

If -- as moderator -- you were to remove a posting using thd red spam box then that member's account would also be deactivated.

I delete (as spam) postings from one or two advertisers (cleaning products, rivet wholesellers, etc.) each day. This forum used to be inundated with such. It was a big problem.

There is also a mechanism for moderators to delete unanswered single items ( as "Inappropriate", "Duplicate", etc) without affecting the poster's membership status.

First 153 154 155 156 157 158 159 Last Page 155 of 336