Thomas Dean

277 Reputation

10 Badges

17 years, 55 days

MaplePrimes Activity


These are questions asked by Thomas Dean

Irrespective of what help says, both series and taylor return series(...) rather that big-O expression

From help:

> series(x/(1-x-x^2), x=0);
series(1*x+1*x^2+2*x^3+3*x^4+5*x^5+O(x^6),x,6)
> taylor(sin(x),x=Pi);
series(-1*(x-Pi)+1/6*(x-Pi)^3-1/120*(x-Pi)^5+O((x-Pi)^7),x=-(-Pi),7)
 

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

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

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;
 

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/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",

1 2 3 4 5 6 7 Last Page 1 of 12