12243 Reputation

19 Badges

8 years, 75 days

MaplePrimes Activity

These are answers submitted by vv

Not all ODEs have series solutions around 0.
To illustrate the problem, let's modify a bit your second ODE.

ode1:=x^2*diff(diff(y(x),x),x)+x*diff(y(x),x)+y(x) = 0:

             y(x) = _C1 sin(ln(x)) + _C2 cos(ln(x))

MultiSeries:-series(sin(ln(x)), x=0);



for x from isqrt(m) while not issqr(x^2-m) do od:
y:=isqrt(x^2-m):  'm' = (x-y) %* (x+y);

m = 4081321110693270343633073697474256143563558458718976746753830538032062222085722974121768604305614359 %* 4081321110693270343633073697474256143563558458719886006565783193342137709249520153612225643475208637

# This works only if the two primes are "very" close. (x is close to sqrt(m).)


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:

A:={seq(-2..2)}:  A0:=A minus {0}:
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:
an1:=simplify(abs(a(n))^(1/n)) assuming n::odd:

      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]]


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



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





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

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


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





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





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.

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

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

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);


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

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.


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)


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



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

.1904761905 = .1904761905




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 



First 7 8 9 10 11 12 13 Last Page 9 of 110