Robert Israel

6577 Reputation

21 Badges

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

MaplePrimes Activity


These are replies submitted by Robert Israel

Do you mean like this?
> with(plots):
  inequal(x+y < 1,x=-3..3,y=-3..3);
Do you mean like this?
> with(plots):
  inequal(x+y < 1,x=-3..3,y=-3..3);
The Maple 9 behaviour is not an issue, as far as the Maple developers are concerned. They are not likely to make a change in Maple 9; any changes they make would appear in Maple 11.x or Maple 12. But I just tried
> int((r^2*sin(w*t)^2*w^2+r^2*cos(w*t)^2*w^2)^(1/2),
      t = 0 .. 2*Pi/w) assuming w > 0;
in Maple 11 and got 0. So it seems that this bug is still with us (at least some of the time). The "continuous" option, by the way, would be exactly the wrong thing to do, since the trouble comes from an antiderivative that is not continuous: "continuous" would tell Maple not to bother looking for discontinuities of the antiderivative, and then the result would certainly be 0.
A closer look at that animation should reveal that the solution in this case is not c=0 but c=(b^2+a^2)/(a^2+1) when -1 <= a <= 1. Perhaps better:
> with(plots):
  animate(implicitplot,[eqn,b=-2..2,c=-2..2,
   grid=[100,100]],a=-1..1,frames=30,axes=box);
The gaps in some of the curves are due to the fact that the curve comes very close to the region where the quantity inside the square root is negative.
There's a problem with your step
sol := subs(_z1 = (b^4+2*b^2*a^2+a^4-4*a^2*c^2)^(1/2), sol);
because it re-introduces a,b,c on the right side of the equations that are supposed to be solved for a,b,c. Anyway, you still end up with the same algebraic solutions, not addressing the challenge of determining which solutions work when using the principal branch of the square root.
> int(sqrt(multiply(v(r,t),v(r,t))),t=0..2*Pi/w); 0
Yes, this is a bug. Maple 10 and 11 return the integral unevaluated after
Warning, unable to determine if 1/2*Pi*(1+2*_Z5)/w is between 0 and 2*Pi/w; try to use assumptions or set _EnvAllSolutions to true
which is still not good, but at least not an incorrect result. The main problem is that, without seeing the simplification sin(w*t)^2 + cos(w*t)^2 = 1, Maple gets the antiderivative as (-r^2*w^2*(-1+sin(w*t)^2))^(1/2)*arctan((r^2*w^2)^(1/2)*sin(w*t)/(-r^2*w^2*(-1+sin(w*t)^2))^(1/2))/cos(w*t)/w which has discontinuities at odd multiples of Pi/(2*w). If you assume w > 0, you do get 2*Pi*r*csgn(r), which is correct.
Plugging in c = 0 gives 1/2*b^2+1/2*a^2+1/2*(b^4+2*b^2*a^2+a^4)^(1/2) Note that you're taking the square root of (a^2+b^2)^2, and that could be either a^2+b^2 or -(a^2+b^2). If it's the latter, you have a solution. Maple uses the principal branch of sqrt, so that will be true if Re(a^2 + b^2) < 0. Similarly, c = (a^2+b^2)/(a^2+1) gives an expression involving the square root of ((a^2-1)*(a^2+b^2)/(a^2+1))^2. For the expression to be 0, you need this to be -(a^2-1)*(a^2+b^2)/(a^2+1), and that will be true (for the principal branch of sqrt) if the real part of (a^2-1)*(a^2+b^2)/(a^2+1) is negative.
Actually the first solution c = 0 satisfies the equation if a^2 + b^2 <= 0 (e.g. if a and b are imaginary); the second solution c = (b^2+a^2)/(1+a^2) satisfies the equation if -1 <= a <= 1 and b is real. Since you didn't tell Maple to assume anything about a and b, I don't think it's fair to call Maple's result a bug. You try it with some assumptions, e.g.
> solve(eqn, c) assuming a >= -1, a <= 1, b::real;
(b^2+a^2)/(1+a^2)
This confused me, because I thought the problem in the "invalid object in MESH" thread was that evalhf can't handle RealDomain:-sin, and here evalhf treats p:-sin the same as sin. The distinction, I think, is that in the plot3d example the sin function gets called inside a "wrapper" function that is sent to evalhf. Thus:
> p := module() option package; export sin;
  sin:=proc(x) x; end proc;
  end module:
with(p): 
q:= proc(x) sin(x) end proc;
sin(1);
1
> evalhf(sin(1));
.841470984807896505
> evalhf(q(1));
Error, unable to evaluate function `p:-sin` in evalhf
It seems that value knows about names starting with % (see the first line of `value/define`). Try this:
> f:= x -> x + 1:
  expr:= %f(t):
  expr = value(expr);
%f(t) = t+1
It seems that value knows about names starting with % (see the first line of `value/define`). Try this:
> f:= x -> x + 1:
  expr:= %f(t):
  expr = value(expr);
%f(t) = t+1
What it is doing is computing the values of f(x,y,z) on a grid of points. The region of 3d space it's looking at is divided into cells (tetrahedral, I think) with vertices on the grid. In any cell where the computed values of f change sign, linear interpolation is used to plot a polygonal patch of surface.
display([animate(tubeplot,[[20*t*cos(t+s)+200*s,20*t*sin(t+s),
     30*t], t=0..20*Pi, radius=-100*exp(.00001*t), tubepoints=20,
     numpoints=100, color=grey, style=patchnogrid], 
     s = 0 .. 2*Pi,title=""),
  spacecurve([[0,0,-50],[400*Pi,0,-50]],colour=blue)],
  scaling=constrained,orientation=[90,80],lightmodel=light4);
display([animate(tubeplot,[[20*t*cos(t+s)+200*s,20*t*sin(t+s),
     30*t], t=0..20*Pi, radius=-100*exp(.00001*t), tubepoints=20,
     numpoints=100, color=grey, style=patchnogrid], 
     s = 0 .. 2*Pi,title=""),
  spacecurve([[0,0,-50],[400*Pi,0,-50]],colour=blue)],
  scaling=constrained,orientation=[90,80],lightmodel=light4);
prep2trans will make a sum into a loop, but it doesn't do anything with a product. It also seems unable to handle anything containing I.
> with(codegen):
  prep2trans(proc(a,b) Re(a+I*b) end proc);
Error, (in intrep/statement) unable to translate I
> prep2trans(proc(a,n) local i; product(a,i=1..n) end proc);
proc (a, n) local i; product(a,i = 1 .. n) end proc
First 178 179 180 181 182 183 184 Page 180 of 187