computing the iterated exp(x)-1
#12
Hi, this is actuallly in reference to jaydfox's posts about Sage and the like. I rewrote the Mathematica code for the custom IDM method, and it works better than what you would usually do in Sage to get the same result, but it still not as fast as Mathematica (which doesn't surprise me, given that most of the work is being done behind the scenes by Maxima, which Sage gives a front-end to). So jaydfox, I would also like to correct you on your PARI vs. Sage question. Sage provides a front-end for PARI as well, so it's not a question of which is better. Its like saying "ROM vs. Computer" which is better? obviously they're not quite comparable.

Anyways, without further delay I suppose I should give you the Sage code:

Code:
# Define the custom IDM:
def parabolic_idm(expr, x, size):
  ret = []
  ser = x
  for i in xrange(size):
    ser = taylor(ser(expr), x, 0, size)
    cof = ser.coeffs(x)
    ret.append([0] + [cof[int(k)][0] for k in xrange(len(cof))])
  top = [0, 1] + [0 for i in xrange(size-1)]
  return [top] + ret

# Get the flow from custom IDM:
def parabolic_flow_coeff(idm_matrix, t):
  size = len(idm_matrix) - 1
  ret = [sum([(-1)^(n-k-1)*idm_matrix[k][n]*
    binomial(t, k)*binomial(t-k-1, n-k-1)
    for k in xrange(n)]) for n in xrange(size)]
  return ret

# Get just the coefficients of (x,t):
def parabolic_flow_matrix(flow_coeff, t):
  size = len(flow_coeff)
  ret = []
  for i in xrange(size):
    if (i < 2):
      ret.append([flow_coeff[i]])
    else:
      cof = flow_coeff[i].expand().coeffs(t)
      ret.append([0] + [cof[int(k)][0] for k in xrange(len(cof))])
  return ret

# Use the custom IDM:
from sage.calculus.calculus import SymbolicVariable
x = SymbolicVariable('x')
t = SymbolicVariable('t')
size = 20
mtx = parabolic_idm(exp(x)-1, x, size)
fco = parabolic_flow_coeff(mtx, t)
fma = parabolic_flow_matrix(fco, t)

The only way I can see making this even faster is to implement it in Maxima directly, since thats the CAS that Sage uses behind the scenes to calculate this kind of thing. Maybe my next post will include a Maxima version. For more information on the CASs that Sage uses, see http://sagemath.org.

Andrew Robbins
Reply


Messages In This Thread
computing the iterated exp(x)-1 - by Daniel - 08/13/2007, 10:47 PM
RE: computing the iterated exp(x)-1 - by andydude - 08/16/2007, 01:28 AM
RE: computing the iterated exp(x)-1 - by jaydfox - 08/16/2007, 06:51 AM
RE: computing the iterated exp(x)-1 - by bo198214 - 08/16/2007, 07:48 AM
RE: computing the iterated exp(x)-1 - by andydude - 08/17/2007, 08:44 PM
RE: Iterability of exp(x)-1 - by bo198214 - 08/13/2007, 10:50 PM
RE: Iterability of exp(x)-1 - by Daniel - 08/14/2007, 06:51 PM
RE: Iterability of exp(x)-1 - by jaydfox - 08/14/2007, 01:01 AM
RE: Iterability of exp(x)-1 - by Gottfried - 08/14/2007, 12:45 PM
RE: Iterability of exp(x)-1 - by bo198214 - 08/14/2007, 04:11 PM
RE: Iterability of exp(x)-1 - by Gottfried - 08/14/2007, 04:35 PM
RE: Iterability of exp(x)-1 - by jaydfox - 08/14/2007, 02:42 AM
RE: Iterability of exp(x)-1 - by Gottfried - 08/14/2007, 03:08 AM
RE: Iterability of exp(x)-1 - by jaydfox - 08/14/2007, 05:09 AM
RE: Iterability of exp(x)-1 - by Gottfried - 08/14/2007, 05:09 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  4 hypothesis about iterated functions Shanghai46 11 13,146 04/22/2023, 08:22 PM
Last Post: Shanghai46
  Question about the properties of iterated functions Shanghai46 9 11,484 04/21/2023, 09:07 PM
Last Post: Shanghai46
  Computing sqrt 2 with rational functions. tommy1729 0 2,349 03/31/2023, 11:49 AM
Last Post: tommy1729
  [MSE] iterated sin using Besselfunction 1st kind Gottfried 7 8,908 12/18/2022, 02:06 PM
Last Post: Gottfried
  Iterated function convergence Daniel 1 4,086 12/18/2022, 01:40 AM
Last Post: JmsNxn
  Uniqueness of fractionally iterated functions Daniel 7 11,097 07/05/2022, 01:21 AM
Last Post: JmsNxn
Question Iterated Hyperbolic Sine and Iterated Natural Logarithm Catullus 2 4,861 06/11/2022, 11:58 AM
Last Post: tommy1729
  Generalized Kneser superfunction trick (the iterated limit definition) MphLee 25 43,765 05/26/2021, 11:55 PM
Last Post: MphLee
  iterated derivation Xorter 0 4,362 06/09/2019, 09:43 PM
Last Post: Xorter
  1st iterated derivatives and the tetration of 0 Xorter 0 5,706 05/12/2018, 12:34 PM
Last Post: Xorter



Users browsing this thread: 3 Guest(s)