Axel Vogt

5936 Reputation

20 Badges

20 years, 251 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are answers submitted by Axel Vogt

f[b] is neither a function (look up in the manual how to define them) nor does it contain any 'b'

note that Maple works with symbolics, so you may try  evalf( b_new) > evalf( b_old - 0.001) or similar
which gives sense to some 'break'

in harder cases you may want to look up 'fnormal' or checking signs of differences instead of > or <

the easiest: tell the user of your package to use that precision (if it makes sense)

the other:: just use that command on entering a proc within your package

or: use it as parameter

or: make it a global variable (not sure whether a good idea for packages)

@  lemelinm
I think you asked (in another thread) how to post by copy & paste. The easy way - which works in ASCII
groups as well: use a sheet in Classic Mode, copy input AND output (using the mouse to select, then copy)
paste the stuff and selct 'formatted' as format through editor's menu of this board. You may try it first
with a simple ASCII editor, the only difference to here is you have to select formating.
Strange formulation for homework at least for me and my Germish ...

So here you go: you need 'D', look up the help:

  D[1,1,2](g)(x,y): convert(%,diff);

                               3
                              d
                            ------ g(x, y)
                                 2
                            dy dx

Hence you should be able to understand: what is D, what is meant by the
'indexing sequence' in the brackets and how it translates to a common
notation.

Now you should be able to work with it for your task, where I suppose
that it is asked to reply by the result of D[........](f).


PS: you are supposed to add to your exercise you received help through
Maple Primes, be aware that lecturers may read here as well, so dont
be stupid.

PPS: please note that Maple uses commuting derivatives in that way,
so do not use it blindly.
taylor(F(x), x=0,10) = 1/5*x^5+1/21*x^7+2/135*x^9+O(x^11) and there are
two ways to use that up to first order: either substract or divide. 

It turns out, that divide is better (here):

  'f(x)/(x^5/5) - 1';
  my:=chebpade(%, x=0 .. 1/3, [4,4]); # at most degree = 8

  plot(f(x)-(my+1)*(x^5/5),x=0..0.2); # abs(error) < 1e-15


  f(0.1);
  eval((my+1)*(x^5/5), x=0.1);
                                          -5
                         0.200477661686 10
                                          -5
                         0.200477661688 10



Of course one could also use a Pade approximation instead of Taylor.
The documentation does not say much, indeed it is more a draft ...

Not so sure whether I would call the 'algebraic' Pade better. If
used as an approximation there is always a region where it becomes
useless.

The same for the Chebyshev-Pade approximation: the documentation
says "... is not specified then the interval -1..1 is understood",
so one would have to compare both of them on that interval.

Now plot([f(x)-chp, f(x)-p], x=-1 .. 1) shows the truth: close to
0 the pure Pade approximation is better, beyond 1/2 certainly not
and the error 'explodes'.

For the problem degree and Digits ... the error means, that degree
of numerator + denominator has to be less then 9 (for Digits=12).

As the function f (defined below Pi/2) increases here I would use
degree(numerator) > degree(denominator), the simpliest choice is
already good enough using chpp:=chebpade(f(x), x=0 .. 1/3, [5,4]),

with abs(error) <= 6e-13 (we have 12 Digits):   f(0.1);
  eval(chpp, x=0.1);
                                          -5
                         0.200477661686 10

                                          -5
                         0.200477699620 10


After having some coffee here is an answer to that: If you do L:= ... 
then it is evaluated, which is not what the procedure expects
  a:=1;
  assume(c,'constant');
  L := [a,b,c];
  map(getassumptions,L); getassumptions(c);

                                a := 1
                            L := [1, b, c]
                       [{}, {}, {c::constant}]

  MyReset(L); getassumptions(c); about(L);
                            {c::constant}

      L:
        nothing known about this object

However the following call works
  a:=1;
  assume(c,'constant'); getassumptions(c);
  MyReset([a,b,c]); getassumptions(c);
                                a := 1
                            {c::constant}
                                  {}

Yes, you must know the names ...
Once I was told "Pack the arguments into a list, declare it to be unevaluated, and then
map unassign over it: MyReset:= (L::uneval)-> map(unassign, L)[] "
Let us see what it does:
  f:=x->x^2; a:=1; b:=.99;
                                        2
                             f := x -> x
                                a := 1
                              b := 0.99

  MyReset([r,a,b,c,f]);

  r,a,b,c,f(t);

                           r, a, b, c, f(t)



how about a:='a' ?

to get better help you should say what is your function

even better: put your data into a worksheet - together with what you have done - and upload it, so others can see it.

using 14 Digits in Maple 11 i have no problems, however chebpade has larger approximation error in the plotted range

I think one should specify a range, chpp:=chebpade(f(x), x=0 .. 1/3, [5,5]) works quite well

just want to point out, that these days there was a quite similar task at the Maple NG, where the
poster was looking for the numerical value (but never said why)

groups.google.de/group/comp.soft-sys.math.maple/browse_thread/thread/b3710ca0dc842857/#

Using 'listtoalgeq' fails to propose a solution and 'listtodiffeq'
has difficulties with the initial conditions.

Recursion at least gives an answer, which however is not a solution:

  #with(gfun):
 
  L:=[seq(1/(n^2+1), n=1..10)];
  
  listtorec(L,u(n)); %[1]:
  rsolve(%,{u});
  op(%): evalc(%): simplify(%);

                 2            2
   [{(2 + 2 n + n ) u(n) + (-n  - 4 n - 5) u(n + 1), u(0) = 1/2}, ogf]


                                     1
                         u(n) = ------------
                                           2
                                2 + 2 n + n


Similar problems occure for K:=map ('x -> 1/x', L) and starting the
sequence in n=0 does not allow rsolve to find a solution.

So may be at http://www.research.att.com/~njas/sequences/ you can
find hints or literature (I think there is an off line version as
well).

The last I tried was 'Guess' and 'HyperG' - these older stuff from
Bruno Gauthier (based on a MMA solution by Krattenthaler) does not
work with Maple 11, it is said to be for Maple V (I filed that once
but never used it).

obviously you want a numerical solution and since finding code by 'exporting' from Maple does not I would search for decent code through the web, certainly there is some solid solution

PS: my impression is you already posted under different usernames - if so, you may want to re-think that

i know such things from (material) logistics, where coding on the (index) of databases is done through control breaks (? "Gruppenwechsel" in German), and if done on an index some provide the history (=frequency) - are you discussing some theoretic back grounds for this?

First 79 80 81 82 83 84 85 Last Page 81 of 93