Robert Israel

6577 Reputation

21 Badges

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

MaplePrimes Activity


These are replies submitted by Robert Israel

Maple 6 produces the following in your first example:

> S1,S2:=solve(S_Zmid1 = S_Zmid2,midZ);

S1, S2 := 3/4*H+1/8*sqrt(116*H^2-40*H*sqrt(4*H^2+1)+25)-1/4*sqrt(4*H^2+1), 3/4*H-1/8*sqrt(116*H^2-40*H*sqrt(4*H^2+1)+25)-1/4*sqrt(4*H^2+1)

whereas Maple 12 has:

> solve(S_Zmid1 = S_Zmid2,midZ);

-1/8*(8*H^2+3-4*(4*H^2+1)^(1/2)*H)/(2*H-(4*H^2+1)^(1/2))

> S12:= expand(rationalize(%));

S12 := 1/4*H+3/8*(4*H^2+1)^(1/2)

Now it looks to me like S12 = S1 for all real H, but it's not true for imaginary H (e.g. try H = i/2).  It's rather tricky to deal with the branches of the square root function here.

> simplify(eval([S12, S1], H = I/2));

[1/8*I, 5/8*I]

(the Maple tag is acting up: that should be [1/8*I,5/8*I]).

 

For real H, S12 and S1 appear to be solutions of your equation, while S2 is not.  But for e.g. H = -i/2,
none of S12, S1 and S2 are correct (in fact there are no solutions for H = -i/2).

 

Maple 6 produces the following in your first example:

> S1,S2:=solve(S_Zmid1 = S_Zmid2,midZ);

S1, S2 := 3/4*H+1/8*sqrt(116*H^2-40*H*sqrt(4*H^2+1)+25)-1/4*sqrt(4*H^2+1), 3/4*H-1/8*sqrt(116*H^2-40*H*sqrt(4*H^2+1)+25)-1/4*sqrt(4*H^2+1)

whereas Maple 12 has:

> solve(S_Zmid1 = S_Zmid2,midZ);

-1/8*(8*H^2+3-4*(4*H^2+1)^(1/2)*H)/(2*H-(4*H^2+1)^(1/2))

> S12:= expand(rationalize(%));

S12 := 1/4*H+3/8*(4*H^2+1)^(1/2)

Now it looks to me like S12 = S1 for all real H, but it's not true for imaginary H (e.g. try H = i/2).  It's rather tricky to deal with the branches of the square root function here.

> simplify(eval([S12, S1], H = I/2));

[1/8*I, 5/8*I]

(the Maple tag is acting up: that should be [1/8*I,5/8*I]).

 

For real H, S12 and S1 appear to be solutions of your equation, while S2 is not.  But for e.g. H = -i/2,
none of S12, S1 and S2 are correct (in fact there are no solutions for H = -i/2).

 

> map(op, [1,3,4], a);
        2, "john", sin(57)
> map(op, [1,3,4], a);
        2, "john", sin(57)

Error, parameter and local `dx` have the same name in procedure myproc
 

Removing the local variable dx, I do get a procedure, but it appears to define a step function that has the value 20 for
r < 0, 10100 for 0 < r <= 1, 3030000  for 1 < r <= 2, ....  It's unlikely that you could get anything useful for this from solve or fsolve.

Your procedure doesn't really work: do you mean round(something) instead of "round"?
Also why are you using DotProduct on scalars?  Do you mean * ?

 

It looks to me like a branch cut problem.  Consider:

> J := Int(arctan(z)^2/(1 + t^2 * z^2), z = 0 .. infinity);
  V := value(J) assuming t > 0;

V := -1/8*(2*I*polylog(3,(-1+t)/(t+1))-2*I*polylog(3,(t+1)/(-1+t))+2*I*polylog(3,-(t+1)/(-1+t))+Pi^2*ln(t+1)*I-2*Pi*polylog(2,-(-1+t)/(t+1))-2*I*polylog(3,-(-1+t)/(t+1))+Pi^2*ln(1/(-1+t))*I+2*Pi*polylog(2,-(t+1)/(-1+t)))/t

> plot([V,J],t=0.1 .. 2,0..30, colour=[red,blue]);

It seems Maple's value V is correct for 0 < t < 1, but has a singularity at t=1, and is not valid from that point on.  The actual integral, of course, should be analytic in a neighbourhood of t=1.

Caution: I would be very wary of using testeq.  For example:

> testeq(exp(2*Pi*I*x)=1);

true

and maybe even worse:

> seq(testeq(exp(Pi * I * (x || j)) = 1), j = 1 .. 10);
false, true, true, true, false, false, true, true, false, true


 

Caution: I would be very wary of using testeq.  For example:

> testeq(exp(2*Pi*I*x)=1);

true

and maybe even worse:

> seq(testeq(exp(Pi * I * (x || j)) = 1), j = 1 .. 10);
false, true, true, true, false, false, true, true, false, true


 

It's hard to know without actually seeing your myproc procedure, but one possibility may be to replace the if by piecewise.  For example,

> myproc := proc(x) 
       if x < 1 then x^2 + 1 
       else x - x^2
       end if
   end proc;
     

could be replaced by

> newproc := x -> piecewise(x < 1, x^2 + 1, x - x^2 + 3);

And then

> solve(newproc(x) = 1);

   0, 0, 2

 

Note that I said "two expressions".  Your error message indicates that you only gave it one expression.

Note that I said "two expressions".  Your error message indicates that you only gave it one expression.

Actually, ifactor is not an algorithm.  It is Maple's procedure for prime factorization, which can optionally use several algorithms:

'mpqs'      - Multiple Polynomial Quadratic Sieve method;                
'morrbril'  - Morrison-Brillhart algorithm;                              
'squfof'    - D. Shanks' undocumented square-free factorization;         
'pollard'   - J.M. Pollard's rho method;                                 
'lenstra'   - Lenstra's elliptic curve method

 

Actually, ifactor is not an algorithm.  It is Maple's procedure for prime factorization, which can optionally use several algorithms:

'mpqs'      - Multiple Polynomial Quadratic Sieve method;                
'morrbril'  - Morrison-Brillhart algorithm;                              
'squfof'    - D. Shanks' undocumented square-free factorization;         
'pollard'   - J.M. Pollard's rho method;                                 
'lenstra'   - Lenstra's elliptic curve method

 

I don't know why it seemed to me yesterday that ans worked for R < 0: today it clearly doesn't.  The answer for R < 0 should be
-1/3*(3*exp(-1/3*R)*Pi^(1/2)+R*Pi^(1/2)+3*exp(-1/3*R)*erf(-1/2+1/6*R)*Pi^(1/2)+erf(1/2+1/6*R)*Pi^(1/2)*R+6*exp(-1/36*(3+R)^2)-6*Pi^(1/2))/Pi^(1/2)

(obtained using similar steps, but with the assumption R < 0 instead of R > 0)

First 103 104 105 106 107 108 109 Last Page 105 of 187