vv

13837 Reputation

20 Badges

9 years, 321 days

MaplePrimes Activity


These are replies submitted by vv

@acer 

I also think that the "methods" associated to such objects should be better documented (with examples) for a user who is not necessarily interested in working with objects. It seems that all the new packages are implemented with objects; this is of course more flexible but the user will have problems to understand how exactly they work and what are the side effects.

@Carl Love 

sqrt(1+x^2)  is almost flat (≈ x) and the sine is nicer :-)

@Mariusz Iwaniuk

plot([f(x), 'fdiff(f(t), t = x)'], x = 0 .. 10);

 

@torabi 

Your ode seems to have some kind of logarithmic singularity at r=0.

For example:

a:=3.; b:=20.;
BCab:=
{ u(R0) = UB,
  D(u)(R0)= a,
  ((D@@2)(u))(R0) = -a/R0,
  ((D@@3)(u))(R0) = b
};
sola:=dsolve({f1, BCab[]}, numeric):
plots:-odeplot(sola, [r,u(r)], r=1e-15 ..1);

The problem is whether for some a,b  this singularity vanishes.

I think that you should try to study theoretically the problem (using e.g. some asymptotics, a change of variable etc) because numerically it will be probably difficult or unreliable.

@mmcdara 
The string approach is not "optimal" because  567 will be converted to 5b7 (nonsense).

 sqrt(b)/b = 1/sqrt(b)  is valid  for any complex (nonzero) b.

@Joe Riel 

But for a:=sqrt(6)/6 + sin(5/6) + exp(6/7);  more work is needed

You do not have a parallelipiped; you have two planes P1 and P2. If they were parallel, it would be possible to compute the distance between them. But P1, P2 are not parallel, so it's not clear what is the question.

@AliahNiu 

You can use Maple to check if an integral exists (i.e is finite in your case, being >0)  if you give numeric values
for parameters (a,b,p,d). Then use int(...)  or int(..., numeric).

@mmcdara 

It seems that pdsolve finds the correct solution of the Poisson equation for a rectangle
with 0 BCs. I have used this to find the correct solution of the initial problem.

[I hope to be correct, I did not check extensively].

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

 

@Carl Love 

type(n, even)  and a few other simple types are accepted by the compiler as documented at  ?compile

Your Frac is the mathematical fractional part, i.e. Frac(x) = x - floor(x).
Frac() is 1-periodic and Frac(x) = frac(x+n)  if n is integer and x+n >= 0. This simple fact was used;  Sj <1 so adding 4, the expression is >=0; I have added 5 just for safety.

Yes, the compiler does not accept nested procedures or already compiled procedures. So the only method to speed up the computations is to compile some simple critical procedures and then call them inside an evalf(...) or (better) in a procedure with option hfloat. But in our case this is not a solution because ModExp must be called too many times and the speed of a compiled procedure is lost. So, ModExp must be "integrated" inside SSj.

P.S. Just a side note. The compiled BBP(d) seems to give a correct first hex digit even for d=10^8.

Best regards,
V. A.
 

@nm 

This should be checked somehow.
It is odd that x is used as an integration variable (instead of x_ or similar).
I tried to compute a finite sum (with eval(..., infinity=6) and Maple is not able to find the integrals (it should, because they are simple).
It seems to me that the BCs are not verified, but I had not the patience to check by hand.

@dharr 

Summing from smallest to largest does not necessarily compensate the lost low-order bits.
KahanSum3.mw

 

@Carl Love 

Yes, your code is more general than Student[NumericalAnalysis]:-Quadrature which is implemented only for the weight function = 1. 
For example, it will work for   int((1-x)^(-15/16)*exp(sin(x)), x= 0. .. 1.);  Quadrature will give very poor results.

Change Norm2 to

Norm2 := proc (u) local x,y; int(u(x,y)^2, [x= -.5 .. 1.5, y=-.5 .. 1.5])^(1/2) end proc;

 

@Jaqr 

It should work in any OS. You must change the name "d:/temp/ex.eps" in the .mpl file.
Of course the resulting file could be not perfect. In Windows 7 it is OK.

First 90 91 92 93 94 95 96 Last Page 92 of 176