vv

12453 Reputation

19 Badges

10 years, 0 days

MaplePrimes Activity


These are replies submitted by vv

@Markiyan Hirnyk Of course, your politeness and tact seem to be hugely appreciated.

@ecterrab 

"%MeijerG() does not appear to be very inert"  because as you have used in the answer,

simplify( %MeijerG([[1/2], []], [[], []], z) );
    
exp(-1/z)/sqrt(z)

I thought that this should not happen without value but it seems that `simplify/inert`  is in action here.

It would be nice to have a consistent and documented behavior.

 

@_Maxim_ 

About the radius of convergence R. It was computed as the limit of

u:= n -> (-2^(2+2*n)*Zeta(-n)/n!)^(-1/n);

limit(u(n), n=infinity):  simplify(%);
    Pi/2
It is true that R = Pi/2  but the above limit does not exist!

In fact,
simplify(u(2*n)) assuming n::posint;
        0

(actually this is also false,  being  0 ^ (-1/(2*n)), so, rather infinity)

The correct computation for R would involve the absolute value (abs) and liminf instead of limit
(actually  1/limsup( |a_n|^(1/n) ).
(of course liminf, limsup do not exist in Maple).

It is absolutely strange how Maple knew that we want R and cheeted to give it to us!!!

 

It would be useful to know how exactly simplify acts when applied to an inert function, because this does not seem to be documented (only diff, expand and print are mentioned).

simplify(%sin(x+Pi));
                          %sin(x + Pi)
simplify(%sin(Pi));
                               0

%MeijerG() does not appear to be very inert!

 

@Mariusz Iwaniuk 

Unfortunately Maxima cannot expand tanh(x+1) at 0.

diff(f, $n) is very powerful in Maple, so convert/FPS can be easily made to work in these cases.

BTW, comparing the two expansions, the following identity appears:

which seems difficult to prove directly.

@asa12 

You should plot the series (t2) for a not too large interval; it will be much faster.

No, you did not. And a "thanks" is missing too.

Why don't you post the worksheet?

restart;

#f:=tanh(x);

f:=tanh(x+1);

tanh(x+1)

(1)

The truncated power series:

series(f, x=0, 5);evalf(%);

series(((exp(1))^2-1)/((exp(1))^2+1)+(4*(exp(1))^2/((exp(1))^2+1)^2)*x-(4*(exp(1))^2*((exp(1))^2-1)/((exp(1))^2+1)^3)*x^2+((8/3)*(exp(1))^2*((exp(1))^4-4*(exp(1))^2+1)/((exp(1))^2+1)^4)*x^3-((4/3)*(exp(1))^2*((exp(1))^6-11*(exp(1))^4+11*(exp(1))^2-1)/((exp(1))^2+1)^5)*x^4+O(x^5),x,5)

 

series(.7615941559+.4199743416*x-.3198500042*x^2+.1036044469*x^3+0.2771212690e-1*x^4+O(x^5),x,5)

(2)

You want formal power series.
The command to obtain the formal power series for tanh(x) is

convert(f, FPS);

Warning,  computation interrupted

 

Unfortunately it does not work.
But it can be computed using symbolic integer order derivatives

a:=eval(diff(f,x$n)/n!, x=0) assuming n>=1;

I*I^(n+1)*2^n*(-tanh(1)-1)*(Sum((-1)^_k1*factorial(_k1)*Stirling2(n, _k1)*(-tanh(1)+1)^_k1/2^_k1, _k1 = 0 .. n))*I^n/factorial(n)

(3)

ff:= eval(f,x=0) + sum(a*x^n, n=1..infinity);

tanh(1)+sum(I*I^(n+1)*2^n*(-tanh(1)-1)*(Sum((-1)^_k1*factorial(_k1)*Stirling2(n, _k1)*(-tanh(1)+1)^_k1/2^_k1, _k1 = 0 .. n))*I^n*x^n/factorial(n), n = 1 .. infinity)

(4)

# Check

simplify( series(value(ff),x,5) );evalf(%);

series(tanh(1)+(1/cosh(1)^2)*x-(sinh(1)/cosh(1)^3)*x^2+((1/3)*(2*cosh(1)^2-3)/cosh(1)^4)*x^3-((1/3)*(cosh(1)^2-3)*sinh(1)/cosh(1)^5)*x^4+O(x^5),x,5)

 

series(.7615941560+.4199743415*x-.3198500042*x^2+.1036044468*x^3+0.2771212683e-1*x^4+O(x^5),x,5)

(5)

# Numeric check

evalf( eval(f,x=1/2) = eval(ff,x=1/2) );

.9051482536 = .9051482537

(6)

 


Download tanh.mw

@asa12 

For f(x)=tanh(x+1) , f(0)  <> 0  sou you must add f(0) (or let n >= 0, n = 0 .. infinity).

@asa12 

Is "a" computed? AFAIK diff(f, x$n) exists in Maple 12.

assuming n>=1 is not necessary but the result is simpler, and n=0 is not useful as tanh(0)=0.

@Rouben Rostamian  

My point was that in our case the problem can be formulated and solved easily without differential inclusions.
(I do not reject the subject, I know something about it, I work in Convex Analysis).
Note also that a similar question may be asked for differential inclusions whenever the solution is not unique.

The solution of the ode has exactly x(0)=A, x'(0)=0. We are looking for x() having the stationary points isolated, so x'(0)=0 can be replaced by limit(x'(t), t=0) = 0. It is not unusual for an ode defined in an open interval to have conditions at the endpoints.

@Rouben Rostamian  

But in this particular case, the classical ode has a C^1 solution which is C^2 except a finite set of points (in a bounded interval).
This solution obviously satisfies the differential inclusion.

@Preben Alsholm 

The formula

sol:=(A-n*C)*cos(omega*t)+(-1)^n*C/2;

is valid only for t < tmax = A*Pi*sqrt(k/m)/(2*mu*g)

because after that   A - nC  becomes <0.
That is why the graph obtained by dsolve is different from sol for t>tmax.

Another interesting thing. sol is only an approximation! A rather good one.
It is possible to compute the exact solution but this will be of the form

A(t)*cos(omega*t + alpha(t)) + S(t)  where A(t), alpha(t) , S(t) are locally (piecewise) constant.

I like this problem!   :-)

Edit. I was intrigued and I have computed by hand the solution. sol is correct (i.e. alpha(t)=0), it is dsolve which makes the difference (for t<tmax of course).

 

 

@Preben Alsholm 

The following graph (yours) includes (-1)^n in red. It is obvious now that the ode refers to signum(x') not signum(x'');

First 99 100 101 102 103 104 105 Last Page 101 of 166