vv

12453 Reputation

19 Badges

9 years, 285 days

MaplePrimes Activity


These are answers submitted by vv

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

Create in a folder e.g.  d:/temp   a file named eps.mpl   containing:

with(plots):
plotsetup(cps,plotoutput="d:/temp/ex.eps",plotoptions="portrait,noborder");
densityplot(x,x=0..1,y=-0..0.1,colorstyle=HUE,style=patchnogrid,scaling=constrained,view=[0..1,0..0.1],axes=none);
# plotsetup(default);

Now start the Command-line Maple and type

read "d:/temp/eps.mpl";

You will find the desired file "d:/temp/ex.eps"

P.S. This workaround uses the fact that the graphics 2D eps drivers for the "classic" Maple work, unlike the "standard" ones.
Unfortunately, for 3D, this does not work, the "classic" 3d drivers are wrong (at least in my computer).
I cannot understand why Maplesoft could not find a solution for this very old problem. When I need a 3d Vector graphics file, I have to  use Maxima because Maple cannot obtain a correct one.

 

 

I wrote this version a few days ago. It's af course similar to Carl's evalhf version, but >7 times faster due to compilation.
It is a pity that the compiler does not accept sub-procedures; we would have then a really useful tool to create fast numeric programs.

Sj:=proc(d::integer[8], j::integer[8])::float[8];
local k::integer[8], r::float[8],  
      x::integer[8],y::integer[8],n::integer[8], P::integer[8], u::integer[8], v::float[8];
option autocompile;
r:=0.0;
for k from 0 to d do
   n:=d-k; x:=16; y:=1; P:=8*k+j;
   if n = 0 then u:=1
   else
      while n > 1 do
         if type(n,even) then x := x^2 mod P; n := n/2;
         else  y := x*y mod P; x := x^2 mod P; n := (n-1)/2 fi;
      od;
      u:=x * y mod P
   fi;
   r:=r+u/evalf(8*k+j);
od;
r:=frac(r);
v:=1./16.;
for k to 14 do
  r:=r+v/evalhf(8*(k+d)+j);
  v:=v/16;
od;
frac(r);
end:

BBP:= proc(d::posint)
#d is the starting digit position. 9 hex digits will be printed
option hfloat;
local dm1:= d-1;
Digits:= trunc(evalhf(Digits)) + 3;
round(16^9*frac(4*Sj(dm1,1) - 2*Sj(dm1,4) - Sj(dm1,5) - Sj(dm1,6)+5));
nprintf("%09X",%); #convert(%,hex);
end proc:

BBP(1000000);
    
26C65EC54

 

You probably mean

Int((sin(theta)/cos(theta))^(2*p-1) * 2, theta=0..Pi/2) = Pi/sin(p*Pi); # 0 < p < 1
value(%);

Maple V should do it. If not, try a change of variables tan(theta) = t;  or sin(theta)=sqrt(t).

restart;
pde := 
[-(diff(u(x, t), t, t))-(diff(u(x, t), x, x))+u(x, t) = 2*exp(-t)*(x-(1/2)*x^2+(1/2)*t-1), 
u(x, 0) = x^2-2*x, 
u(x, 1) = u(x, 1/2)+((1/2)*x^2-x)*exp(-1)-((3/4)*x^2-(3/2)*x)*exp(-1/2), 
u(0, t) = 0
, D[1](u)(1,t) = 0
]:
pdsolve(pde);

It is strange that the (same) solution is obtained if the last condition is removed.

 

The result of the solve command is a Cylindrical Algebraic Decomposition (CAD) (google for this).
Actually solve calls SolveTools:-SemiAlgebraic (for polynomial inequalities & equalities over Q).
The order of the variables [x,y] or [y,x] is used for the type of the resulting cells. For two variables they are

{a <= x< =b, f(x) <= y <= g(x)}
or
{a <= y <= b, f(y) <= x <= g(y)}.  (or any <= replaced by < or =).

This is explained at ?SemiAlgebraic. See also ?RegularChains.

P.S. SolveTools:-Semialgebraic  is a very powerful command. Unfortunately it may be very slow. In your example it can solve the problem for a=parameter, resulting a large piecewise expression.

 

For the intersection of two lines geom3d tests whether the determinant of the system is 0.
In the case of floats, due to roundoff errors, a small real such as 1e-10  could appear instead of 0.

In principle, one cannot decide whether two lines in space intersect if the lines are known only approximatively; the distance between them could be e.g. 10^(-15).

restart;
f:=exp(-sec(t))*cos(t)/(-1/4+sin(t)^2):
g:=convert(series(f,t=Pi/6,3), polynom):
int(f-g, t = 0 .. Pi/2, numeric) + evalf(int(g, t = 0 .. Pi/2, CPV));

                         -0.6159737938

In my opinion Maple cannot be strictly separated from maths, so math questions should be OK (provided that Maple can/will be used for a solution).

First note that there is not such thing as "global inverse" of f, unless f (supposed to be C^1) is strictly monotonic.
If we know that f is strictly monotonic in [a,b], then its inverse will be
RootOf(f(x)-y, x, a..b),  where y is in the interval [min(f(a),f(b)), max(f(a),f(b))].

To find the intervals of monotonicity we need the real roots of f'(x). If solve is able to find all of them, we are done.
Of course the set of the roots could be infinite (even in a bounded interval). If a,b are two consecutive roots of f' then f is invertible (<==> strictly monotonic) in [a,b] as above.
 

 

 

f is continuous in R (provided that f(0) = 0), differentiable in R \ {0}, so, f ' (0) does not exist [and you must use the definition for this].

Please note that the inexistence of the limit of f ' (x) at x=0 is not the same with the non-differentiability of f at 0.

First 62 63 64 65 66 67 68 Last Page 64 of 111