nm

11558 Reputation

20 Badges

13 years, 135 days

MaplePrimes Activity


These are answers submitted by nm

fff:=z->z^k;
int(fff(z),z=0..x[2],continuous);

Try help kernelopts and look for printbytes:

--------------------------
printbytes
true/
Print the "bytes used.." message after

false
every garbage collection (tty version).


Default value is true.
-------------------------------

so try kernelopts(printbytes=false)

for interface/notebook version, try

interface(printbytes=false)

and if this does not work, try

interface(quiet=true)

"An interface constant that will suppress all auxiliary printing (logo, garbage collection messages, bytes used messages, and prompt)."

eq:=(a*b+a)^n*a^(-n);
simplify(eq) assuming positive;

 

I've had many hangs in the update to 18.02, where at the end, where the progress bar reaches the end, it stops and the update never finishes.

I tried few times, then on the 4th or 5th time, it actually completed. You might thought the download was completed.

I suggest you try again, and make sure the update actually finishes ok.

(ps. this the first time this happned updating Maple) I am on windows and was updating from 18.01 to 18.02

 

------------------------------------
restart;
  f:=x->piecewise(-Pi<x and x<Pi/2,-1,
                  Pi/2<x and x<1,0,1): #square wave to approximate using fourier
    
  nmaFourier2:=proc(f,freq,from_,to_,maxN)
         local n::integer,denomC,denomS,a,b;
         denomC:=( to_ - from_ ) / 2;
         denomS:=( to_ - from_ ) / 2;
 
         a:=proc(n)
           int(f(x)*cos(n*freq*x),x=from_..to_) /denomC;
         end proc;
 
         b:=proc(n)
           int(f(x)*sin(n*freq*x),x=from_..to_) / denomS;
         end proc;
 
         evalf(denomC);
 
         1/2*a(0) + sum( a(n) * cos(n*freq*x) ,n=1..maxN)
                  + sum( b(n) * sin(n*freq*x) ,n=1..maxN)
  end proc:
----------------------------------

To plot all do

r:=[seq(nmaFourier2(f,1,-Pi,Pi,n),n=1..5)]:
plot(r,x=-Pi..Pi);

To animate do

----------------------------------------
g:=n->plot(nmaFourier2(f,1,-Pi,Pi,n),x=-2*Pi..2*Pi);
plots:-animate(g,[n],n=1..40);
-----------------------------------------

and click on the plot and open the animate->play

 

I am sure there is a better way, how about:

M:=Matrix(3,[[1,1,1],[2,2,2],[3,3,3]]);
StringTools:-Join(map(x->convert(x,string),convert(M^%T,list)),"");
sscanf(%,"%d");


 

restart;
ode:= 5*(diff(theta1(t), t))+diff(theta2(t), t);
Physics:-diff(ode, diff(theta1(t),t));

            5

one option is to call gc() in the loop.

http://www.maplesoft.com/support/help/Maple/view.aspx?path=gc

"Invocation of this function causes a garbage collection to occur. Garbage collection has the effect of deleting all data to which no references are made. It also cleans the remember tables of procedures with an option system or option builtin by removing entries that have no other references to them. "

But they say "Note, as of Maple 16 the use of gc is discouraged." with no reason why.

I am using now in a loop myself, and it seems to have helped in having Maple not use too much memory.

 

restart;
p:=x^5-8*x^3+2:
n:=degree(p,x):
map(i->coeff(p,x,i),[seq(i,i=0..n)]);

To get them in the reverse order you wanted, use:

map(i->coeff(p,x,i),[seq(i,i=n..0,-1)]);

Using 1/t^2-1/s^2 = 1, a hyperbolic trig identity, where "t" is the tanh and "s" is the sinh. Replace the "s" in the expression, leaving just the "t" in there, Solution follows

restart;
e := (3+2*sinh(x)^2)/(sinh(x)^2*tanh(x));
expand(student[changevar](sinh(x)^2=tanh(x)^2/(1-tanh(x)^2),e));

 

I am not sure without giving specific value for n what is it you are looking for. But how about:

s:=convert( (a+b)^n,Sum,include = powers, dummy = x);

Other than this, I would not know. May be if you can show what result you expect to see for (a+b)^n it will help.

I am also at a loss as to what your function is meant to be. But assuming the data is meant to be <x,y,z> then you can try lisplot3d

xyz:=[[1,3,4],[2,11,12],[3,41,1]];
plots[listplot3d](xyz);

 

or
plots[spacecurve](xyz);

I would use standard formating, like we do in c

x:=10:
printf("The Synchronising vector is %d\n",x);

           The Synchronising vector is 10

x:=evalf(Pi):
printf("The Synchronising vector is %3.4f\n",x);


            The Synchronising vector is 3.1416

x:="micky mouse":
printf("The Synchronising vector is %s\n",x);

         The Synchronising vector is micky mouse

change the formating specs according to your data format  your are printing

eq1:=(x+y)*(x^2+y^2) = 5500;
eq2:=(x-y)*(x^2-y^2) = 352;
evalf(solve({eq1,eq2},{x,y}));

a:=<<1|0|0>,<1|0|0>,<0|0|0>>;

with(ArrayTools):

a:=CircularShift(a,1,2);

First 16 17 18 19 Page 18 of 19