## 312 Reputation

19 years, 31 days

## Plot Setup Linux X11...

Maple

I am having problems setting up plots on a new computer.

plotsetup(x11);
interface(plotdevice);
x11
plot(sin(x));
plotsetup()
preplot = [], postplot = [], plotdevice = x11, plotoutput = terminal, plotoptions = ``

## How do I do indexed addition...

Maple

I am attempting to add the contents of a variable based on the contents of another. There should be some way to do this without looping. I get errors when trying to do this with seq. I seem to not understand evaluation...

How do I do this?

restart;
## generate some values like in the real app
roll:=rand(1..9):
N := sort([seq(seq(10*(2+jdx)+roll(),jdx=1..5),idx=1..10)]):
V := 10*seq(roll()+10*trunc(N[idx]/10),idx=1..nops(N)):

## generate index for sum. This groups the values for sum
sumidx := [seq(floor(N[idx]/10)-2,idx=1..nops(N))];

## create and zero sum variable
S := 0 *~convert(convert(trunc~(N/10),set),list);

## calc sum and display it - This works
for idx to nops(sumidx) do
S[ sumidx[idx] ] += V[idx]:
end do:
S;

## error because sumidx[idx] is not evaluated ?????
S := 0 *~convert(convert(trunc~(N/10),set),list):
seq('S'[ sumidx[idx] ] += V[idx], idx=1..nops(N));
S;

## This works 'S' delays evaluation and sumidx[idx] is evaluated in
## the function call
f := proc( A, B )
A += B:
end proc:
## zero sum variable
S := 0 *~convert(convert(trunc~(N/10),set),list):
seq(f('S'[ sumidx[idx] ], V[idx]),idx=1..nops(N)):
S;

## Is this O(N^8)?...

Maple 2020

I am trying to decide O of times fo a computer process. I thought it was n^2*log(N) or something like that.

With 12  points, it may be hard to determine if O(N^4), etc.

See big-o.mw

## What are maple initialization files...

Maple 2021

What/Whare are the maple initialization files.

I have a problem with libname.

According to maple help, I should create/modify ~/.mapleinit.

> cat ~/.mapleinit

libname := "/usr/local/Maple2021/lib","/home/tomdean/maple/toolbox/maplev/lib","/home/tomdean/maple/toolbox/Syrup/lib";

But, when I start maple (in emacs), libname is only the first part, "/usr/local/Maple2021/lib",

## Cloud Verson of Syrup not loaded in Emac...

Maple 2021

I installed the cloud version of Syrup with xmaple, by clicking the cloud icon, etc. It is loaded with xmaple and cmaple. But, not in maple running in emacs.

with(Syrup);
(**) Error, invalid input: with expects its 1st argument, pname, to be of type