nm

12338 Reputation

20 Badges

14 years, 40 days

MaplePrimes Activity


These are answers submitted by nm

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);

This book has number of problem solving and code

Applied Engineering Mathematics with Maple by Gilberto E. Urroz

another set of books with such problems that I like are Computer Algebra Recipes for Classical Mechanics by Richard H. Enns / George McGuire and Computer Algebra Recipes for Mathematical Physics by Richard H. Enns and Computer Algebra Recipes: An Introductory Guide to the Mathematical Models of Science.

Also Differential Equations and Boundary Value Problems by C. H. Edwards / David E. Penney, uses Maple. SPecific one.

I also have Maple Computer Guide for Advanced Engineering Mathematics by Erwin Kreyszig / E. J. Norminton which has Maple code many advanced equations solved using Maple.

A good one for PDE with Maple is Partial Differential Equations for Computational Science: With Maple and Vector Analysis by David Betounes. Also Physics with MAPLE by Frank Y. Wang would be good to look at.

 

This is what Maple 17.02 gives (hard to read what you have, why not show the Maple code as plain text so one can copy it??)

restart;
eq:=Pi=sum((120*n^2+A*n+B)/(16^n*(512*n^4 + 1024*n^3 + 712*n^2 + 194^n + 15)),n=0..infinity);

solve(eq,{A,B}):
evalf(%);


 

 

 

First 17 18 19 20 Page 19 of 20