vv

13867 Reputation

20 Badges

9 years, 352 days

MaplePrimes Activity


These are answers submitted by vv

Use assumptions or formal sums

sum(x^n,n=0..infinity) assuming abs(x)<1;
sum(x^n,n=0..infinity,  formal);

 

J := n -> int(sin(Pi*x*n/T)*cos(Pi*x*n/T)/(sin(Pi*x/T)*cos(Pi*x/T)), x);

proc (n) options operator, arrow; int(sin(Pi*x*n/T)*cos(Pi*x*n/T)/(sin(Pi*x/T)*cos(Pi*x/T)), x) end proc

(1)

 

 

K:= unapply(combine(J(k)-J(k-2)), k):

J__even:=Sum(K(2*k), k=1..n/2) assuming n::even;

Sum(sin((4*Pi*k*x-2*Pi*x)/T)*T/(2*Pi*k-Pi), k = 1 .. (1/2)*n)

(2)

J__odd:=x+Sum(K(2*k-1), k=2..(n+1)/2) assuming n::odd;

x+Sum(sin((2*Pi*(2*k-1)*x-2*Pi*x)/T)*T/(Pi*(2*k-1)-Pi), k = 2 .. (1/2)*n+1/2)

(3)

# Compact forms:
 

'J__even'=value(J__even); # n::even

J__even = -((1/4)*I)*T*(-(-exp(-(4*I)*Pi*x/T))^(1/2)*LerchPhi(exp((4*I)*Pi*x/T), 1, (1/2)*n+1/2)*(-exp((4*I)*Pi*x/T))^(1/2)*exp((2*I)*Pi*x*(n+1)/T)+(-exp(-(4*I)*Pi*x/T))^(1/2)*LerchPhi(exp(-(4*I)*Pi*x/T), 1, (1/2)*n+1/2)*(-exp((4*I)*Pi*x/T))^(1/2)*exp(-(2*I)*Pi*x*(n+1)/T)+2*exp((2*I)*Pi*x/T)*(-exp(-(4*I)*Pi*x/T))^(1/2)*arctan((-exp((4*I)*Pi*x/T))^(1/2))-2*exp(-(2*I)*Pi*x/T)*arctan((-exp(-(4*I)*Pi*x/T))^(1/2))*(-exp((4*I)*Pi*x/T))^(1/2))/(Pi*(-exp((4*I)*Pi*x/T))^(1/2)*(-exp(-(4*I)*Pi*x/T))^(1/2))

(4)

'J__odd'=value(J__odd); # n::odd

J__odd = x+((1/4)*I)*T*(exp((2*I)*Pi*x*(n+1)/T)*LerchPhi(exp((4*I)*Pi*x/T), 1, (1/2)*n+1/2)-ln(1-exp(-(4*I)*Pi*x/T))+ln(-exp((4*I)*Pi*x/T)+1)-LerchPhi(exp(-(4*I)*Pi*x/T), 1, (1/2)*n+1/2)*exp(-(2*I)*Pi*x*(n+1)/T))/Pi

(5)

 

 

Download int.mw

It is not possible to use plots:-animate because HeatMap is implemented to display a background picture.
Explore can be used, but I am not sure whether it works in Maple 2016. In Maple 2017+ it's ok.

restart;
p := k -> Matrix(3, 3, (i,j) -> (i+j+k) mod 3):
f:=proc(k) Threads:-Sleep(0.2): Statistics:-HeatMap(p(k)) end:
Explore(  f(k), k=0..8, animate,loop, autorun);

 

When a variable is implicitely declared local, a warning message appears.
The rules for this are simple, see ?local

In

foo:= proc() 
  local x;
  plot(sin(x),x=-Pi..Pi); 
end proc:

local is indeed needed, otherwise x:=10  at top level will produce an error.

Alternatively you may use
plot(sin('x'),'x'=-Pi..Pi);

 

All the floating point computations are done with 1 significant digit. So, sqrt(5) is approximated to 2.  and  (2. -1.)/2.  is 0.5.

See also:

restart;
Digits:=1;
                          Digits := 1
a:=[seq(i/10., i=1..9)];
       a := [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
b:=[seq(i/10., i=9..1,-1)];
       b := [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1]
add(a) = add(b);
                            6. = 4.
evalf[2](add(a)) = evalf[2](add(b));
                           4.5 = 4.5

 

Maple (at least the recent versions) can compute directly the double integral (without passing to polar coordinates):

int(sqrt(x^2+y^2), x = 0 .. B/2, y = 0 .. b/2) assuming b>0, B>0;

S:=simplify(eval(SA/t, [x=y*t, Log[t]=1/L])):
collect(S,y, expand);

Now you have a polynomial in the variables (L,y) with rational coefficients and you want to guess its coefficients or a generating function. Why do you think that a simple generating function does exist? A more realistic approach would be to come back to the original problem (which produced the expression) and try there.

 

.

 

n >= ceil(fsolve(1/(n+1)! = 0.00001));
                             8 <= n
n >= ceil(fsolve(1/(n+1)! * exp(0.1) = 0.00001));
                             8 <= n

 

Seems to be a bug. Workaround:

ex:=D[2](eta)(t,x)+D[2](phi)(t,x,0)+D[1](phi)(t,x,0);

inds:=[indets(ex)[]]:  cinds:=map(convert, inds, Diff):
subs(inds=~cinds, ex);

with(Interpolation):

# I have chosen a more relevant f

points := [seq(x, x = 0 .. 9, 1.)];
data   := [seq(sin(x), x = 0 .. 9, 1.)];
f := Interpolate(points, data);

points := [0, 1., 2., 3., 4., 5., 6., 7., 8., 9.]

 

data := [0, .8414709848, .9092974268, .1411200081, -.7568024953, -.9589242747, -.2794154982, .6569865987, .9893582466, .4121184852]

 

_m685336448

(1)

f(Pi/2.); # OK works :).
 

HFloat(0.996827543241054)

(2)

plot(f, 0..9);

 

plot('fdiff(f(x), x=t)', t=0..9);

 

int(f, 0..3.14, numeric); # int(sin, 0..Pi) = 2

HFloat(1.9961813393496355)

(3)

 


 

Download Interpolate.mw

a:=sqrt(6)/6 + sin(5/6) + exp(6/7) + 567:

f := u ->  `/`(subs(6=b, [op(u)])[]):
subsindets(subs(6=b,a), fraction, f);

For non-numeric coefficients you may use
signum(lcoeff(expr));

@AliahNiu 

For such functions Maple cannot help much, we must use some maths.
You have two (possible) singularities at x=0 and x=Pi.
For the integral to exist near 0 a necessary and sufficient condition is  (a+1/2)*p+1-d < 0.
Near Pi the condition is (b+1/2)*p+1-d < 0.
So, the integral exists iff both conditions hold.

Note. Here the integral was considered a an improper Riemann one (in this case this being equivalent with Lebesgue integrability). If you want standard Riemann integrability (equivalent here with continuity) the conditions are similar but more restrictive, namely <= -1  instead of  < 0.

 

restart;

PDE := diff(u(x, y), x, x)+diff(u(x, y), y, y)-6*x*y*(1-y)-2*x^3; BCs := u(0, y) = 0, u(1, y) = y*(1-y), u(x, 0) = 0, u(x, 1) = 0;

diff(diff(u(x, y), x), x)+diff(diff(u(x, y), y), y)-6*x*y*(1-y)-2*x^3

 

u(0, y) = 0, u(1, y) = y*(1-y), u(x, 0) = 0, u(x, 1) = 0

(1)

sol:=rhs(pdsolve([PDE,BCs]));

Int(Sum(4*((-1)^n1-1)*(exp(2*Pi*x*n1)-1)*exp(-Pi*n1*(x-1))*sin(Pi*(-y+tau1)*n1)/(n1^3*Pi^3*(exp(2*n1*Pi)-1)), n1 = 1 .. infinity)+Sum(-4*sin(n*Pi*x)*(Int(-sin(n*Pi*x)*x*(-3*tau1^2+x^2+3*tau1), x = 0 .. 1))*(exp(Pi*n*(-y+tau1+2))-exp(Pi*(y-tau1)*n))/(exp(2*Pi*n)-1), n = 1 .. infinity), tau1 = 0 .. y)

(2)

 

Seems to be wrong:

 

 

s8:=eval(sol, infinity=8);

Int(Sum(4*((-1)^n1-1)*(exp(2*Pi*x*n1)-1)*exp(-Pi*n1*(x-1))*sin(Pi*(-y+tau1)*n1)/(n1^3*Pi^3*(exp(2*n1*Pi)-1)), n1 = 1 .. 8)+Sum(-4*sin(n*Pi*x)*(Int(-sin(n*Pi*x)*x*(-3*tau1^2+x^2+3*tau1), x = 0 .. 1))*(exp(Pi*n*(-y+tau1+2))-exp(Pi*(y-tau1)*n))/(exp(2*Pi*n)-1), n = 1 .. 8), tau1 = 0 .. y)

(3)

s81:=eval(s8,x=1);

Int(Sum(4*((-1)^n1-1)*sin(Pi*(-y+tau1)*n1)/(n1^3*Pi^3), n1 = 1 .. 8)+Sum(-4*sin(Pi*n)*(Int(-sin(n*Pi*x)*x*(-3*tau1^2+x^2+3*tau1), x = 0 .. 1))*(exp(Pi*n*(-y+tau1+2))-exp(Pi*(y-tau1)*n))/(exp(2*Pi*n)-1), n = 1 .. 8), tau1 = 0 .. y)

(4)

s81:=value(s81);

-(32/121550625)*(810000*cos(Pi*y)^7-639576*cos(Pi*y)^5+1236970*cos(Pi*y)^3+29416695*cos(Pi*y)-30824089)/Pi^4

(5)

plot([s81,y*(1-y)], y=0..1);

 

 

Download check-pde.mw

Edit. Actually for u() given by Maple it is easy to compute  u(1, 1/2)  = 1/12, so definitively wrong!

I'll choose the space for you.

u1 := (x, y)-> 1-exp(a*x)*cos(2*Pi*y):
u2 := (x, y)-> a*exp(a*x)*cos(2*Pi*y):
Norm2 := u -> int(u^2, 0..1,0..1)^(1/2):
simplify( Norm2(u2)/Norm2(u1) );

First 70 71 72 73 74 75 76 Last Page 72 of 120