vv

13490 Reputation

20 Badges

9 years, 179 days

MaplePrimes Activity


These are answers submitted by vv

You must use signum, not sign.(sign is used mainly for polynomials in Maple).

Take the two sub-sequences for which sin(n)>0  and sin(n)<0 [it cannot be 0].
The limits are 11/2 and 25/2, so, R=2/25.

Using random polynomials there are big chances to have duplicates (there are only 500 such polynomials). So:

restart;
A:={seq(-2..2)}:  A0:=A minus {0}:
n:=54:
a:=Iterator:-CartesianProduct(A0,A$3, rank=500-n+1):
seq(add(v[i]*x^(i-1)+x^4,i=1..4), v=a);

 

The radius of convergence needs limsup and root test here.

a := n -> ((2 + (-1)^n)/(5 - (-1)^n))^n:
an0:=simplify(abs(a(n))^(1/n)) assuming n::even:
R0:=limit(1/an0,n=infinity):
an1:=simplify(abs(a(n))^(1/n)) assuming n::odd:
R1:=limit(1/an1,n=infinity):
R:=min(R0,R1);

      R := 4/3

Optimization:-Minimize(x->TF(x, 0, 0.03, 55.11566060, Pi/2, Pi/4), 0 .. 0.03);

                         [4.281548719743726*10^(-7), [0.15749994509751696e-1]]
 

restart;

sum(Beta(k,1/2)/(2*k+1)^2,k=1..infinity);  # Bug!

Error, (in SumTools:-DefiniteSum:-ClosedForm) summand is singular in the interval of summation

 

S:=Sum(Beta(k,1/2)/(2*k+1)^2,k=1..infinity);

Sum(Beta(1/2, k)/(2*k+1)^2, k = 1 .. infinity)

(1)

Sa:=evalf[15](S);

.336137623291124

(2)

s:=value(convert(S, GAMMA));

(1/4)*Pi^(1/2)*MeijerG([[1], [5/2, 5/2]], [[3/2, 1, 1], []], -1)

(3)

evalf[15](s); # Maple cannot compute

 

exact:=identify(Sa,BasisPolyConst=[Catalan]);

4-4*Catalan

(4)

evalf[100](S-exact); # numerical check

0.

(5)

 

 

Adding to what user acer said:

Gcd in Algebraic has a distinct syntax; it is not inert any more.
If you want the result mod 3 then use

 Gcd(f, g, characteristic=3);

Note that without characteristic=3, the gcd is computed in the ring Z[x]; if mod 3 is included (as you did), the mod 3 is applied to this polynomial.

It depends on what the procedure actually does.E.g., p could be a local variable.

f:=proc(i)
local p;
answer = p[i]
end:
eq1 := f(1);

                      eq1 := answer = p[1]
rhs(eq1): is(%=p[1]);
                             false

If you comment out the local declaration, ==> true.
 

Any procedure P can be called "indexed" P[abc](arguments), instead of the usual P(arguments)
In the body of the procedure, the index can be retrieved and used as an extra argument, or can be simply ignored. Most library procedures ignore the index (mainly if it is not expected).
See a simple standard example with  showstat(log);

Examples:

sin[xxx](Pi/2); # ignored
                               1

max[abc](22,33,11); # not ignored, for obvious reasons
Error, invalid input: unrecognized max/min[option] abc

It would be convenient to have always warnings when calling an indexed procedure which ignores the index, but it would be inefficient; anyway, this "feature" is as old as Maple I think.

Some commands have option remember, so these are not re-executed next time.

@Johan159 You should be aware that W(x) is not a regular variable, and it is not a good idea to use it this way.

An assignment W(x) := a produces a procedure W and creates/extends its remember table. When W(x) is accessed, it is not evaluated, that's why in your case _C1 was displayed; if you want evaluation, it must be accessed via eval(W(x)). So, don't use it, unless you know these details.
 

restart;

f:= (n,x) -> piecewise(x <-1/n, -1, x<1/n,n*x, 1);
plot([f(3,x), f(7,x)], x=-2..2, color=[red,blue]);

f := proc (n, x) options operator, arrow; piecewise(x < -1/n, -1, x < 1/n, n*x, 1) end proc

 

 

simplify(int( abs(f(n,x)-f(m,x)), x=-1..1)) assuming 1<=m, m<n;
# Unfortunately, Maple cannot do it directly

int(abs(-piecewise(x*n < -1, -1, x*n < 1, x*n, 1)+piecewise(x*m < -1, -1, x*m < 1, x*m, 1)), x = -1 .. 1)

(1)

ans:=simplify(2*int(f(n,x)-f(m,x), x=0..1)) assuming m>1,n>m;
# Using that x->f(n,x) is odd and f(m,x)<=f(n,x) for x>=0

(n-m)/(n*m)

(2)

map(evalf@eval, Int(abs(f(n,x)-f(m,x)), x=-1..1) = ans, [m=3,n=7] ); # numeric check

.1904761905 = .1904761905

(3)

 

 

There are several problems with your code:

--  x is used both as a table (indexed) and as a real number. Use another name for one of them.

-- The arguments of piecewise are in a wrong order

--  You must use unapply when defining phi (otherwise the arguments of piecewise are not evaluated).

You may define (inside or outside the mpl)

Dy := t -> eval(diff(y(t_),t_), t_=t);
D2y := t -> eval(diff(y(t_),t_$2), t_=t);

and then 

ode:=D2y(x)+Dy(x)=sin(x);
ic:=y(0)=1,Dy(0)=0;
dsolve([ode,ic],y(x));

 

For n=4, we may take the points O(0,0), A(3,0), B(3,4), C(0,4); I don't know whether the radius (5/2 here) is minimal.
For a general n, Erdos and Anning have a construction (1945), see Erdős–Anning theorem - Wikipedia

Edit. The minimal radius is 8/sqrt(15) = 2.06...  and corresponds to a cyclic quadrilateral having the lengths of the edges: 2, 3, 2, 4.

A 3d line is determined by a point P and a direction V. 
We need a necessary and sufficient condition for the concurrency of two (non-parallel)  lines.
Let's represent P and V as lists.

restart;
conc:=(P1,V1,P2,V2) -> LinearAlgebra:-Determinant(Matrix([P1-P2,V1,V2])):
A:= [1,-2,3]:    # Your data
d1:= [1,0,-3], [2,1,-2]:
d2:= [1,0, 3], [-1,1,2]:
solve( [ conc(A, [p,q,r], d1), conc(A, [p,q,r], d2) ], [p,q,r] );
#                 [[p = 6/5*q, q = q, r = -12/5*q]]
TheLine = A, eval([p,q,r], %[]); # the wanted line
#               TheLine = [1, -2, 3], [6/5*q, q, -12/5*q]
eval(%,q=5); #Or,
#               TheLine = [1, -2, 3], [6, 5, -12]

So, you may write it as:  (x-1)/6 = (y+2)/5 = (z-3)/(-12)

First 15 16 17 18 19 20 21 Last Page 17 of 118