vv

12590 Reputation

19 Badges

8 years, 243 days

MaplePrimes Activity


These are replies submitted by vv

@Zeineb  So, you have the system:

pdsolve(
{-A(t)^2*diff(Zeta_1(t,x,y,z),t)+diff(Zeta_0(t,x,y,z),x) = 0, 
A(t)^2*diff(Zeta_1(t,x,y,z),y)+B(t)^2*diff(Zeta_2(t,x,y,z),x) = 0, 
A(t)^2*diff(Zeta_1(t,x,y,z),z)+C(t)^2*diff(Zeta_3(t,x,y,z),x) = 0,
-B(t)^2*diff(Zeta_0(t,x,y,z),y)+diff(Zeta_0(t,x,y,z),y) = 0, 
B(t)^2*diff(Zeta_2(t,x,y,z),z)+C(t)^2*diff(Zeta_3(t,x,y,z),y) = 0, 
-C(t)^2*diff(Zeta_3(t,x,y,z),t)+diff(Zeta_0(t,x,y,z),z) = 0,
diff(Zeta_0(t,x,y,z),t) = psi(t,x,y,z), diff(Zeta_1(t,x,y,z),x) = psi(t,x,y,z),
diff(Zeta_2(t,x,y,z),y) = psi(t,x,y,z), diff(Zeta_3(t,x,y,z),z) = psi(t,x,y,z)},
[Zeta_0(t,x,y,z), Zeta_1(t,x,y,z), Zeta_2(t,x,y,z), Zeta_3(t,x,y,z), A(t), B(t), C(t), psi(t,x,y,z)]
);

Unfortunately pdsolve throws an (internal) error. It's a bug! But a general solution could be hard to find. 
(The system has of course the trivial solution Zeta_k = 0, psi=0,  A,B,C = arbitrary).

@Carl Love I like your highly optimized code (vote up). However, I prefer (for an answer) the version:

A219954list := nmax -> [ 
seq[scan=`+`](
    ifelse(n=1, 0, 3^add(Bits:-Split(n-1)) - ifelse(2^ilog2(n)=n, n/2, 0)),
    n = 1..nmax
)]:

which is much easier to read and less than twice slower.

@Carl Love Nice, but you must take care of "too many levels of recursion" for n large.

1. You need a package (FractionalCalculus) which is not present. Maple does not contain it; not even the Application Center.

2. The empty definition of u does not make sense.

@vv 

plots:-display(  seq( plottools:-tetrahedron([ P[u[1]],P[u[2]],P[u[3]],P[u[4]] ]), u in T) );

Maple does not include a function for all subgraphs isomorphic to a given graph.
So, we need an ad-hoc solution.

restart;
a:=floor(33*sqrt(3)):
R2:=33^2*3:  # the radius^2
L2:=R2*16/6: # the edge^2
nr:=0: W:=Array(1..0):
for  x from 0 to a do
for  y from x to a do
for  z from y to a do
if x^2+y^2+z^2=R2 then nr++: W(nr):=[x,y,z] fi
od od od:
f:=u -> ([u[1],u[2],u[3]], [-u[1],u[2],u[3]],[u[1],-u[2],u[3]], [u[1],u[2],-u[3]],
        [-u[1],-u[2],u[3]], [-u[1],u[2],-u[3]],[u[1],-u[2],-u[3]], [-u[1],-u[2],-u[3]]):
P:=f~({seq}(W)): # the integer points on the sphere; nu toate, ar trebui si permutarile! (dar vrem doar o solutie!)
n:=nops(P);
#                            n := 96
g:=u -> ([u[1],u[2],u[3]], [u[1],u[3],u[2]],[u[2],u[1],u[3]], [u[2],u[3],u[1]],
        [u[3],u[1],u[2]], [u[3],u[2],u[1]]):
P:=g~(P): n:=nops(P);
#                            n := 416
d2 :=(u,v) -> inner(u-v,u-v):
A:=Matrix( n, (i,j)-> `if`(d2(P[i],P[j])=L2, 1, 0) ):
J:={seq}(1...n):
for j to n do G[j]:=select(i -> (d2(P[i],P[j])=L2), J) od:
nT:=0: T:=Array(1..0):
for a in J do
for b in G[a] do
for c in G[a] intersect G[b] do
for d in G[a] intersect G[b] intersect G[c] do
  T(++nT):={a,b,c,d};
od od od od:
nT;
#                              3120
T:={seq(T)}: nops(%);
#                              130
k:=0: for u in T do lprint(++k = {P[u[1]],P[u[2]],P[u[3]],P[u[4]]}) od:

1 = {[-57, -3, -3], [15, 39, 39], [21, -51, 15], [21, 15, -51]}
2 = {[-57, -3, -3], [17, -13, 53], [17, 53, -13], [23, -37, -37]}
3 = {[-57, -3, 3], [15, 39, -39], [21, -51, -15], [21, 15, 51]}
4 = {[-57, -3, 3], [17, -13, -53], [17, 53, 13], [23, -37, 37]}
5 = {[-57, 3, -3], [15, -39, 39], [21, -15, -51], [21, 51, 15]}
6 = {[-57, 3, -3], [17, -53, -13], [17, 13, 53], [23, 37, -37]}
7 = {[-57, 3, 3], [15, -39, -39], [21, -15, 51], [21, 51, -15]}
8 = {[-57, 3, 3], [17, -53, 13], [17, 13, -53], [23, 37, 37]}
9 = {[-55, -11, -11], [11, -11, 55], [11, 55, -11], [33, -33, -33]}
10 = {[-55, -11, 11], [11, -11, -55], [11, 55, 11], [33, -33, 33]}
11 = {[-55, 11, -11], [11, -55, -11], [11, 11, 55], [33, 33, -33]}
12 = {[-55, 11, 11], [11, -55, 11], [11, 11, -55], [33, 33, 33]}
13 = {[-53, -17, -13], [3, 57, -3], [13, -17, 53], [37, -23, -37]}
14 = {[-53, -17, 13], [3, 57, 3], [13, -17, -53], [37, -23, 37]}
15 = {[-53, -13, -17], [3, -3, 57], [13, 53, -17], [37, -37, -23]}
16 = {[-53, -13, 17], [3, -3, -57], [13, 53, 17], [37, -37, 23]}
17 = {[-53, 13, -17], [3, 3, 57], [13, -53, -17], [37, 37, -23]}
18 = {[-53, 13, 17], [3, 3, -57], [13, -53, 17], [37, 37, 23]}
19 = {[-53, 17, -13], [3, -57, -3], [13, 17, 53], [37, 23, -37]}
20 = {[-53, 17, 13], [3, -57, 3], [13, 17, -53], [37, 23, 37]}
21 = {[-51, -21, -15], [-5, 29, 49], [19, 35, -41], [37, -43, 7]}
22 = {[-51, -21, -15], [-3, 57, 3], [15, -21, 51], [39, -15, -39]}
23 = {[-51, -21, 15], [-5, 29, -49], [19, 35, 41], [37, -43, -7]}
24 = {[-51, -21, 15], [-3, 57, -3], [15, -21, -51], [39, -15, 39]}
25 = {[-51, -15, -21], [-5, 49, 29], [19, -41, 35], [37, 7, -43]}
26 = {[-51, -15, -21], [-3, 3, 57], [15, 51, -21], [39, -39, -15]}
27 = {[-51, -15, 21], [-5, 49, -29], [19, -41, -35], [37, 7, 43]}
28 = {[-51, -15, 21], [-3, 3, -57], [15, 51, 21], [39, -39, 15]}
29 = {[-51, 15, -21], [-5, -49, 29], [19, 41, 35], [37, -7, -43]}
30 = {[-51, 15, -21], [-3, -3, 57], [15, -51, -21], [39, 39, -15]}
31 = {[-51, 15, 21], [-5, -49, -29], [19, 41, -35], [37, -7, 43]}
32 = {[-51, 15, 21], [-3, -3, -57], [15, -51, 21], [39, 39, 15]}
33 = {[-51, 21, -15], [-5, -29, 49], [19, -35, -41], [37, 43, 7]}
34 = {[-51, 21, -15], [-3, -57, 3], [15, 21, 51], [39, 15, -39]}
35 = {[-51, 21, 15], [-5, -29, -49], [19, -35, 41], [37, 43, -7]}
36 = {[-51, 21, 15], [-3, -57, -3], [15, 21, -51], [39, 15, 39]}
37 = {[-49, -29, -5], [-7, 43, 37], [15, 21, -51], [41, -35, 19]}
38 = {[-49, -29, 5], [-7, 43, -37], [15, 21, 51], [41, -35, -19]}
39 = {[-49, -5, -29], [-7, 37, 43], [15, -51, 21], [41, 19, -35]}
40 = {[-49, -5, 29], [-7, 37, -43], [15, -51, -21], [41, 19, 35]}
41 = {[-49, 5, -29], [-7, -37, 43], [15, 51, 21], [41, -19, -35]}
42 = {[-49, 5, 29], [-7, -37, -43], [15, 51, -21], [41, -19, 35]}
43 = {[-49, 29, -5], [-7, -43, 37], [15, -21, -51], [41, 35, 19]}
44 = {[-49, 29, 5], [-7, -43, -37], [15, -21, 51], [41, 35, -19]}
45 = {[-47, -23, -23], [-15, 39, 39], [31, -41, 25], [31, 25, -41]}
46 = {[-47, -23, 23], [-15, 39, -39], [31, -41, -25], [31, 25, 41]}
47 = {[-47, 23, -23], [-15, -39, 39], [31, -25, -41], [31, 41, 25]}
48 = {[-47, 23, 23], [-15, -39, -39], [31, -25, 41], [31, 41, -25]}
49 = {[-43, -37, -7], [-21, 51, 15], [29, 5, -49], [35, -19, 41]}
50 = {[-43, -37, 7], [-21, 51, -15], [29, 5, 49], [35, -19, -41]}
51 = {[-43, -7, -37], [-21, 15, 51], [29, -49, 5], [35, 41, -19]}
52 = {[-43, -7, 37], [-21, 15, -51], [29, -49, -5], [35, 41, 19]}
53 = {[-43, 7, -37], [-21, -15, 51], [29, 49, 5], [35, -41, -19]}
54 = {[-43, 7, 37], [-21, -15, -51], [29, 49, -5], [35, -41, 19]}
55 = {[-43, 37, -7], [-21, -51, 15], [29, -5, -49], [35, 19, 41]}
56 = {[-43, 37, 7], [-21, -51, -15], [29, -5, 49], [35, 19, -41]}
57 = {[-41, -35, -19], [-15, 21, 51], [7, 43, -37], [49, -29, 5]}
58 = {[-41, -35, 19], [-15, 21, -51], [7, 43, 37], [49, -29, -5]}
59 = {[-41, -31, -25], [-23, 47, 23], [25, -31, 41], [39, 15, -39]}
60 = {[-41, -31, 25], [-23, 47, -23], [25, -31, -41], [39, 15, 39]}
61 = {[-41, -25, -31], [-23, 23, 47], [25, 41, -31], [39, -39, 15]}
62 = {[-41, -25, 31], [-23, 23, -47], [25, 41, 31], [39, -39, -15]}
63 = {[-41, -19, -35], [-15, 51, 21], [7, -37, 43], [49, 5, -29]}
64 = {[-41, -19, 35], [-15, 51, -21], [7, -37, -43], [49, 5, 29]}
65 = {[-41, 19, -35], [-15, -51, 21], [7, 37, 43], [49, -5, -29]}
66 = {[-41, 19, 35], [-15, -51, -21], [7, 37, -43], [49, -5, 29]}
67 = {[-41, 25, -31], [-23, -23, 47], [25, -41, -31], [39, 39, 15]}
68 = {[-41, 25, 31], [-23, -23, -47], [25, -41, 31], [39, 39, -15]}
69 = {[-41, 31, -25], [-23, -47, 23], [25, 31, 41], [39, -15, -39]}
70 = {[-41, 31, 25], [-23, -47, -23], [25, 31, -41], [39, -15, 39]}
71 = {[-41, 35, -19], [-15, -21, 51], [7, -43, -37], [49, 29, 5]}
72 = {[-41, 35, 19], [-15, -21, -51], [7, -43, 37], [49, 29, -5]}
73 = {[-39, -39, -15], [-25, 41, 31], [23, 23, -47], [41, -25, 31]}
74 = {[-39, -39, -15], [-15, 51, -21], [3, 3, 57], [51, -15, -21]}
75 = {[-39, -39, 15], [-25, 41, -31], [23, 23, 47], [41, -25, -31]}
76 = {[-39, -39, 15], [-15, 51, 21], [3, 3, -57], [51, -15, 21]}
77 = {[-39, -15, -39], [-25, 31, 41], [23, -47, 23], [41, 31, -25]}
78 = {[-39, -15, -39], [-15, -21, 51], [3, 57, 3], [51, -21, -15]}
79 = {[-39, -15, 39], [-25, 31, -41], [23, -47, -23], [41, 31, 25]}
80 = {[-39, -15, 39], [-15, -21, -51], [3, 57, -3], [51, -21, 15]}
81 = {[-39, 15, -39], [-25, -31, 41], [23, 47, 23], [41, -31, -25]}
82 = {[-39, 15, -39], [-15, 21, 51], [3, -57, 3], [51, 21, -15]}
83 = {[-39, 15, 39], [-25, -31, -41], [23, 47, -23], [41, -31, 25]}
84 = {[-39, 15, 39], [-15, 21, -51], [3, -57, -3], [51, 21, 15]}
85 = {[-39, 39, -15], [-25, -41, 31], [23, -23, -47], [41, 25, 31]}
86 = {[-39, 39, -15], [-15, -51, -21], [3, -3, 57], [51, 15, -21]}
87 = {[-39, 39, 15], [-25, -41, -31], [23, -23, 47], [41, 25, -31]}
88 = {[-39, 39, 15], [-15, -51, 21], [3, -3, -57], [51, 15, 21]}
89 = {[-37, -43, -7], [-19, 35, 41], [5, 29, -49], [51, -21, 15]}
90 = {[-37, -43, 7], [-19, 35, -41], [5, 29, 49], [51, -21, -15]}
91 = {[-37, -37, -23], [-13, 53, -17], [-3, -3, 57], [53, -13, -17]}
92 = {[-37, -37, 23], [-13, 53, 17], [-3, -3, -57], [53, -13, 17]}
93 = {[-37, -23, -37], [-13, -17, 53], [-3, 57, -3], [53, -17, -13]}
94 = {[-37, -23, 37], [-13, -17, -53], [-3, 57, 3], [53, -17, 13]}
95 = {[-37, -7, -43], [-19, 41, 35], [5, -49, 29], [51, 15, -21]}
96 = {[-37, -7, 43], [-19, 41, -35], [5, -49, -29], [51, 15, 21]}
97 = {[-37, 7, -43], [-19, -41, 35], [5, 49, 29], [51, -15, -21]}
98 = {[-37, 7, 43], [-19, -41, -35], [5, 49, -29], [51, -15, 21]}
99 = {[-37, 23, -37], [-13, 17, 53], [-3, -57, -3], [53, 17, -13]}
100 = {[-37, 23, 37], [-13, 17, -53], [-3, -57, 3], [53, 17, 13]}
101 = {[-37, 37, -23], [-13, -53, -17], [-3, 3, 57], [53, 13, -17]}
102 = {[-37, 37, 23], [-13, -53, 17], [-3, 3, -57], [53, 13, 17]}
103 = {[-37, 43, -7], [-19, -35, 41], [5, -29, -49], [51, 21, 15]}
104 = {[-37, 43, 7], [-19, -35, -41], [5, -29, 49], [51, 21, -15]}
105 = {[-35, -41, -19], [-29, 49, 5], [21, -15, 51], [43, 7, -37]}
106 = {[-35, -41, 19], [-29, 49, -5], [21, -15, -51], [43, 7, 37]}
107 = {[-35, -19, -41], [-29, 5, 49], [21, 51, -15], [43, -37, 7]}
108 = {[-35, -19, 41], [-29, 5, -49], [21, 51, 15], [43, -37, -7]}
109 = {[-35, 19, -41], [-29, -5, 49], [21, -51, -15], [43, 37, 7]}
110 = {[-35, 19, 41], [-29, -5, -49], [21, -51, 15], [43, 37, -7]}
111 = {[-35, 41, -19], [-29, -49, 5], [21, 15, 51], [43, -7, -37]}
112 = {[-35, 41, 19], [-29, -49, -5], [21, 15, -51], [43, -7, 37]}
113 = {[-33, -33, -33], [-33, 33, 33], [33, -33, 33], [33, 33, -33]}
114 = {[-33, -33, -33], [-11, -11, 55], [-11, 55, -11], [55, -11, -11]}
115 = {[-33, -33, 33], [-33, 33, -33], [33, -33, -33], [33, 33, 33]}
116 = {[-33, -33, 33], [-11, -11, -55], [-11, 55, 11], [55, -11, 11]}
117 = {[-33, 33, -33], [-11, -55, -11], [-11, 11, 55], [55, 11, -11]}
118 = {[-33, 33, 33], [-11, -55, 11], [-11, 11, -55], [55, 11, 11]}
119 = {[-31, -41, -25], [-31, 25, 41], [15, 39, -39], [47, -23, 23]}
120 = {[-31, -41, 25], [-31, 25, -41], [15, 39, 39], [47, -23, -23]}
121 = {[-31, -25, -41], [-31, 41, 25], [15, -39, 39], [47, 23, -23]}
122 = {[-31, -25, 41], [-31, 41, -25], [15, -39, -39], [47, 23, 23]}
123 = {[-23, -37, -37], [-17, -13, 53], [-17, 53, -13], [57, -3, -3]}
124 = {[-23, -37, 37], [-17, -13, -53], [-17, 53, 13], [57, -3, 3]}
125 = {[-23, 37, -37], [-17, -53, -13], [-17, 13, 53], [57, 3, -3]}
126 = {[-23, 37, 37], [-17, -53, 13], [-17, 13, -53], [57, 3, 3]}
127 = {[-21, -51, -15], [-21, 15, 51], [-15, 39, -39], [57, -3, 3]}
128 = {[-21, -51, 15], [-21, 15, -51], [-15, 39, 39], [57, -3, -3]}
129 = {[-21, -15, -51], [-21, 51, 15], [-15, -39, 39], [57, 3, -3]}
130 = {[-21, -15, 51], [-21, 51, -15], [-15, -39, -39], [57, 3, 3]}
 

Here is an Iterator version. It cannot beat the simple n-loops version for speed.

restart;
f:=proc(a::posint, n::posint)
local K:=floor(a*(n-1)^(1/3)),
      smax:=0, xmax:=Array([0$n]), x:=Array([0$n]), 
      k, dv:=Array([seq(a+k,k=0..n-1)]), v, x1, C;
C:=Iterator:-Combination(K+a+n-1, n):
for v in C do
  x[] := v[] - dv;
  if add(x ^ 3) <> 0 then next fi;
  if (x1 := add(x)) > smax then smax:=x1; xmax[]:=x fi;
od:
smax, xmax
end proc:

CodeTools:-Usage(f(5,9));

memory used=1.62GiB, alloc change=36.00MiB, cpu time=12.66s, real time=13.00s, gc time=1.08s

            12, [-4, 2, 2, 2, 2, 2, 2, 2, 2]

Note that n=20 is too large for an acceptable time time because the iterator C would have ~ 3*10^10 elements. 

@Axel Vogt  For MM, the workaround works just because MatrixFunction happens to give the correct answer for f(x) = exp(x). This is strange because e.g. for f(x) = sin(x), the answer is wrong.

@Carl Love 

P:=[5/2, -5/2]: a:=6: r:=sqrt(2): c:=5/r:
b2:= a^2 - c^2:
X^2/a^2 + Y^2/b2 -1 = 0:
eval(%, [X=(X+Y)/r, Y=(X-Y)/r]):
eval(%, [X=x - P[1], Y=y - P[2]]):
numer(normal(lhs(%)))=0;

           

@Kitonum Yes, I misread (-5,0).

@Axel Vogt  If (x,y,z) in dom(f)  and v = f(x,y,z), then x>0  and we may assume x <= y <= z. v = f(x/z, y/z, 1) and x/z,y/z are in [0,1]. A = {(x,y) :x*y=0 or x=y=1}.

The function f defined by fun is 0-homogeneous ( f(tx,ty,tz) = f(x,y,z), for t>0 )  and symmetric, so, in order to compute the sup we may consider just f(x,y,1)  for (x, y) in [0,1]^2 \ A.

Note that 

limit(f(a^2, a,1) , a=0, right) = 3,  limit(f(a, a,1) , a=0, right) = 4*sqrt(2) - 3 = 2.65... 

So, the sup is probably indeed 3, but I wonder what numerical test could confirm it at least partially! 

@mmcdara The fact that T(S) has a power of 2 elements is a classical result (for arbitrary cardinals); as a consequence, T(S) cannot be countable. I used to prove this to my students.

The number of sets in a (sigma-)algebra should be a power of 2 i.e. 2,4,8, ...

Yes, but PDEtools:-Solve shows a nonsense instead.

2 3 4 5 6 7 8 Last Page 4 of 167