Axel Vogt

5936 Reputation

20 Badges

20 years, 260 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are replies submitted by Axel Vogt

After writing with rational coefficients (as shown above and replacing your r[m] by rm ) use

  'Int((3*polylog(5/2, -exp(b*(u-i)))/b^(5/2)+i*polylog(3/2, -exp(b*(u-i)))/b^(3/2))*r^2, r = 0. .. 10.)';
  J:=  convert(%, rational);
  K:='op(J)[1]';

  with(codegen);

  makeproc(K,r):
  KK:=optimize(%, 'tryhard');

  'Int( KK(r) , r=0.6 .. 10, method = _d01akc, digits=8)'; evalf(%);
                          -29212827.

  'Int( KK(r) , r=0.02 .. 0.6, method = _d01akc, digits=8)'; evalf(%);
                          -12310566.

where I always work with Digits:=14.

This leaves a small range where your input b*(u-i) for the exp behaves bad. I would look at
it closer to split again and towards zero would either try to approximate or switch to 1/r
or log: b*(u-i) tends to infinity (plot it). So you actually work with asymptotics for the
polylogs at -infinity. Maple seems not to know a way for that (may be there is none). Also
note that in r=0 you have a singularity for b*(u-i) (try from left and right).

Perhaps you have to dig deeper for a method (have no better response ... have not tried for
exp(b*(u-i))) and small r, you can try to apply exp to

b*(u-i): MultiSeries:-series(%, r=0): convert(%, polynom): evalf(%): convert(%, rational);

For short: you problem is the singularity in zero (and slow polylog).
After writing with rational coefficients (as shown above and replacing your r[m] by rm ) use

  'Int((3*polylog(5/2, -exp(b*(u-i)))/b^(5/2)+i*polylog(3/2, -exp(b*(u-i)))/b^(3/2))*r^2, r = 0. .. 10.)';
  J:=  convert(%, rational);
  K:='op(J)[1]';

  with(codegen);

  makeproc(K,r):
  KK:=optimize(%, 'tryhard');

  'Int( KK(r) , r=0.6 .. 10, method = _d01akc, digits=8)'; evalf(%);
                          -29212827.

  'Int( KK(r) , r=0.02 .. 0.6, method = _d01akc, digits=8)'; evalf(%);
                          -12310566.

where I always work with Digits:=14.

This leaves a small range where your input b*(u-i) for the exp behaves bad. I would look at
it closer to split again and towards zero would either try to approximate or switch to 1/r
or log: b*(u-i) tends to infinity (plot it). So you actually work with asymptotics for the
polylogs at -infinity. Maple seems not to know a way for that (may be there is none). Also
note that in r=0 you have a singularity for b*(u-i) (try from left and right).

Perhaps you have to dig deeper for a method (have no better response ... have not tried for
exp(b*(u-i))) and small r, you can try to apply exp to

b*(u-i): MultiSeries:-series(%, r=0): convert(%, polynom): evalf(%): convert(%, rational);

For short: you problem is the singularity in zero (and slow polylog).

May be there is no simple expression (do you have any reason why there should be one?) and if you just abbreviate the Sums by some short symbol, say R, it is not that large.

             8                                                      
           -----                                                    
            \                                          
             )         /  2    2   6     8            \
            /    RootOf\-B  + A  _Z  + _Z , index = _a/
           -----                                                    
          _a = 1                                      

just means to sum over the 8 roots of the equation, you can shorten it by defining a symbol R, if you prefer.

May be there is no simple expression (do you have any reason why there should be one?) and if you just abbreviate the Sums by some short symbol, say R, it is not that large.

             8                                                      
           -----                                                    
            \                                          
             )         /  2    2   6     8            \
            /    RootOf\-B  + A  _Z  + _Z , index = _a/
           -----                                                    
          _a = 1                                      

just means to sum over the 8 roots of the equation, you can shorten it by defining a symbol R, if you prefer.

~ 21:24 CET

All roots? ... no chance ... except you are willing to search the set of all representations in a brute way (of course approximate zeros are meant).

For me the most simple functions are of polynomial type, univariate. And already for those it is more than non-trivial to have reliable and robust algorithm which works in variable precision, or just for usual double precision. But Maple can do it, I think that is based on Sturm's theorem. I would have to dig for citations or literature (not sure whether one first has to find all complex roots).

Now there are 2 obvious generalizations of polynomial, fractions of them (rationals, the quotient field) - for which it is clear from the above.

And (formal) power series and evaluating those in numbers and even if one restricts to 'the' elementary functions (covering those examples in the post) I would be astonished, if a practical algorithm exists (actually I do not even know whether one can prove such theoretical existence):

Certainly one first would have to decide whether there are only finitely many zeros (and the exact number) or more of them. Or none. Even if restricting to those function being analytic in the whole complex plane I see no reason why one should expect that (besides the condition 'real zero').

I doubt that something like the zero-counting integral will help in general. And Picard's theorem would not as well, because of numerical issues (say you find 'no zeros' numerical for a disturbed question and conclude 'then it takes any value' that may be false due to precision).

It simply is a wish, which is too optimistic beyond special cases (which Maple may do or is too weak).

 

All roots? ... no chance ... except you are willing to search the set of all representations in a brute way (of course approximate zeros are meant).

For me the most simple functions are of polynomial type, univariate. And already for those it is more than non-trivial to have reliable and robust algorithm which works in variable precision, or just for usual double precision. But Maple can do it, I think that is based on Sturm's theorem. I would have to dig for citations or literature (not sure whether one first has to find all complex roots).

Now there are 2 obvious generalizations of polynomial, fractions of them (rationals, the quotient field) - for which it is clear from the above.

And (formal) power series and evaluating those in numbers and even if one restricts to 'the' elementary functions (covering those examples in the post) I would be astonished, if a practical algorithm exists (actually I do not even know whether one can prove such theoretical existence):

Certainly one first would have to decide whether there are only finitely many zeros (and the exact number) or more of them. Or none. Even if restricting to those function being analytic in the whole complex plane I see no reason why one should expect that (besides the condition 'real zero').

I doubt that something like the zero-counting integral will help in general. And Picard's theorem would not as well, because of numerical issues (say you find 'no zeros' numerical for a disturbed question and conclude 'then it takes any value' that may be false due to precision).

It simply is a wish, which is too optimistic beyond special cases (which Maple may do or is too weak).

 

which is not too difficult, since cos is between +-1

BTW: I still do not understand, what is the reason for the original question, neither in this thread nor in the related one.

which is not too difficult, since cos is between +-1

BTW: I still do not understand, what is the reason for the original question, neither in this thread nor in the related one.

besides 'avoid' one (here) can use Maple to solve for an un-equality to find the search range:

x^2/20-10*x<=15; [solve(%, x)]; evalf(%);

                                   1/2              1/2
            [RealRange(100 - 10 103   , 100 + 10 103   )]
which is ~ -2 ... +202

besides 'avoid' one (here) can use Maple to solve for an un-equality to find the search range:

x^2/20-10*x<=15; [solve(%, x)]; evalf(%);

                                   1/2              1/2
            [RealRange(100 - 10 103   , 100 + 10 103   )]
which is ~ -2 ... +202

I never tried Notepad++, notepad-plus.sourceforge.net/uk/site.htm, just use it to view C or C++ files.

May be one can set it up for Maple's syntax.

However using an editor I would have the wish of accessing Maple's help, but probably one can not expect to have all-in-one for free.

I never tried Notepad++, notepad-plus.sourceforge.net/uk/site.htm, just use it to view C or C++ files.

May be one can set it up for Maple's syntax.

However using an editor I would have the wish of accessing Maple's help, but probably one can not expect to have all-in-one for free.

I hate the 'Standard', since it is only for type setting, not for working and invites to commit errors.

To go back to one of your suggestions: evalf(...) / 1.0 should do ...

BTW: the commended way is evalf[n](expression), not evalf(expression, n)

First 154 155 156 157 158 159 160 Last Page 156 of 209