Robert Israel

6522 Reputation

21 Badges

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

MaplePrimes Activity


These are replies submitted by Robert Israel

Try it like this:

> with(plots); 
  m1 := implicitplot3d(9*x^2+4*y^2-36*z^2, x = -2 .. 2, 
     y = -3 .. 3, z = -1 .. 1, grid = [20, 20, 20]):
  n := animate(plot3d, [t, x = -2 .. 2, y = -3 .. 3], 
      t = -1 .. 1, background=m1):
  n;

Just for the record, the Global Optimization Toolbox also needs some help (e.g. in the form of setting evaluationlimit) to get correct results on these problems.

> with(GlobalOptimization):
  GlobalSolve(x^2/10 + sin(1000*x), x= -5 ..5, maximize);

          [3.48796643876691714, [x = -4.99999999999999912]]

> GlobalSolve(x^2/10 + sin(1000*x), x= -5 ..5, maximize,
     evaluationlimit=2000); # 1000 is not enough!

          [3.49356616699301314, [x = -4.99356252159386394]]

> GlobalSolve(x^2 +1- exp(-1/(110*(x-1))^2), x= -1.4 .. 1.4,
     maximize);

           [1.96051639554751978, [x = 1.39999999999999990]]

> GlobalSolve(x^2 +1- exp(-1/(110*(x-1))^2), x= -1.4 .. 1.4,
     maximize, evaluationlimit=2000);

           [2.00611111109563600, [x = 1.00325955086284591]]

> 

Just for the record, the Global Optimization Toolbox also needs some help (e.g. in the form of setting evaluationlimit) to get correct results on these problems.

> with(GlobalOptimization):
  GlobalSolve(x^2/10 + sin(1000*x), x= -5 ..5, maximize);

          [3.48796643876691714, [x = -4.99999999999999912]]

> GlobalSolve(x^2/10 + sin(1000*x), x= -5 ..5, maximize,
     evaluationlimit=2000); # 1000 is not enough!

          [3.49356616699301314, [x = -4.99356252159386394]]

> GlobalSolve(x^2 +1- exp(-1/(110*(x-1))^2), x= -1.4 .. 1.4,
     maximize);

           [1.96051639554751978, [x = 1.39999999999999990]]

> GlobalSolve(x^2 +1- exp(-1/(110*(x-1))^2), x= -1.4 .. 1.4,
     maximize, evaluationlimit=2000);

           [2.00611111109563600, [x = 1.00325955086284591]]

> 

Yes, the correct answer in this case would be approximately

[3.49984521056784192, [x = -4.99984570953766028]]

which would be produced e.g. by

> Optimization[NLPSolve](x^2/10 + sin(1000*x), x= -5 .. -4.995, 
    method=branchandbound,evaluationlimit=100,maximize);

As I said, "almost any numerical method can be fooled by a bad enough function", and x^2/10 + sin(1000*x) is pretty bad...

 

Yes, the correct answer in this case would be approximately

[3.49984521056784192, [x = -4.99984570953766028]]

which would be produced e.g. by

> Optimization[NLPSolve](x^2/10 + sin(1000*x), x= -5 .. -4.995, 
    method=branchandbound,evaluationlimit=100,maximize);

As I said, "almost any numerical method can be fooled by a bad enough function", and x^2/10 + sin(1000*x) is pretty bad...

 

Seems to be a bug.  Well, almost any numerical method can be fooled by a bad enough function, but this is pretty poor performance.  On the other hand, try:

Optimization[NLPSolve](x^2/10 + sin(10*x), x= -5 .. 5, 
   method=branchandbound, maximize, evaluationlimit=100);

[3.37592809528124248, [x = -4.87924265314903582]]

Seems to be a bug.  Well, almost any numerical method can be fooled by a bad enough function, but this is pretty poor performance.  On the other hand, try:

Optimization[NLPSolve](x^2/10 + sin(10*x), x= -5 .. 5, 
   method=branchandbound, maximize, evaluationlimit=100);

[3.37592809528124248, [x = -4.87924265314903582]]

I've had similar problems in the past.  What didn't seem to work for me was uploading a new file with the same name as an old one.  But part of the problem may be in the editor rather than the file manager.  Your post above had one reference to 178_DEplot1.jpg:

and two to 178_DEplot2.jpg:

 but here for example is 178_DEplot1.gif

  and here is 178_DEplot2.gif

 

I constructed the html tags for these myself (just changing the file names from the ones you had in your posting).  I hope these problems will be corrected in the new version of MaplePrimes.

Or in any version:

>  iota, omicron, upsilon, Iota, Omicron, Upsilon, CHI;

Note:

 You can use PI, ZETA and CHI to obtain these three uppercase Greek letters.  This is because Pi, Zeta and Chi have special meanings in Maple.  Also Iota is a command in the StringTools package, so if StringTools has been loaded you'll want to use :-Iota. 

 

Or in any version:

>  iota, omicron, upsilon, Iota, Omicron, Upsilon, CHI;

Note:

 You can use PI, ZETA and CHI to obtain these three uppercase Greek letters.  This is because Pi, Zeta and Chi have special meanings in Maple.  Also Iota is a command in the StringTools package, so if StringTools has been loaded you'll want to use :-Iota. 

 

Your code produced an integer.  The quotes around % don't do anything (which is interesting in itself: it shows a difference between ordinary variables and %).  If you want a string, you could use convert(..., string).  Thus:

> s:=convert(trunc(evalf(Pi*10^10000,10003)), string):
  with(StringTools):
  R:= SearchAll([seq(cat(i,i,i),i="0".."9")],s);
  for q in R do printf("%d%d%d starting at position %d\n",(q[2]-1)$3,q[1]) 
    end do:

 

Your code produced an integer.  The quotes around % don't do anything (which is interesting in itself: it shows a difference between ordinary variables and %).  If you want a string, you could use convert(..., string).  Thus:

> s:=convert(trunc(evalf(Pi*10^10000,10003)), string):
  with(StringTools):
  R:= SearchAll([seq(cat(i,i,i),i="0".."9")],s);
  for q in R do printf("%d%d%d starting at position %d\n",(q[2]-1)$3,q[1]) 
    end do:

 

You didn't say the value of k, so I took k=1.  Then (in Maple 13) I get the result I quoted, although it does take some time.  There may be numerical difficulties, which might be more severe for other values of k.  You could also try something like
 

> Student[Calculus1][ApproximateInt](ut(x,2),x=0..5, 
      partition=100, method=simpson);

                         -.2599816920

which probably gives a pretty good result, although without sophisticated error control.

You didn't say the value of k, so I took k=1.  Then (in Maple 13) I get the result I quoted, although it does take some time.  There may be numerical difficulties, which might be more severe for other values of k.  You could also try something like
 

> Student[Calculus1][ApproximateInt](ut(x,2),x=0..5, 
      partition=100, method=simpson);

                         -.2599816920

which probably gives a pretty good result, although without sophisticated error control.

OK, that's a different question entirely.  If alpha is a root of a polynomial p(z) of degree d over a field F, the sequence alpha^n satisfies a linear recurrence of order d corresponding to the polynomial.
If X(k) is the vector with entries alpha^(j+k), j = 0 to d-1, we have X(k) = M^k . X(0) where M is a certain matrix.   In this case you want to look at the first row of M^k mod 2 (mod 2 because the field has characteristic 2) where k = 12345678987654321.
You can get that using LinearAlgebra[Modular][MatrixPower].  Thus:

> p:= x^32+x^26+x^19+x^15+x^13+x^11+x^9+x^8+x^4+x+1;
  M:=LinearAlgebra[CompanionMatrix](p,x)^%T;
  Mp:= LinearAlgebra[Modular][MatrixPower](2, M, 12345678987654321);
  add(Mp[1,i]*alpha^(i-1),i=1..32);

1+alpha^2+alpha^3+alpha^9+alpha^13+alpha^14+alpha^15+alpha^16+alpha^17+alpha^18+alpha^19+alpha^20+alpha^24+alpha^25+alpha^28+alpha^30+alpha^31

 

First 36 37 38 39 40 41 42 Last Page 38 of 187