Robert Israel

6522 Reputation

21 Badges

18 years, 179 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are answers submitted by Robert Israel

1)

> f:= x -> x^2 - 8*x + 20;
   plot(f(x), x=-3..3);

2)

> solve(f(x)=0);

Something like this?

> with(plots): with(plottools): 
dtheta:= evalf((Pi - arccos(2/3))/100):
YY1:= [seq([-0.6+0.4*cos(Pi+dtheta*j),0.4*sin(Pi+dtheta*j)],j=0..100)]:
YY2:= map(`*`,ListTools[Reverse](YY1),-1):
YY3:= [seq([cos(Pi*j/200),sin(Pi*j/200)],j=0..200)]:
Yin:= [op(YY1),op(YY2),op(YY3)]:
Yang:= map(`*`,Yin,-1):
PL:= display(disk([-.6,0],.2,colour=blue),disk([.6,0],.2,colour=red),
polygonplot(Yin,filled=true,colour=red),
polygonplot(Yang,filled=true,colour=blue)):
animate(rotate,[PL,theta],theta=0..2*Pi,axes=none,title="");


Your answer1 consists of rational functions of s whose denominators are a cubic polynomial in s.  The inverse Laplace transform is expressed in terms of the roots of that cubic.  As you see using RootOf, the "closed-form" solution of the cubic in terms of radicals is a very unpleasant expression.  It is much better to use the answer in terms of RootOf.  I suspect that is the simplest expression you're going to get.

It's a bug in the 2-D Math parser in Maple 14.  This definition works fine in 1-D Maple input, but not in 2-D Math.  Strangely enough, it would work in 2-D Math if you omitted the semicolon at the end of the first line (which should be an error).

My recommendation is to avoid 2-D Math input whenever possible.

1)  The main solver for linear difference equations is rsolve, but it does not work for most nonlinear difference equations.  However, you can transform a first-order rational difference equation into a linear equation.  For example, see http://en.wikipedia.org/wiki/Rational_difference_equation

Do you mean something like this?

> with(Statistics):
   Xn:= RandomVariable(Binomial(300, 0.6));
   Yn:= (Xn - Mean(Xn))/StandardDeviation(Xn);
   F:= y -> CDF(Yn, y);
   F(6/7) - F(-6/7);

.6232180159

Unevaluation quotes are tricky: it's not clear how many times the expression will be evaluated in something like your evalf(Int(Int(...))).  However, you can numerically integrate a procedure rather than an expression.

> evalf(Int((x,y) -> dfdphi(x,y,10,5,1/10), [0..1, 0..1]));

> uppertri:= {seq(seq([i,j],i=1..j),j=1..5)};
   select(LinearAlgebra:-IsDefinite,
     map(s -> Matrix(5,5, map(t -> (op(t)=1),s),        
         shape=symmetric), combinat[powerset](uppertri)),
     query=positive_definite);



Maybe more interesting is the fact that there are 203 positive semidefinite matrices of this type (change positive_definite to positive_semidefinite).  Hmm... how many would there be for n x n matrices?

.

p is an expression, not a function, so you should use p rather than p(x).  Also you're missing multiplication signs in p and I4, and you have ":" rather than ":=".  After correcting those, you can try solving a set of four equations using solve.

There may a better way, but you can recursively generate all "words" in your generators.  Something like this.

L:= {a, b, c}: 
Id:= LinearAlgebra:-IdentityMatrix(3):
T:= 'T': T[convert(Id,listlist)]:= 1:
Extend:= proc(start)
   local x, r, rl;
   global T;
   for x in L do
      r:= start . x;
      rl:= convert(r,listlist);
      if not assigned(T[rl]) then
         T[rl]:= 1;
         Extend(r)
      end if
    end do
  end proc;
  Extend(Id);
  G:= map(t -> Matrix(op(t)),{indices(T)});

This method will generate any finite semigroup of matrices over the rational numbers,
given a set of generators. Caution: if the semigroup generated by the matrices is infinite,
the procedure will not terminate. For matrices with irrational entries, you would have
to worry about simplification to make sure that equivalent values are recognized as
equivalent. Similarly, for matrices with floating-point entries, roundoff error could be
a problem.

The problem is premature evaluation. 

sum, like most Maple procedures, starts by evaluating its inputs, in this case
cos((n mod 3)*Pi) and n=2..13.  With n as a symbolic variable, n mod 3 returns n.
So Maple ends up computing the sum of cos(n*Pi) for n = 2 .. 13.

The cure is to use add instead of sumadd has special evaluation rules so its first input is not evaluated until values are substituted for the index variable n.

Of course that won't help for the sum from 2 to N where N is a symbolic variable.

Whether or not outputs from statements in a loop are printed depends on whether there is a semicolon or colon after the final od, not on whether the statements themselves have a semicolon or colon.   So to suppress the printing of P1 and P2 you need to put a colon after the od.  Now you do want the output of display to be shown, so use print to do that:

> do
      P1 := ...:
      P2 := ...:
      print(display(...))
   od:

 

If you use a Plot component you can specify the delay between frames in milliseconds (in the case of an animation) and the height and width (in pixels).  See the help page ?PlotComponent.

You might also look at Summand in the Student[Calculus1] package.

Maple's integral g2 = F(1) - F(0) where F(x) = int(g, x) is an antiderivative of g.  When y > 0, this antiderivative can have a discontinuity (actually a branch cut) at x=0.  But if y is unspecified, the branch cut might not be anywhere near the interval.  So Maple's answer g2 is sometimes right, but not always.

First 13 14 15 16 17 18 19 Last Page 15 of 138