vv

12453 Reputation

19 Badges

9 years, 285 days

MaplePrimes Activity


These are answers submitted by vv

EllipticF(z, k)  has a bug for  z --> infinity  for any k (not necessarily complex).

It seems to be an old and known one.

Let's illustrate for k=1/2.

 

f:= EllipticF(z,1/2);

EllipticF(z, 1/2)

(1)

limit(f, z=infinity); # fails

limit(EllipticF(z, 1/2), z = infinity)

(2)

MultiSeries:-limit(f, z=infinity); # wrong

4*EllipticK(2)-(2*I)*EllipticK((1/2)*(-3)^(1/2)*4^(1/2))

(3)

evalf(%);

3.371500710-6.469546944*I

(4)

eval(f, z=1e6);

0.2000000000e-5-2.156515648*I

(5)

# The correct limit is

- EllipticCK(1/2)*I;
evalf(%);

-I*EllipticCK(1/2)

 

-2.156515647*I

(6)

# asympt is also wrong

asympt(f, z, 2); # fails

Error, (in asympt) unable to compute series

 

MultiSeries:-asympt(f, z, 2); # wrong

4*EllipticK(2)-(2*I)*EllipticK((1/2)*(-3)^(1/2)*4^(1/2))-2/z+O(1/z^3)

(7)

evalf(%);

3.371500710-6.469546944*I-2./z+O(1/z^3)

(8)

restart;

with(GraphTheory):

A0:=<
0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 1, 1, 0, 1, 0, 0, 0, 1;
1, 1, 0, 0, 1, 0, 1, 1, 1, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
>;

Matrix(4, 10, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = 0, (1, 10) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (2, 4) = 1, (2, 5) = 0, (2, 6) = 1, (2, 7) = 0, (2, 8) = 0, (2, 9) = 0, (2, 10) = 1, (3, 1) = 1, (3, 2) = 1, (3, 3) = 0, (3, 4) = 0, (3, 5) = 1, (3, 6) = 0, (3, 7) = 1, (3, 8) = 1, (3, 9) = 1, (3, 10) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (4, 9) = 0, (4, 10) = 0})

(1)

A:=Matrix(10,A0);

Matrix(10, 10, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = 0, (1, 10) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (2, 4) = 1, (2, 5) = 0, (2, 6) = 1, (2, 7) = 0, (2, 8) = 0, (2, 9) = 0, (2, 10) = 1, (3, 1) = 1, (3, 2) = 1, (3, 3) = 0, (3, 4) = 0, (3, 5) = 1, (3, 6) = 0, (3, 7) = 1, (3, 8) = 1, (3, 9) = 1, (3, 10) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (4, 9) = 0, (4, 10) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (5, 9) = 0, (5, 10) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (6, 9) = 0, (6, 10) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (7, 9) = 0, (7, 10) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0, (8, 9) = 0, (8, 10) = 0, (9, 1) = 0, (9, 2) = 0, (9, 3) = 0, (9, 4) = 0, (9, 5) = 0, (9, 6) = 0, (9, 7) = 0, (9, 8) = 0, (9, 9) = 0, (9, 10) = 0, (10, 1) = 0, (10, 2) = 0, (10, 3) = 0, (10, 4) = 0, (10, 5) = 0, (10, 6) = 0, (10, 7) = 0, (10, 8) = 0, (10, 9) = 0, (10, 10) = 0})

(2)

G:=Graph(A);  # directed graph

GRAPHLN(directed, unweighted, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], Array(%id = 18446744074365436142), `GRAPHLN/table/1`, 0)

(3)

DrawGraph(G, style=circle);

 

node:=2;
A||node:=Matrix(10):  A||node[node]:=A[node]:
G||node:=Graph(A||node):
DrawGraph(G||node, style=circle);

2

 

 


Download DirGraph.mw

Why do you think that the desired solution must be obtained for _C1 = 0?
Use e.g.
S:=dsolve({E1, phi(0) = b*a/(a*c-b^2)},  phi(xi));
symplify([S], symbolic);

You will find your solution, but be careful about branches.

(Note also that the ODE is not in an explicite form, so even with an initial condition it could have infinitely many solutions).

restart;

xnextHelley:= x - 2*f(x)*D(f)(x)/( 2* D(f)(x)^2 - f(x)*D(D(f))(x) ); # the method

x-2*f(x)*(D(f))(x)/(2*(D(f))(x)^2-f(x)*((D@@2)(f))(x))

(1)

f:= x -> a*x + b*x^2 + c*x^3 + d(x)*x^4;  # WLOG, x[infinity]=0

proc (x) options operator, arrow; a*x+b*x^2+c*x^3+d(x)*x^4 end proc

(2)

series(xnextHelley, x);

series(-((a*c-b^2)/a^2)*x^3-((3*a*d(0)-3*b*c-3*(a*c-b^2)*b/a)/a^2)*x^4-((6*a*(D(d))(0)-3*b*d(0)-3*c^2-(1/2)*(a*c-b^2)*(6*a*c+6*b^2)/a^2-9*(a^2*d(0)-2*b*c*a+b^3)*b/a^2)/a^2)*x^5+O(x^6),x,6)

(3)

# So,

abs(x[n+1] - x[infinity]) <= M * abs(x[n] - x[infinity])^3;  # ==>  order=3

abs(-x[n+1]+x[infinity]) <= M*abs(x[n]-x[infinity])^3

(4)

 

Note first that A^n can be computed symbolically using LinearAlgebra:-MatrixPower(A,n);
The entries are the Fibonacci numbers, and as Rouben said, it is easy to see that the maximum entry is fibonacci(n+1) at (1,1).
Here is a procedure to compute the inverse Fibonacci numbers.

inversefib:=proc(y::posint)
local n1,n2, s1,s2;
if y=1 then return 'Exact'=2 fi;
n1:=ln( (1/2)*sqrt(5)*y+(1/2)*sqrt(5*y^2+4) )/ln((sqrt(5)+1)/2); # n even
n2:=ln( (1/2)*sqrt(5)*y+(1/2)*sqrt(5*y^2-4) )/ln((sqrt(5)+1)/2); # n odd
s1,s2:=simplify~([n1,n2])[];
if   s1::even then  'Exact'=s1
elif s2::odd  then  'Exact'=s2
else  'Next'= ceil(s1) fi
end proc:

Examples.
inversefib(2019);
    
Next = 18
inversefib(3524578);
     Exact = 33
inversefib(10^12);
     Next = 60

 

 

remove[flatten](member, A, B);

If you want it inplace, use

remove[flatten,inplace](member, A, B);

plot(arctan(x),x=-20..20, 
title=typeset(
H__0,": ", sigma[1]^2=sigma[2]^2, "     ",  
H__1,": ", sigma[1]^2<>sigma[2]^2, "\n", MyTitle)
);

Yes, it seems that

seq(C[i+1]-C[i], i = 1 .. N-1):
does not finish the job.
But,
seq(C[i+1]-i^2, i = 1 .. N-1):
works.
Probably a bug.

 

 

The limit does exist in C.
For a real function it is possible to use

RealDomain:-limit(sqrt(x^2 - 3 *x + 2), x=2, left);
        undefined

Or, execute first
with(RealDomain);

However I'd recommend RealDomain only if the user really does not know (yet) about complex numbers & functions.
(You should know that almost all mathematical functions are defined in C.)

 

 

FC:= proc(n) 
uses plots,plottools;
local a,b,u;
{seq(seq(a/b, a = 0 .. b), b = 1 .. n)};
display(seq(circle([u,1/2/denom(u)^2],1/2/denom(u)^2), u=%)
        ,scaling = constrained, color = blue, size = [800, 800])
end proc:

FC(6);

See also Apollonian circles

print~([a, b]);  means  [print(a), print(b)];

Now, print(a)  prints a (as a side effect) and returns NULL.
The last output is [NULL,NULL]. If you want to eliminate it, use print~([a, b]):  (colon instead of semicolon).

Digits:=150:
A:=Matrix(eval(M,P=0),shape=symmetric):
B:=Matrix(-diff(M,P), shape=symmetric):
E:=LinearAlgebra:-Eigenvalues(A,B):
E1:=Re(E);
E2:=Im(E); # =0
Esorted:=sort(E1);
evalf[15](Esorted[1..15]), evalf[15](Esorted[-15..-1]);

Yes, shape=triangular[upper, unit]  seems to have a serious problem.

The best (partial) workaround is probably

U:= Matrix(Matrix(4,4, shape=triangular[upper, unit], symbol =u), shape=triangular[upper]);

(partial, because the diagonal elements are now assignable.)

s:=solve((hv*hw+lv*lw)/(lv+hv)*(lv+hv) = dw*(lv+hv), hv):
sign(s)*numer(s)/sort(expand((sign(s)*denom(s))),order=plex(hw,dw));
#   Do you think it's worth the effort?

 

solve({seq(a*v + b*u - w)}, {a,b});

(If w is not in the span of u,v, the result is NULL).

 

First 47 48 49 50 51 52 53 Last Page 49 of 111