nm

3646 Reputation

17 Badges

7 years, 362 days

MaplePrimes Activity


These are answers submitted by nm

sqrt(x)<=1/sqrt(2)

How is the above different from x<= 1/2 ?

Any way, may be

with(plots);
inequal({x<=1/2,y=0},x=-3..1,y=0...0.3,optionsclosed=[color="red",thickness=5]);

 



1/sqrt(2)<sqrt(x)<=1/sqrt(2)

humm.. is this different from 1/2<x<=1/2 ? You want to plot infinitly small line?

 

 

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

Frequency response from transfer function

The subject you have says one thing, and then you seem to be asking for something different.

If you want the frequency response spectrum and have the transfer function, then there is already a special function to do this. called BodePlot. 

restart:
with(DynamicSystems);
G:= 0.1*(s+0.2)*exp(-4.5*s)/(s+0.5)/(s+0.4)/(s+0.1)/(s+0.02):
sys:=TransferFunction(G);
BodePlot(sys,output=phaseplot,linearfreq =false,range=0.1..100);

there are many options that you can modify, see help.

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)."

I created a 3 by 3 fibonacci matrix A:=<21,5,1|13,3,1|6,2,0>

I am trying to change the 1s to 0s without specific index reference.

A:=Matrix([[21,13,6],[5,3,2],[1,1,0]]);

r:=[seq([seq( `if`(A(i,j)=1,0,A(i,j)), j= 1..3)], i= 1..3)];
A:=Matrix(r);

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

 

This depends on your application. You can always use =

http://www.maplesoft.com/support/help/maple/view.aspx?path=Student%2FLinearAlgebra%2FEqual

or you can take the matrix norm of each and check of they are within some tolerance.

 

------------------------------------
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.

 

it seems to work if you do the integration over phi first, then do it over r next:

restart;
integrand:=(2*gamma*cos(psi)/(D-r*sin(theta)*sin(phi))-2*gamma*cos(psi)/(D+r*sin(theta)*sin(phi)))*r^2*cos(theta)*sin(phi);

int(integrand,phi=0..Pi):
int(%,r=0..L);

Do you know what is the correct answer supposed to be?

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

5 6 7 8 9 Page 7 of 9