acer

32343 Reputation

29 Badges

19 years, 327 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

You forgot to give numeric values for A and `ϑ` .

Are you trying to get y-values for the curves at a common set of sigma values?

That is possible for the upper four curves, since they start (or finish) at the same value of sigma.

It's not clear what meaning it would have to conjoin the lower curves, since they start at different values of sigma. Please explain what you hope to represent by the 1001x4 Matrix, for those lower curves.

fig10_ac.mw

f := (x, y) -> sin(x)*cos(y):

plot3d(f, -Pi .. Pi, -2*Pi .. 2*Pi,
       style = surfacecontour,
       labels = ["x","y","f"]);

Or, with your own custom choice of contour values (heights),

plot3d(f, -Pi .. Pi, -2*Pi .. 2*Pi,
       style = surfacecontour,
       contours = [-0.5, 0.0, 0.5]);

I consider setting UseHardwareFloats to true as a top-level initialization to be highly dubious.

The default setting is deduced, which means that if Digits<=15 then most Library procedures which take into account such things will already treat deduced like true. You're not getting a whole whack more computations being done with hardware floats with true than you would with deduced, provided that Digits<=15.

Setting it to true will prevent some procedures from working with higher precision software floats, even when they decide either that they should or that they need to for correctness.

If you want scalar floats to be HFloats for some computations, or to always be HFloats when pulled out of datatype=float[8] rtables, then restrict the forced UseHardwareFloats setting to within a procedure (as Joe mentioned, environment variables don't affect the higher scope, by design). Or put option hfloat on such procedures.

If the only big effect of setting UseHardwareFloats:=true was to speed up calculations by doing it all in hardware double precision then it would be Maplesoft's default. But it's not. That setting hobbles the system, understandably IMO.

 

restart;

dsys := {diff(y(t),t)=-y(t-1),y(0)=2}:

dsn := dsolve(dsys, numeric, output=listprocedure):

yfun := eval(y(t), dsn):

yfun(0.0);

HFloat(2.0)

yfun(1.4);

HFloat(-0.6399999629131263)

plot([D[1](yfun)(t), -yfun(t-1)], t=0 .. 6,
     style=[line,point], gridlines=false,
     symbolsize=15, symbol=solidcircle,
     adaptive=false, numpoints=21);

 

Download dde.mw

r := 1.9;
                            r := 1.9
i := trunc(r);
                             i := 1

First of all, you don't tell us anything about the qualitative nature of the plot you are expecting, or what specifically you object to above the plot originally produced. (The thing you wrote about "two arguments" makes no literal sense.)

We can of course guess that you object to the sign flip between the discontinuities. But tell us precisely.

Next, while it may not be the cause of your issues, it looks like a really bad idea to apply evalf all over the place, and have those float exponents. Do you understand that when there are branch-cut issues -- around say rational multiples of Pi -- turning exact values into floating-point representations can be trouble. If the float rounds just above..., or just below..., the behavior can change.

So, I am guessing that the combine(zeta_c, symbolic) might resolve your issue. (But, really, you're the one who supplied the various exp calls in the first place, without explanation or source...)

Here's one version with floats, and one without. Is this the plot you expected? Or perhaps as likely, its negation?

Toya_complexPlot2_ac.mw

Toya_complexPlot2_ac_exact.mw

I no longer believe in coincidences.

Working on another question here -- right now -- I stumbled across the same phenomenon.

The problem is the gridlines option, which your .mapleinit sets to true in a call to plots:-setoptions.

If I include that gridlines setting, then the GUI goes bonkers in the way described when I try to use plottools:-transform to raise a 2D plot up to 3D. (I have to use the menubar's Edit->Remove Output From Worksheet, then Save As another filename, then File->Close, then re-open, etc, to recover.

But if I exclude that setting then it goes OK.

I found this out, on the side, because I now habitually use plots:-setoptions to set gridlines=false so that the ancient Mapleprimes backend MapleNet engine doesn't render my inlined worksheet's 2D plots with ugly gridlines.

And then when I tried to transform a 2D plot to 3D I saw the same GUI crash, in Maple 2018.1 on 64bit Linux.

One might guess that setting gridlines=false wouldn't do anything concrete, since the default in the Maple GUI is not to show gridlines when no option for it is supplied. But in recent versions of Maple it actually puts a _GRIDLINES substructure within the PLOT structure of a 2D plot.

Anyway, the problem seems to happen whether the 2D plot is constructed with gridlines=true or gridlines=false.

Anyway, either the plottools:-transform command doesn't handle the GRIDLINES substructure properly when converting from PLOT to PLOT3D, or the GUI is mis-handling what it gets. Probably the former, where plottools is now failing to strip it out, since 3D plots don't really support gridlines. I will submit a bug report.

If you wish to retain your use of the gridlines option within the setoptions call, you could work around the issue by stripping out the _GRIDLINES structure.

restart;

plots[setoptions](axes=boxed,gridlines=true,symbol=solidcircle,symbolsize=20,\
font=[Palatino,Roman,18],labeldirections=[default,vertical]):

XX := [0.972801894435012e-2, 0.291840568330504e-1, 0.486400947217506e-1, 0.680961326104508e-1, 0.875521704991511e-1, .107008208387851, .126464246276552, .145920284165252, .165376322053952, .184832359942652, .204288397831353, .223744435720053, .243200473608753, .262656511497453, .282112549386153, .301568587274854, .321024625163554, .340480663052254, .359936700940954, .379392738829655, .398848776718355, .418304814607055, .437760852495755, .457216890384456, .476672928273156, .496128966161856, .515585004050556, .535041041939257, .554497079827957, .573953117716657, .593409155605357, .612865193494058, .632321231382758, .651777269271458, .671233307160158, .690689345048859, .710145382937559, .729601420826259, .749057458714959, .768513496603660, .787969534492360, .807425572381060, .826881610269760, .846337648158460, .865793686047161, .885249723935861, .904705761824561, .924161799713261, .943617837601962, .963073875490662]:

YY := [0., 0., 0.780705528028337e-4, -0.211866241843197e-3, -0.184081483518222e-3, -5.92871649289528*10^(-7), 0.705340540980509e-4, -0.461174040475175e-4, 6.08388233646549*10^(-6), -8.17545249012504*10^(-6), 0.784067792614267e-4, 0.948234032955701e-4, 0.129200206984893e-3, 0.217379985100455e-3, 0.117812477986346e-3, 0.740892827191450e-4, 0.713995793942092e-4, 0.883487018223552e-4, 0.114636346351373e-3, 0.126761621156635e-3, 0.249346062938405e-3, 0.353610442001781e-3, 0.389331161267054e-3, 0.285297377949754e-3, 0.206965990122876e-3, 0.198776365299836e-3, 0.274456081855498e-3, 0.150247195410351e-3, 0.373870077694107e-3, 0.389541749965941e-3, 0.195404380104158e-3, 0.496058769010207e-4, 0.143186561641884e-3, 0.495342494399980e-4, 0.284041858195664e-3, 0.218772341089506e-3, 0.871267097462542e-4, 0.140083271975313e-3, 0.278100169819868e-3, 0.492898546422542e-4, 0.528148364100161e-4, 0.336946605866647e-3, 0.144331022273297e-3, 0.213563703188388e-3, 0.533896184036048e-4, -0.297228533778489e-4, 0.551702396397926e-4, 0.192723516977434e-3, -0.351998902998264e-4, -0.979722172527731e-2]:

plt:=plot(XX,YY,view=[default,0..0.003]);

tr:=plottools:-transform((x,y) -> [x,2,y]):

temp := subsindets(plt, 'specfunc(anything,_GRIDLINES)', ()->NULL):
plots:-display(tr(temp));

 

Download display3d_subs.mw

Try the command ListDirectory from the FileTools package.

Your main problem was that you were calling your procedure UP with GAMMA as the argument instead of the typeset GAMMA-with-an-overbar.

In order to use Grid:-Seq here you also need to tell the kernel to pass along the definitions of `index/xxx` and RrProc. For that you can use the Grid:-Set command. And also, pass Rr into UP.

I changed the unprotect(GAMMA) to local GAMMA as a top-level declaration. You don't anything like that for the typeset GAMMA-with-an-overbar.

Now the Grid:-Seq runs twice as fast as seq on the two UP calls, on my quad-core 64bit Linux machine under Maple 2017.2. I change M=5 to M=12, to make it take a little longer.

What matters is the real time, which is wall-clock time.

[edited] If I set M=100 to make it long enough to examine the timings better, it takes 33sec with Grid:-Seq and 66sec with serial seq. And the answers are the same. Under serial seq my Linux machine's load showed at 100% (one mserver process), while under Grid:-seq it showed at 200% (across two mserver processes). 

[edited] Your mileage here may vary with OS and Maple version, but this exercise leaves my OS running multiple defunct or orphaned mserver processes (taking no load, phew!), even when the GUI is completely quit. I have to kill them manually.

``

restart

kernelopts(version)

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

II := 2

2

JJ := 2

2

N := 2

_local(GAMMA)

q := max(II+1, JJ+1)

M := 12

seq(seq(seq(assign(GAMMA[i, j, r], a*`#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[i, j, r]), i = 0 .. q), j = 0 .. q), r = 1 .. N)

a := .2; b := 2; with(ArrayTools)

RrProc := proc (i, m) local K, j, Q; if i <= m then 0 else K := 1; Q := Matrix(i, 1); for j by 2 to i do Q(j) := 2*i-K; K := 4+K end do; Q := FlipDimension(Q, 1); Q(m+1) end if end proc; `index/xxx` := proc (L) RrProc(op(L)) end proc; Rr := table(xxx)
NULL

`#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))` := Array(0 .. II, 0 .. JJ, 1 .. 6, 1 .. M)

f1 := RandomArray(II+1, JJ+1); f2 := RandomArray(II+1, JJ+1); f3 := RandomArray(II+1, JJ+1); f4 := RandomArray(II+1, JJ+1); f5 := RandomArray(II+1, JJ+1); f6 := RandomArray(II+1, JJ+1)

for m to M do `&Gamma;m`[1, m] := f1; `&Gamma;m`[2, m] := f2; `&Gamma;m`[3, m] := f3; `&Gamma;m`[4, m] := f4; `&Gamma;m`[5, m] := f5; `&Gamma;m`[6, m] := f6 end do

for m to M do `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 1, m] := ArrayTools:-Alias(`&Gamma;m`[1, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 2, m] := ArrayTools:-Alias(`&Gamma;m`[2, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 3, m] := ArrayTools:-Alias(`&Gamma;m`[3, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 4, m] := ArrayTools:-Alias(`&Gamma;m`[4, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 5, m] := ArrayTools:-Alias(`&Gamma;m`[5, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 6, m] := ArrayTools:-Alias(`&Gamma;m`[6, m], [0 .. II, 0 .. JJ]) end do

UP := proc (s, GAMMA, N, M, a, b, II, JJ, Rr) local k; i, j, r, p, m, q, n, l; if s = 1 then add(add(add(add(add(add((2/3)*Rr[i, m]*Rr[k, m]*b*add(GAMMA[i, j, q, p]*GAMMA[k, j, q, r]*tau[p](t)*tau[r](t), q = 1 .. N)/((2*m+1)*(2*j+1)*a), i = 0 .. II), k = 0 .. II), m = 0 .. II), j = 0 .. JJ), p = 1 .. M), r = 1 .. M) elif s = 2 then add(add(add(add(add(add((1/2)*Rr[i, m]*Rr[k, m]*b*add(GAMMA[i, j, q, p]*GAMMA[k, j, q, r]*tau[p](t)*tau[r](t), q = 1 .. N)/((2*m+1)*(2*j+1)*a), i = 0 .. II), k = 0 .. II), m = 0 .. II), j = 0 .. JJ), p = 1 .. M), r = 1 .. M) end if end proc

Grid:-Set(`index/xxx`);
Grid:-Set(RrProc);

forget(evalf); ans1 := CodeTools:-Usage([Grid:-Seq(UP(s, `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`, N, M, a, b, II, JJ, Rr), s = 1 .. 2)])

memory used=186.05KiB, alloc change=2.19MiB, cpu time=15.00ms, real time=509.00ms, gc time=0ns

[HFloat(25.72145649709499)*tau[11](t)^2+HFloat(25.72145649709499)*tau[10](t)^2+HFloat(25.72145649709499)*tau[9](t)^2+HFloat(25.72145649709499)*tau[5](t)^2+HFloat(25.72145649709499)*tau[12](t)^2+HFloat(25.72145649709499)*tau[4](t)^2+HFloat(25.72145649709499)*tau[3](t)^2+HFloat(25.72145649709499)*tau[7](t)^2+HFloat(25.72145649709499)*tau[8](t)^2+HFloat(25.72145649709499)*tau[6](t)^2+HFloat(25.72145649709499)*tau[2](t)^2+HFloat(25.72145649709499)*tau[1](t)^2+HFloat(51.44291299418998)*tau[12](t)*tau[11](t)+HFloat(51.44291299418998)*tau[12](t)*tau[10](t)+HFloat(51.44291299418998)*tau[11](t)*tau[10](t)+HFloat(51.44291299418998)*tau[12](t)*tau[5](t)+HFloat(51.44291299418998)*tau[11](t)*tau[5](t)+HFloat(51.44291299418998)*tau[7](t)*tau[6](t)+HFloat(51.44291299418998)*tau[10](t)*tau[5](t)+HFloat(51.44291299418998)*tau[9](t)*tau[5](t)+HFloat(51.44291299418998)*tau[10](t)*tau[9](t)+HFloat(51.44291299418998)*tau[8](t)*tau[5](t)+HFloat(51.44291299418998)*tau[7](t)*tau[5](t)+HFloat(51.44291299418998)*tau[6](t)*tau[5](t)+HFloat(51.44291299418998)*tau[12](t)*tau[4](t)+HFloat(51.44291299418998)*tau[11](t)*tau[4](t)+HFloat(51.44291299418998)*tau[10](t)*tau[4](t)+HFloat(51.44291299418998)*tau[9](t)*tau[4](t)+HFloat(51.44291299418998)*tau[8](t)*tau[4](t)+HFloat(51.44291299418998)*tau[7](t)*tau[4](t)+HFloat(51.44291299418998)*tau[6](t)*tau[4](t)+HFloat(51.44291299418998)*tau[5](t)*tau[4](t)+HFloat(51.44291299418998)*tau[12](t)*tau[7](t)+HFloat(51.44291299418998)*tau[12](t)*tau[3](t)+HFloat(51.44291299418998)*tau[11](t)*tau[7](t)+HFloat(51.44291299418998)*tau[11](t)*tau[3](t)+HFloat(51.44291299418998)*tau[12](t)*tau[6](t)+HFloat(51.44291299418998)*tau[10](t)*tau[3](t)+HFloat(51.44291299418998)*tau[9](t)*tau[3](t)+HFloat(51.44291299418998)*tau[8](t)*tau[3](t)+HFloat(51.44291299418998)*tau[7](t)*tau[3](t)+HFloat(51.44291299418998)*tau[6](t)*tau[3](t)+HFloat(51.44291299418998)*tau[5](t)*tau[3](t)+HFloat(51.44291299418998)*tau[10](t)*tau[7](t)+HFloat(51.44291299418998)*tau[4](t)*tau[3](t)+HFloat(51.44291299418998)*tau[12](t)*tau[8](t)+HFloat(51.44291299418998)*tau[11](t)*tau[6](t)+HFloat(51.44291299418998)*tau[11](t)*tau[8](t)+HFloat(51.44291299418998)*tau[12](t)*tau[2](t)+HFloat(51.44291299418998)*tau[9](t)*tau[7](t)+HFloat(51.44291299418998)*tau[11](t)*tau[2](t)+HFloat(51.44291299418998)*tau[10](t)*tau[8](t)+HFloat(51.44291299418998)*tau[10](t)*tau[2](t)+HFloat(51.44291299418998)*tau[9](t)*tau[2](t)+HFloat(51.44291299418998)*tau[10](t)*tau[6](t)+HFloat(51.44291299418998)*tau[8](t)*tau[7](t)+HFloat(51.44291299418998)*tau[8](t)*tau[2](t)+HFloat(51.44291299418998)*tau[7](t)*tau[2](t)+HFloat(51.44291299418998)*tau[9](t)*tau[8](t)+HFloat(51.44291299418998)*tau[6](t)*tau[2](t)+HFloat(51.44291299418998)*tau[5](t)*tau[2](t)+HFloat(51.44291299418998)*tau[4](t)*tau[2](t)+HFloat(51.44291299418998)*tau[3](t)*tau[2](t)+HFloat(51.44291299418998)*tau[9](t)*tau[6](t)+HFloat(51.44291299418998)*tau[12](t)*tau[1](t)+HFloat(51.44291299418998)*tau[12](t)*tau[9](t)+HFloat(51.44291299418998)*tau[11](t)*tau[1](t)+HFloat(51.44291299418998)*tau[10](t)*tau[1](t)+HFloat(51.44291299418998)*tau[8](t)*tau[6](t)+HFloat(51.44291299418998)*tau[9](t)*tau[1](t)+HFloat(51.44291299418998)*tau[8](t)*tau[1](t)+HFloat(51.44291299418998)*tau[7](t)*tau[1](t)+HFloat(51.44291299418998)*tau[11](t)*tau[9](t)+HFloat(51.44291299418998)*tau[6](t)*tau[1](t)+HFloat(51.44291299418998)*tau[5](t)*tau[1](t)+HFloat(51.44291299418998)*tau[2](t)*tau[1](t)+HFloat(51.44291299418998)*tau[3](t)*tau[1](t)+HFloat(51.44291299418998)*tau[4](t)*tau[1](t), HFloat(19.291092372821243)*tau[11](t)^2+HFloat(19.291092372821243)*tau[10](t)^2+HFloat(19.291092372821243)*tau[9](t)^2+HFloat(19.291092372821243)*tau[5](t)^2+HFloat(19.291092372821243)*tau[12](t)^2+HFloat(19.291092372821243)*tau[4](t)^2+HFloat(19.291092372821243)*tau[3](t)^2+HFloat(19.291092372821243)*tau[7](t)^2+HFloat(19.291092372821243)*tau[8](t)^2+HFloat(19.291092372821243)*tau[6](t)^2+HFloat(19.291092372821243)*tau[2](t)^2+HFloat(19.291092372821243)*tau[1](t)^2+HFloat(38.582184745642486)*tau[12](t)*tau[11](t)+HFloat(38.582184745642486)*tau[12](t)*tau[10](t)+HFloat(38.582184745642486)*tau[11](t)*tau[10](t)+HFloat(38.582184745642486)*tau[12](t)*tau[5](t)+HFloat(38.582184745642486)*tau[11](t)*tau[5](t)+HFloat(38.582184745642486)*tau[7](t)*tau[6](t)+HFloat(38.582184745642486)*tau[10](t)*tau[5](t)+HFloat(38.582184745642486)*tau[9](t)*tau[5](t)+HFloat(38.582184745642486)*tau[10](t)*tau[9](t)+HFloat(38.582184745642486)*tau[8](t)*tau[5](t)+HFloat(38.582184745642486)*tau[7](t)*tau[5](t)+HFloat(38.582184745642486)*tau[6](t)*tau[5](t)+HFloat(38.582184745642486)*tau[12](t)*tau[4](t)+HFloat(38.582184745642486)*tau[11](t)*tau[4](t)+HFloat(38.582184745642486)*tau[10](t)*tau[4](t)+HFloat(38.582184745642486)*tau[9](t)*tau[4](t)+HFloat(38.582184745642486)*tau[8](t)*tau[4](t)+HFloat(38.582184745642486)*tau[7](t)*tau[4](t)+HFloat(38.582184745642486)*tau[6](t)*tau[4](t)+HFloat(38.582184745642486)*tau[5](t)*tau[4](t)+HFloat(38.582184745642486)*tau[12](t)*tau[7](t)+HFloat(38.582184745642486)*tau[12](t)*tau[3](t)+HFloat(38.582184745642486)*tau[11](t)*tau[7](t)+HFloat(38.582184745642486)*tau[11](t)*tau[3](t)+HFloat(38.582184745642486)*tau[12](t)*tau[6](t)+HFloat(38.582184745642486)*tau[10](t)*tau[3](t)+HFloat(38.582184745642486)*tau[9](t)*tau[3](t)+HFloat(38.582184745642486)*tau[8](t)*tau[3](t)+HFloat(38.582184745642486)*tau[7](t)*tau[3](t)+HFloat(38.582184745642486)*tau[6](t)*tau[3](t)+HFloat(38.582184745642486)*tau[5](t)*tau[3](t)+HFloat(38.582184745642486)*tau[10](t)*tau[7](t)+HFloat(38.582184745642486)*tau[4](t)*tau[3](t)+HFloat(38.582184745642486)*tau[12](t)*tau[8](t)+HFloat(38.582184745642486)*tau[11](t)*tau[6](t)+HFloat(38.582184745642486)*tau[11](t)*tau[8](t)+HFloat(38.582184745642486)*tau[12](t)*tau[2](t)+HFloat(38.582184745642486)*tau[9](t)*tau[7](t)+HFloat(38.582184745642486)*tau[11](t)*tau[2](t)+HFloat(38.582184745642486)*tau[10](t)*tau[8](t)+HFloat(38.582184745642486)*tau[10](t)*tau[2](t)+HFloat(38.582184745642486)*tau[9](t)*tau[2](t)+HFloat(38.582184745642486)*tau[10](t)*tau[6](t)+HFloat(38.582184745642486)*tau[8](t)*tau[7](t)+HFloat(38.582184745642486)*tau[8](t)*tau[2](t)+HFloat(38.582184745642486)*tau[7](t)*tau[2](t)+HFloat(38.582184745642486)*tau[9](t)*tau[8](t)+HFloat(38.582184745642486)*tau[6](t)*tau[2](t)+HFloat(38.582184745642486)*tau[5](t)*tau[2](t)+HFloat(38.582184745642486)*tau[4](t)*tau[2](t)+HFloat(38.582184745642486)*tau[3](t)*tau[2](t)+HFloat(38.582184745642486)*tau[9](t)*tau[6](t)+HFloat(38.582184745642486)*tau[12](t)*tau[1](t)+HFloat(38.582184745642486)*tau[12](t)*tau[9](t)+HFloat(38.582184745642486)*tau[11](t)*tau[1](t)+HFloat(38.582184745642486)*tau[10](t)*tau[1](t)+HFloat(38.582184745642486)*tau[8](t)*tau[6](t)+HFloat(38.582184745642486)*tau[9](t)*tau[1](t)+HFloat(38.582184745642486)*tau[8](t)*tau[1](t)+HFloat(38.582184745642486)*tau[7](t)*tau[1](t)+HFloat(38.582184745642486)*tau[11](t)*tau[9](t)+HFloat(38.582184745642486)*tau[6](t)*tau[1](t)+HFloat(38.582184745642486)*tau[5](t)*tau[1](t)+HFloat(38.582184745642486)*tau[2](t)*tau[1](t)+HFloat(38.582184745642486)*tau[3](t)*tau[1](t)+HFloat(38.582184745642486)*tau[4](t)*tau[1](t)]

forget(evalf); ans2 := CodeTools:-Usage([seq(UP(s, `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`, N, M, a, b, II, JJ, Rr), s = 1 .. 2)])

memory used=141.52MiB, alloc change=4.00MiB, cpu time=1.03s, real time=1.03s, gc time=125.44ms

ans1-ans2

[0, 0]

forget(evalf); ans1 := CodeTools:-Usage([Grid:-Seq(UP(s, `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`, N, M, a, b, II, JJ, Rr), s = 1 .. 2)])

memory used=116.91KiB, alloc change=4.38MiB, cpu time=42.00ms, real time=489.00ms, gc time=32.16ms

forget(evalf); ans2 := CodeTools:-Usage([seq(UP(s, `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`, N, M, a, b, II, JJ, Rr), s = 1 .. 2)])

memory used=137.51MiB, alloc change=-2.00MiB, cpu time=1.04s, real time=970.00ms, gc time=145.08ms

ans1-ans2

[0, 0]

``

Download soal_ac.mw

The problem is that you are trying to use GAMMA as if it were a previously unused name. But it is already the name of a procedure in Maple itself.

Trying to unprotect the name, so as to try and use it like a regular, unassigned name, is something you should NOT do.

The error message is telling you what to do. Replace the call to unprotect(GAMMA) with,

local GAMMA;

Or use another name. That might be advisable, if it's supposed to be passed off via Grid

Why not solve for t, symbolically, up front? You can utilize that formula directly within the plot command. (There's no need to produce discrete data, although you can if you want.)

restart;

thetavn := (1/6)*Pi:

omegac := 0.1:

s := v*cos(thetavn)*(cos(2*thetabn)*tan(thetabn)+sin(2*thetabn)*sin(omegac*t)/omegac):

form := solve(s = 0, t);

-10.*arcsin(.1000000000*cos(2.*thetabn)*tan(thetabn)/sin(2.*thetabn))

# non-parametric plotting
plot(form, thetabn=Pi/100 .. Pi);

# parametric plotting
# You don't need to call `solve` for each thetabn value.
plot([eval([thetabn, form],thetabn=Pi*k/100)[], k=1..100]);

# non-parametric form, first portion
plot(form, thetabn=Pi/100 .. Pi*43/100, tickmarks=[decimalticks, default]);

Data1:=[seq([thetabn, form], thetabn=[seq(Pi*k/100, k=1..43)])]:
Data2:=[seq([thetabn, form], thetabn=[seq(Pi*k/100, k=57..99)])]:
plots:-display(plot(Data1), plot(Data2));

 

 

Download form_plotting.mw

You can automate parallel (concurrent) computations by using either the Grid or Threads packages. That would be considerably superior to using separate worksheets to cobble together your own parallel computation environment.

As a very rough but general rule: if you can parallelize the job at a fine level (usually for something which is purely numeric and thus more readily made thread-safe) then the Threads package is more suitable, while if your overall goal is more easily parallelized into larger and more computationally expensive (usually fewer, higher level) jobs then the Grid package is more suitable.

With the Threads package the concurrent computations take place under the same kernel session, hence the need for them to not interact with each other (an aspect of the needed thread-safety). Most of the Maple Library's commands are not thread-safe, hence the common occurrence that thread-safe code is mostly numeric or mostly uses kernel builins.

With the Grid package there is greater overhead for launching the concurrent sub-computations, but that is relatively negligible if the sub-computations are more expensive and there are less of them. With this package the sub-computations run in separate kernels, and so are protected from interfering with each other, and the issue of thread-safety is mitigated.

See the Help, or search this site, for examples.

It sounds to me as if the Grid package might be more suitable for your job.

restart;

t:=0:

for i from 1 to 11 do
  j:=i+i^2;
  k:=j+t;
  t:=j/k; print('t'=t);
end do:

t = 1

t = 6/7

t = 14/15

t = 150/157

t = 157/162

t = 6804/6961

t = 13922/14165

t = 509940/516901

t = 516901/522567

t = 5225670/5272661

t = 115998542/116869487

 

Download loop_print.mw

Here it is with everything but the last plot's output:

triangle_analysis_ac1.mw

Another thing that worked for me was to File->Open the original, and then (even though it appears to have not loaded and sheet appears blank!) use the menubar's Edit->Remove Output->From Worksheet , and then save it to another filename. That produces a version with all output removed.  triangle_analysis_gone.mw

First 165 166 167 168 169 170 171 Last Page 167 of 336