Mac Dude

1566 Reputation

17 Badges

12 years, 355 days

MaplePrimes Activity


These are questions asked by Mac Dude

This is a specific Maple 2016 question: I find that plots no longer remember their attributes (like size on the screen) upon re-execution of a worksheet, even though I have set the appropriate flag in the Interface pane of the preferences.

Can someone confirm this; or am I just being dense? Is this an OS X issue? An El Capitan issue?? Maple 2015 on Yosemite behaves as expected.

Maple 2016.1 on Mac OS X 10.11.5.

Thanks,

M.D.

I have the following expression (generated by some other procedure):

This does not have a taylor expansion in pV[6] in the general case because the square roots can become negative:

taylor(xpr,pV[6]);
Error, does not have a taylor expansion, try series()

But I can get an expansion by restrictig the range of pV[6]:

taylor(xpr,pV[6]) assuming -0.01<pV[6],pV[6]<0.01;

So far things are perfectly fine. But when I try mtaylor:

mtaylor(xpr,pV[6]) assuming -0.01<pV[6],pV[6]<0.01;
Error, (in assuming) when calling 'mtaylor'. Received: 'does not have a taylor expansion, try series()'

So the assumption seems to be ignored. I can work around this by expanding in pV[6] first, using taylor, and then expanding the result from that using mtaylor (I really also want the expansions in the other pV components; 6 in total although in this example some do not show up). I'll have to convince myself that this work-around gives the correct result but I think it does. However, I don't particularly like it.

I consider this a bug and am tempted to submit an SCR. But before I do that; is there anything obvious I am missing here?

Thanks,

M.D.

PS: This was done using Maple 15. I'll check newer versions later.

mtaylor_assuming.mw

I am (again) trying to get Maple to do some parallel work; using the Threads package.

My actual problem involves a vector function with 6 elements, acting on 6-vectors. Each element of the output vector is calculated as a high-order polynomial of all 6 input elements. The whole thing is a map that I want to iterate. I plan to evaluate each of the 6 functions in a separate thread (the input vector of course is the same for all six) and then put the results together in a Vector, to be used as input for the next iteration.

Facing difficulty I finally wrote myself a little toy program to check out the basic mechanism. Here it is:

restart;
                "Maple Initialization loaded..."
with(Threads):
f:=x -> 1+x^2;
                                       2
                        f := x -> 1 + x
x:=0:
tt:=time[real]():

for i from 1 to 10 do
  id:=Create(f(x),y):
  Wait(id):
  x:=y:
  y:='y':
end do:

time[real]()-tt;
                             0.018
i;
                               11
So far so good; even the output (not shown) makes sense. BUT: as I increase the number of iterations in the for...do loop, the memory allocation goes up fast, and I hit a point at about 40 iterations where the whole process locks up and the program never ends, cannot even be stopped (at least for 100 iterations), forcing me to abort the whole thing. I have evidence that Maple allocates vast amounts of memory which finally chokes the whole thing (on a 16 GB-RAM machine).

Anyone have any idea what I am doing wrong? I realize the above example does not provide benefits; in the real example there will be 6 Creates and the loop will Wait for all of these to finish.

I'd really like to get this to work as each function can take quite some time and I do expect at least some speed-up from parallelizing this (even after overhead).

This is on Maple 2015 on Mac OS X 10.10.5 with 16 GB of RAM. I should mention that I set UseHardwareFlots:=true in my .mapleinit file.

Thanks,

M.D.

I am trying to use Compiler:-Compile with a generated function having a Vector as an argument. My function is (in a simplified form)

Mapt:=proc (pv) options operator, arrow; rtable(1 .. 6, {1 = .998026692438229*pv[1]-.605526643146912*pv[2]+0.154549004943741e-1*pv[6]+0.140818440886566e-5*pv[5], 2 = 0.651134546344795e-2*pv[1]+.998026692438228*pv[2]-0.510903331894809e-1*pv[6]+0.229399145141077e-8*pv[5], 3 = -.500000000000002*pv[3]-5.95856898901206*pv[4], 4 = .125869147673385*pv[3]-.499999999999996*pv[4], 5 = 0.510903331894806e-1*pv[1]-0.154549004943901e-1*pv[2]-40.6778361021594*pv[6]+.999998210424947*pv[5], 6 = .999998210424947*pv[6]-0.229399145141220e-8*pv[1]-0.140818440886565e-5*pv[2]+0.897571581395136e-7*pv[5]}, datatype = anything, subtype = Vector[column], storage = rectangular, order = Fortran_order) end proc;

Since this returns a Vector it cannot be compiled as is. So I split off the first output element (with the idea to later on do this with the others as well):

xpr:=eval(Mapt(<pv[1],pv[2],pv[3],pv[4],pv[5],pv[6]>))[1];
f1:=unapply(xpr,pv);
f1(<0.001,0.001,0,0,0,0>); # test f1: works
          0.000392500049291317

sf1:=Compiler:-Compile(f1); # this works, too

sf1(<0.001,0.001,0,0,0,0>); # but this fails
Error, (in sf1) invalid input: expecting a hardware float[8] rtable, but received 1


The examples in the Helpfile run so I think my installation is ok (my old Maple 15 won't even run the examples, but that is a different story). I have been banging my head against the wall here, trying many different ways, but none of them successfull. Worse, I do not understand the error message at all. Test program attached.

Mac OS X 10.10.5

Thanks for any hint,

M.D.

Compiler.mw

I want to solve the following equation for E[k]:

fr = 1.64*10^6*E[k]^2*exp(-8.5/E[k]);

Maple 17 gives

solve(fr = 1640000.00*E[k]^2*exp(-8.5/E[k]), E[k]);


          4.25000000000000             4.25000000000000     
    ----------------------------, --------------------------
            /  5442.65560181792\          /5442.65560181792\
    LambertW|- ----------------|  LambertW|----------------|
            |        (1/2)     |          |      (1/2)     |
            \      fr          /          \    fr          /

Maple 2015 gives:

solve(fr = 1.64*10^6*E[k]^2*exp(-8.5/E[k]),E[k]);
Error, (in solve) invalid input: `evalf/LambertW` uses a 2nd argument, zz, which is missing

This is Maple 2015.2 on OS X 10.10 Yosemite.

I can copy-paste Maple 17's solution into Maple2015 and it evaluates correctly (for a given value of fr).

Is this a bug or am I missing something? Help on LambertW looks identical for both versions of Maple.

M.D.

5 6 7 8 9 10 11 Last Page 7 of 23