vv

13922 Reputation

20 Badges

10 years, 10 days

MaplePrimes Activity


These are replies submitted by vv


 

SplitX:=proc(expr, X::list(name), X0:=0)
local f,A,c,n:=nops(X);
if X0=0 then A:=0*~X else A:=X0 fi;
f:=seq(eval(expr, X=~(subsop(i=X[i],A))),i=1..n);
c:=simplify(expr/mul(f));
if depends(c,X) then WARNING("Unsplitable") fi;
[c,f]
end:

You can take a generic X0=[a,b] and then add assuming or take special values for a,b if necessary.

 

funcs:=[
   x*y,
   x^2+x^2*y,
   2*x+1,
   cos(2*x),
   y(x),
   (x-1)/y,
   ln(1+y^2),
   1-x+y^2-x*y^2,
   x^2+x^3*y,
   1/(x+y),
   (1+sqrt(x))/(1+sqrt(y)),
   (1-x^2+y^2-x^2*y^2)/x^2,
   2*x*y^2+3*x^2*y^2,
   3*exp(2*x)+2*y,
   (5*sqrt(x)-y)/x,
   2*x*y+3*x^2*exp(x^2),
   sqrt(1+x+y^2),
   1,
   1+x*y,
   -y+4*x^3*y,
   exp(x^2)+2*x*y,
   -(y-exp(x))/(x-2),
   arcsin(x)/((1-x^2)*y^2),
   -(y-exp(x))/(x-2),
   -y+4*x^3*y,
   (x^2*y+y)*y^3*exp(-x-y+1)*3^(-x-y)*sqrt(x^2*y-y)   
];

[x*y, x^2*y+x^2, 2*x+1, cos(2*x), y(x), (x-1)/y, ln(y^2+1), -x*y^2+y^2-x+1, x^3*y+x^2, 1/(x+y), (1+x^(1/2))/(1+y^(1/2)), (-x^2*y^2-x^2+y^2+1)/x^2, 3*x^2*y^2+2*x*y^2, 3*exp(2*x)+2*y, (5*x^(1/2)-y)/x, 2*x*y+3*x^2*exp(x^2), (y^2+x+1)^(1/2), 1, x*y+1, 4*x^3*y-y, exp(x^2)+2*x*y, -(y-exp(x))/(x-2), arcsin(x)/((-x^2+1)*y^2), -(y-exp(x))/(x-2), 4*x^3*y-y, (x^2*y+y)*y^3*exp(-x-y+1)*3^(-x-y)*(x^2*y-y)^(1/2)]

(1)

for f in funcs do
f = SplitX(f,[x,y],[a,b]);
od;

x*y = [1/(b*a), x*b, a*y]

 

x^2*y+x^2 = [1/(a^2*(b+1)), b*x^2+x^2, a^2*y+a^2]

 

2*x+1 = [1/(2*a+1), 2*x+1, 2*a+1]

 

cos(2*x) = [1/cos(2*a), cos(2*x), cos(2*a)]

 

Warning, Unsplitable

 

y(x) = [y(x)/(b(x)*y(a)), b(x), y(a)]

 

(x-1)/y = [b/(a-1), (x-1)/b, (a-1)/y]

 

ln(y^2+1) = [1/ln(b^2+1), ln(b^2+1), ln(y^2+1)]

 

-x*y^2+y^2-x+1 = [-1/((a-1)*(b^2+1)), -b^2*x+b^2-x+1, -a*y^2+y^2-a+1]

 

Warning, Unsplitable

 

x^3*y+x^2 = [(x*y+1)/((b*x+1)*a^2*(a*y+1)), b*x^3+x^2, a^3*y+a^2]

 

Warning, Unsplitable

 

1/(x+y) = [(x+b)*(a+y)/(x+y), 1/(x+b), 1/(a+y)]

 

(1+x^(1/2))/(1+y^(1/2)) = [(1+b^(1/2))/(1+a^(1/2)), (1+x^(1/2))/(1+b^(1/2)), (1+a^(1/2))/(1+y^(1/2))]

 

(-x^2*y^2-x^2+y^2+1)/x^2 = [-a^2/((a^2-1)*(b^2+1)), (-b^2*x^2+b^2-x^2+1)/x^2, (-a^2*y^2-a^2+y^2+1)/a^2]

 

3*x^2*y^2+2*x*y^2 = [1/((3*a+2)*a*b^2), 3*b^2*x^2+2*b^2*x, 3*a^2*y^2+2*a*y^2]

 

Warning, Unsplitable

 

3*exp(2*x)+2*y = [(3*exp(2*x)+2*y)/((3*exp(2*x)+2*b)*(3*exp(2*a)+2*y)), 3*exp(2*x)+2*b, 3*exp(2*a)+2*y]

 

Warning, Unsplitable

 

(5*x^(1/2)-y)/x = [-(-5*x^(1/2)+y)*a/((-5*x^(1/2)+b)*(-5*a^(1/2)+y)), (5*x^(1/2)-b)/x, (5*a^(1/2)-y)/a]

 

Warning, Unsplitable

 

2*x*y+3*x^2*exp(x^2) = [(3*exp(x^2)*x+2*y)/((3*exp(x^2)*x+2*b)*a*(3*exp(a^2)*a+2*y)), 2*x*b+3*x^2*exp(x^2), 2*a*y+3*a^2*exp(a^2)]

 

Warning, Unsplitable

 

(y^2+x+1)^(1/2) = [(y^2+x+1)^(1/2)/((b^2+x+1)^(1/2)*(y^2+a+1)^(1/2)), (b^2+x+1)^(1/2), (y^2+a+1)^(1/2)]

 

1 = [1, 1, 1]

 

Warning, Unsplitable

 

x*y+1 = [(x*y+1)/((b*x+1)*(a*y+1)), b*x+1, a*y+1]

 

4*x^3*y-y = [1/((4*a^3-1)*b), 4*b*x^3-b, 4*a^3*y-y]

 

Warning, Unsplitable

 

exp(x^2)+2*x*y = [(exp(x^2)+2*x*y)/((exp(x^2)+2*x*b)*(exp(a^2)+2*a*y)), exp(x^2)+2*x*b, exp(a^2)+2*a*y]

 

Warning, Unsplitable

 

-(y-exp(x))/(x-2) = [(-y+exp(x))*(a-2)/((-b+exp(x))*(-y+exp(a))), -(b-exp(x))/(x-2), -(y-exp(a))/(a-2)]

 

arcsin(x)/((-x^2+1)*y^2) = [b^2*(-a^2+1)/arcsin(a), arcsin(x)/((-x^2+1)*b^2), arcsin(a)/((-a^2+1)*y^2)]

 

Warning, Unsplitable

 

-(y-exp(x))/(x-2) = [(-y+exp(x))*(a-2)/((-b+exp(x))*(-y+exp(a))), -(b-exp(x))/(x-2), -(y-exp(a))/(a-2)]

 

4*x^3*y-y = [1/((4*a^3-1)*b), 4*b*x^3-b, 4*a^3*y-y]

 

Warning, Unsplitable

 

(x^2*y+y)*y^3*exp(-x-y+1)*3^(-x-y)*(x^2*y-y)^(1/2) = [(x^2*y-y)^(1/2)*3^(a+b)*exp(a+b-1)/((a^2*y-y)^(1/2)*(a^2+1)*(b*(x^2-1))^(1/2)*b^4), (b*x^2+b)*b^3*exp(-x-b+1)*3^(-x-b)*(b*x^2-b)^(1/2), (a^2*y+y)*y^3*exp(-a-y+1)*3^(-a-y)*(a^2*y-y)^(1/2)]

(2)

 

@Pinetree 

The easiest method is to write a simple and short procedure (because in Maple it could be complicated to rewrite an expression in your own way).

quad := proc(p,x::name)
local a,b,c;
  if not type(p, quadratic(x)) then error "Not quadratic!" fi;
  c,b,a := seq(coeff(p,x,k),k=0..2);
  -b/(2*a)+1/2*sqrt(b^2/a^2-4*c/a)
end proc;

 

@tomleslie 

I have mentioned this aspect several times in this forum and I still do not have a solution.
On my system (Maple 2018, 64 bit, Windows 7) the vector 3d eps plots are simply wrong.

Your test.eps is also strange:

And

plot3d(x^2+y^2, x=-1..1,y=-1..1);
produces:

Hello Christopher.
There are a few problems for this World Cup simulation:

1. The first error appears because the flag for "MOR" is missing in flags
2. Now the flags table is too large as you have mentioned; it should be put in an external file and read from there.
3. (Main problem). Now there are 8 groups instead of 6 and the rules are different; I actually do not know the new rules (they were rather complicated for 6 groups too).
4. Unfortunately I am busy at this time; not to mention that that my enthusiasm is now a little lower because my country (Romania) is not qualified :-(


 


 

@whtitefall 

Use:
l:=1/2;
evalf(DD(1)); 

That's why I have suggested to define R := (x,h) -> ...  etc

 

@one pound 

It is useful for asymptotics; my objection was for using "=" instead of "~".

@Adam Ledger 

f(oo) = oo implies f(k)>0 for k large enough, so your question is answered.
A bound can be computed using x -1 < floor(x) <= x; ==> S subset {1,...,527}. Then use Maple.

 

In (I) you use divisibility in Q* which is unusual; anyway, the third implication is false.

For (II)  a counterexample is expected.

@tomleslie 

The 'elegant' approach appears in

Blumenthal L.M. - Theory and Applications of Distance Geometry. Chelsea, 1970

theorem 43.1 (due to Schoenberg).

 

Please note that I also have a mistake in the "Clarification" reply. The fM procedure there is wrong. It always returns `false`.
(I forgot to use the transform from IsTetra).
The correct one is:

 

fMok:=proc(a,b,c,x,y,z) #AB=c,AC=b,BC=a,DA=x,DB=y,DC=z
<2*x^2, -c^2+x^2+y^2, -b^2+x^2+z^2; -c^2+x^2+y^2, 2*y^2, -a^2+y^2+z^2; -b^2+x^2+z^2, -a^2+y^2+z^2, 2*z^2>;
LinearAlgebra:-IsDefinite(%, query = 'positive_definite')
end proc:

 

 

So, your positive_definite version is basically correct. I said that it's wrong because I missed the different notations.
Namely, if ABCD is the tetrahedron then you used AB=cbar, AC=bbar, BC=abar, DA=a, DB=b, DC=c. Mine were reversed.

So, apologies  for this!

Also, IsTetra in my answer is OK (because the notations are clear) but istetra should be:

 

istetraok:=proc(a,b,c,x,y,z) #AB=c,AC=b,BC=a,DA=x,DB=y,DC=z
is(`and`(       #((
a>0,b>0,c>0,x>0,y>0,z>0,
2*max(a,b,c)<a+b+c,
2*max(a,y,z)<a+y+z,
2*max(x,b,z)<x+b+z,
2*max(x,y,c)<x+y+c,
LinearAlgebra:-Determinant(
<0,x^2,y^2,z^2,1; x^2,0,c^2,b^2,1; y^2,c^2,0,a^2,1; z^2,b^2,a^2,0,1; 1,1,1,1,0>) >0
))
end:

 

 

Download distance-geometry.mw

@kuwait1 

It is easy to see that the integrand always has a pole in [0,Pi] for n::posint.

@tomleslie 

That was the purpose of the example. There is no tetrahedron!
(A triangle cannot have the sides 1,1,3).
You should turn both disagree into agree :-)

 

@Carl Love 

I know, but S[n] etc have huge values and for larger n the situation is worse.

Maybe the approximation is valid only near t=0. It's a kind of Picard iteration.

The "homotopy" S_n approch leads to something like:

restart;
N:=5e7;
beta:=0.00001;
mu:=0.02;
sigma:=45.6;
gamma1:=73;

S[0]:=t -> 12500000;
E[0]:=t -> 50000;
J[0]:=t -> 30000;
R[0]:=t -> 37420000;

for n from 0 to 2 do
S[n+1]:= unapply( S[n](t)-int(D(S[n])(w)- mu*N+beta*S[n](w)*J[n](w)+mu*S[n](w), w=0..t), t):
E[n+1]:= unapply( E[n](t)-int(D(E[n])(w) - beta*S[n](w)*J[n](w)+mu*E[n](w)+sigma*E[n](w), w=0..t), t);
J[n+1]:= unapply( J[n](t)-int(D(J[n])(w)- sigma*E[n](w)+mu*J[n](w)+gamma1*J[n](w), w=0..t), t);
R[n+1]:= unapply( R[n](t)-int(D(R[n])(w)-gamma1*J[n](w)+mu*R[n](w), w=0..t), t);
od;

plot(S[3], 0..70);

but does not seem to approximate the solution.

@tomleslie 

1. If you don't add the triangle inequalities, your seq test does not give a correct answer.
You can check this for  test:=[1,1,3,5,1,3];

2. The positive_definite approach is correct only for the Cayley-Menger matrix; it does not work for your  McCrea.
So the correct procedure is

fM:=proc(a,b,c,d,e,f) # a>0 etc
<0,a^2,b^2,c^2,1; a^2,0,f^2,e^2,1; b^2,f^2,0,d^2,1; c^2,e^2,d^2,0,1; 1,1,1,1,0>;
LinearAlgebra:-IsDefinite(%, query = 'positive_definite')
end;

So, it's not a matter of excessive bother.

Best regards,
V.A.

 

S_0(t)  etc  are needed. Probably you mean  S_0(t) = 12500000 etc.

Why don't you write your equations in Maple to be copy-pasted? Do you prefer to be typed by the forum members?

First 88 89 90 91 92 93 94 Last Page 90 of 176