acer

32717 Reputation

29 Badges

20 years, 82 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

You may have not noticed that those commands are part of the plots package. That means that you can use them in these two ways:

1) With the full long-form name, eg.
        plots:-densityplot( ... )

2) After loading the plots package, eg.
        with(plots):
        densityplot( ... )

But densityplot and the others you mentioned are not themselves top-level commands. So you'll need to use something like one of those approaches above. (There are a few other ways, but these two are common.)

This issue is not specific to your example containing parse. You could get the same output as your original by just this:

  plots:-textplot([1,1,Pi/6]);

You could then compare that with the following, which I suppose is what you are after,

  plots:-textplot([1,1,Typesetting:-Typeset(Pi/6)]);

The difference is just be that it is the GUI which decides how to markup the former, and the Library which can pre-empt that for the latter.

There are several other ways to get the same effect, if say you start off with the string, eg.

  K := parse("Pi/6"):
  plots:-textplot([1,1,Typesetting:-Typeset(Typesetting:-EV(K))]);

  plots:-textplot([1,1,eval('Typesetting:-Typeset'(parse("Pi/6")))]);

The underlying issue is that the GUI alone does not mark up textplot math (even if you wrap with a plotting-specific typeset call) in exactly the same manner that the GUI alone marks up 2D Output. I'd say it's a GUI bug.

Here are two ways that work in Maple 2016.

[edit] I've also included Bart's suggestion to use a thickness value of 0.1 which produces a thinner result than thickness 0. (But that needs my subsindets solution since my suggestion to use the overrideoptions in plots:-display doesn't allow it.) [/edit]

They look nicer in Maple than here, since this site's backend renderer isn't very good.

(There are other ways to alter the thickness of the plot generated from the Graph, but these below are not that difficult.)

restart;

kernelopts(version);

`Maple 2016.2, X86 64 LINUX, Jan 13 2017, Build ID 1194701`

with(GraphTheory):

with(RandomGraphs):

G := RandomGraph(100, 1000):

P:=DrawGraph(G):

P;

subsindets(P,specfunc(THICKNESS),()->THICKNESS(0));

subsindets(P,specfunc(THICKNESS),()->THICKNESS(0.1));

plots:-display(subsindets(P,specfunc(THICKNESS),()->THICKNESS(0.1)),
               size=[600,600]);

 

Download graph_thickness_2016_2.mw

Here's an exported .png file, which reproduces better how it appears in the actual Maple GUI.

plots:-display(subsindets(P,specfunc(THICKNESS),()->THICKNESS(0.1)),
               size=[600,600]);

You have defined a[0],a[1],a[2] in terms of the name a and that's wrong. I have replaced the unindexed name a with A below.

I have also replaced gamma with h since gamma is a defined constant in Maple and perhaps you did not know that (and do not want the consequences that could follow from it).

restart;

kernelopts(version);

`Maple 18.02, X86 64 LINUX, Oct 20 2014, Build ID 991181`

lambda := 1: mu := 1: alpha := 1: v := 2:

delta := 1: m := 1: d := 3: l := 1:

omega := -(1/2)*A*lambda^2-A*m^2+2*A*mu*v-delta*l*m
         -(1/2)*delta*lambda^2+2*delta*mu*v-l^2*mu
         -(1/2)*lambda^2*mu+2*mu^2*v-2*A*mu-2*delta*mu-2*mu^2:

a[0] := ((2*d*v-2*d-lambda)*(1/2))*sqrt(2)*sqrt(h*(A+delta+mu))/h:

a[1] := 0:

a[2] := -(2*(1/2))*sqrt(2)*sqrt(h*(A+delta+mu))*(d^2*v-d^2-d*lambda+mu)/h:

Omega := lambda^2-4*mu*v+4*mu:

H := (-lambda+sqrt(-Omega)*tan((1/2)*sqrt(-Omega)*xi))/(2*(v-1)):

u := a[0]+a[1]*(d+H)+a[2]/(d+H):

eta := -l*y-m*x+omega*t:

u := a[0]+a[1]*(d+H)+a[2]/(d+H):

f := diff(u, xi):

S := diff(u, xi):   

xi := x+y-(-2*alpha*m-delta*l-delta*m-2*l*mu)*t:

eq := (-omega-A*m*m-delta*l*m-mu*l*l)*u-(h*u*u)*u+(A+delta+mu)*S;

(-(3/2)*A-3)*((5/2)*2^(1/2)*(h*(A+2))^(1/2)/h-7*2^(1/2)*(h*(A+2))^(1/2)/(h*(5/2+(1/2)*3^(1/2)*tan((1/2)*3^(1/2)*(x+y+6*t)))))-h*((5/2)*2^(1/2)*(h*(A+2))^(1/2)/h-7*2^(1/2)*(h*(A+2))^(1/2)/(h*(5/2+(1/2)*3^(1/2)*tan((1/2)*3^(1/2)*(x+y+6*t)))))^3+7*(A+2)*2^(1/2)*(h*(A+2))^(1/2)*(3/4+(3/4)*tan((1/2)*3^(1/2)*(x+y+6*t))^2)/(h*(5/2+(1/2)*3^(1/2)*tan((1/2)*3^(1/2)*(x+y+6*t)))^2)

new := simplify(eq,size);

-84*2^(1/2)*(h*(A+2))^(1/2)*(tan((1/2)*3^(1/2)*(x+y+6*t))^2+1)*(3^(1/2)*tan((1/2)*3^(1/2)*(x+y+6*t))-2)*(A+2)/(h*(3^(1/2)*tan((1/2)*3^(1/2)*(x+y+6*t))+5)^3)

simplify(eq-new);

0

new2 := map(simplify,new);

-84*2^(1/2)*(h*(A+2))^(1/2)*(3^(1/2)*tan((1/2)*3^(1/2)*(x+y+6*t))-2)*(A+2)/(h*cos((1/2)*3^(1/2)*(x+y+6*t))^2*(3^(1/2)*tan((1/2)*3^(1/2)*(x+y+6*t))+5)^3)

simplify(eq-new2);

0

 

Download s_example2.mw

You have an assignment statement following an end do that lacks a terminator (color or semicolon).

If I examine the (wide, red-bordered) syntax message after executing your original then I can see that the problematic point is encapsulated in an extra red border. It occurs right before the assignment to XT(timeCounter+1). You should be able to see it too, if you use the horizontal scrollbar.

durb_ac.mw

You could make sure that you're running the latest upgrade (ie. free point-release upgrade) for your major version of Maple.

For example, if you installed Maple 2018.0 then you could make sure that you've made the free upgrade to Maple 2018.2.1.

You did not mention which version you had, but it may be worth mentioning that the release-notes of Maple 2018.2.1 specifically mention a fix for, "...a problem that resulted in a _noterminate error message".

You can use the command Typesetting:-Settings to control whether the prime notation in 2D Input is parsed as a derivative.

restart;

Typesetting:-Settings(useprime); # default is true

true

diff(f(x), x)

diff(f(x), x)

Typesetting:-Settings(useprime=false):

diff(f(x), x)

`#msup(mi("f"),mo("'"))`

Typesetting:-Settings(useprime=true):

diff(f(x), x)

diff(f(x), x)

``

Download useprime.mw

Note that the input above does need use of backtick quotes.

See the help page for Typesetting:-Settings for related controls and choices.

You could try passing the additional option allsolutions to the solve command.

It might also be relevant to pass the explicit option. (I used this option in an Answer to a previous question by you, to which so far you've not responded.)

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
First 156 157 158 159 160 161 162 Last Page 158 of 340