Axel Vogt

5821 Reputation

20 Badges

20 years, 227 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are answers submitted by Axel Vogt

> J:=Int((1/(2*pi) + cos(k*phi)), phi=-Pi..Pi): lprint(%);
Int(1/2/pi+cos(k*phi),phi = -Pi .. Pi)

> t1:=value(J); lprint(%);

                           Pi k + 2 sin(Pi k) pi
                     t1 := ---------------------
                                   pi k

(Pi*k+2*sin(Pi*k)*pi)/pi/k

> t2:=value(J) assuming k::integer; lprint(%);

                                     Pi
                              t2 := ----
                                     pi

1/pi*Pi

> eval(J, pi=Pi);
> t3:=value(%) assuming k::integer;

                        Pi
                       /
                      |     1
                      |    ---- + cos(k phi) dphi
                      |    2 Pi
                     /
                       -Pi


                               t3 := 1

x+s*exp(x * sigma)-mu-s=0: 
solve(%, x):
simplify(%, size): collect(%, LambertW);
 
             LambertW(sigma s exp(sigma (mu + s)))
           - ------------------------------------- + mu + s
                             sigma
subs(mu=6, s=-1, %):    # example data
plot( [Re(%), Im(%)], sigma = -1 ..1);

 

However I am not sure, whether this solution is complete
and holds without considering 'branches', better you will
check it.

MP_minimal_root_fra.mws

just a (somewhat brute) snippet, not a proof (but not by [very] brute force)

In your case that is 2F2 and 3F2, I use that as 

  hypergeom([a, b, c], [e, f], x);
  convert(%, Sum, dummy=k) assuming abs(x) < 1;

Look at x=1 for a special case:

  hypergeom([1, 1, 1], [1, 1], x);
  convert(%, Sum, dummy=k) assuming abs(x) < 1;
  simplify(%);

                             infinity
                              -----
                               \       k
                                )     x
                               /
                              -----
                              k = 0

which is not convergent for x=1.

Look at the help ?hypergeom, it has an explanation:

When p <= q, this series converges for all complex z,
  and hence defines F(n, d, z) everywhere.

When p = q+1, the series converges for |z| < 1.
  F(n, d, z) is then defined for |z| >= 1 by analytic continuation.
  The point z=1 is a branch point, and
  the interval (1,infinity) is the branch cut.

When p > q+1 the series diverges for all z <> 0.

concerning http://www.mapleprimes.com/view.aspx?sf=101754/319860/stenlaN.mw
that file is empty (i.e. all values are hex 0)

Played with it without succes. And today tried again with more motivation:

  restart; interface(version);
    Classic Worksheet Interface, Maple 12.02, Windows, Dec 10 2008 Build ID 377066

  with(gfun): gfun:-version();
                                 3.19

  z:=arctan(1/(5^(1/2)-1)*(10+2*5^(1/2))^(1/2)); #evalf(%); identify(%);
  t:=tan(%); # the inverse, z = tan(t)

  # now hope to find an equation and that it can be handled

  0=algfuntoalgeq(t,y(x));
                                     2    4
                          0 = 5 - 10 y  + y

  [solve(%, y)];

            1/2 1/2          1/2 1/2           1/2 1/2
  [-(5 - 2 5   )   , (5 - 2 5   )   , -(5 + 2 5   )   ,

  map(arctan,%);

                         Pi    Pi     2 Pi  2 Pi
                     [- ----, ----, - ----, ----]
                         5     5       5     5

So far we have used *exact* computations (with some risk for the correct
range of tan ° arctan = id, but much better then mere 'identify') and now
numerical evaluation shows the right choice.

Not as cool as the other one shown, but why not ...

Jimmy,

It would depend on your actual needs, why you think that something
better has to be used and what you are willing to pay in terms of
effort and time - compared to what you possibly can have with less
investment, but only 99% of a result.

There are some high precision numerical libraries, especially QD
by Bailey or other - already Pari has very fast numerics and can
be 'limked' to Maple. Or MPFR (Maple seems to use it partially,
but seems to be unwilling to un-disclose it for direct use).

I do not know the latest state, but Rump et al may be a start and
Zimmermann and its 'school'. If needed then I can look it up, but
it rarely comes with code ready to use (except the libs, which have
to be set up, may be not trivial to do that - never did it).

Find appended some older test with Kahan, up to some 100000 entries
it should do a realy good job. It is only a simple test done in it,
but try such stuff first, because it is simple to use.

Axel

KahanSummation.mws

Enter into a classic sheet.

Using the mouse click on the 1st bracket after 'arctan'

That marks the whole expression.

Copy to clip board.

Go to a new section and paste.

That will insert arctan(X,Y)

Now immediately say:

A:=%;
x:=op(1,A);
y:=op(2,A);

Quite lame, yes. But: done.

I de-activated that sorting,
removed 'triangular' as shape,
and inserted print commands, to see the Arrays
(after convert to lists, like print(convert(convert(BigSLTArray, Matrix), listlist))

This looks strange (so I am not sure, whether it comes from 2D) and I can
not see, how I would sort that.

Also I used the following (signum is faster than '<=', I think)

_Envsignum0:=0;
LT:=proc(a,b)
# is( abs(a) <= abs(b))
  (signum(abs(a)-abs(b)) <= 0);
  evalb(%);
end proc;

In your case the result however is fail, which would explain the error message.

The reason should be that the Array is not as one expects (but have not looked
closer, because of 2D, see my 'PS'), i.e. seems not to consist of Reals.

Just some idea:

There is some re-dimension statement to make stuff 1-dim, it only re-organizes
the view to the memory and thus is very fast - so you would not need to loop.

And somehow I have the impression, that you only want to sort to reduce errors
in summation, no? That would improve, but not prevent. I would consider to write
a coded & compiled routine (double precision) which uses Kahan's summation
(there are certainly better ones, but it already may do).

PS: indeed I do not like 2D sheets, for me they are so tedious to handle, so much
time consuming ... and almost never convert to a reasonable style when exporting ...
one can not even simply copy from such a sheet to post snippets ... what a mess

Int(cos(k*theta), theta=-Pi..Pi);
value(%);
simplify(%) assuming k::posint;

                             2 sin(Pi k)
                             -----------
                                  k

                                  0
In case you also have k=0 it would need some care.

Excel only displays in a time format, but the values are floats
and that is what will be imported.

You have to 'reformat' it: 0.0 in Excel is 01. Jan. 1900, 0:00:00.
The integer part is the number of days from there, the fractional
part are the 'hours' within a 24h day (Excel cares for leap years).

@hirnyk 

It is astonishing, that Maple finds a numerical answer on the positive axis!

But I think your c can not stand for the negative axis being purely real.

There must be imaginary parts:

cos(100*x^4-100*x^(13/11));
evalc(%) assuming x < 0;
[Re(%), Im(%)]:
plot(%, x= -1/2 .. 0);

This is of the form cos(X)*cosh(T(x)) - sin(X)*sinh(T(x))*I
and for me it even looks as if cosh and sinh ---> infinity while the
cos and sin run over the full +-1, so the integral can not converge.

Please help me ... where I am wrong

Not my 1st attempt ... and after having some distance to the task I think
some proper way *may* be to use saddle-point methods (but I am not very
used to them [and guess, that a 'mechanical' application of recipes will
not be enough]) or highly oscillating integrals (looked into such in past
and could refresh, but feel uncomfortable by the increasing magnitude on
the left axis).

But at least the positive axis seems to be capable with Maple by brute
force (with some tweaks), see appened sheet.

For the negative axis the system refuses to work, no idea why ...

NB: thank you for sketching convergence (though I trust you enough to have
not checked it in detail ...)

A15_2nd_positive_axi.mws
Download A15_2nd_positive_axi.mws

I am too blind to see it (the infinite ones, of course) ...

PS: your arnold#15.mw can not be downloaded - may be the # causes problems?

@Robert:

Hm ... "specialization problem" ... may be it is drifting off the initial topic a bit
and may be worth its own thread:


But how to deal with it as user? Being more or less familiar (missing the correct
word) with Maple for some years I still stumble into such things (and 'stumble'
then means 'unexpected', of course) ...

For example 'invertible' or 'non-singular' is generic. But many interesting things
are born just in the non-generic case.

Do you have any 'recipe' how to take care (besides the obvous ones), a kind of
style & attitude?

First 44 45 46 47 48 49 50 Last Page 46 of 92