Difference between revisions of "Nest"

From TORI
Jump to: navigation, search
(Bug)
m (Text replacement - "\$([^\$]+)\$" to "\\(\1\\)")
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
'''Nest''' is name of function in the [[Mathematica]] software, that evaluates iterations of a function.
 
'''Nest''' is name of function in the [[Mathematica]] software, that evaluates iterations of a function.
 
The call of this function has form
 
The call of this function has form
:$\mathrm{Nest}[f,z,c]$
+
:\(\mathrm{Nest}[f,z,c]\)
where $f$ is name of iterated function, $z$ is initial value of the argument, and $c$ is number of iterations.
+
where \(f\) is name of iterated function, \(z\) is initial value of the argument, and \(c\) is number of iterations.
Up to year 2011, the implementation has serious restrictions.
+
Up to year 2013, the implementation has serious restrictions.
   
 
==Iteration of functions==
 
==Iteration of functions==
The $c$th iteration of some function $f$ can be expressed through the [[superfunction]] $F$ and the [[Abel function]] $G=F^{-1}$:
+
The \(c\)th iteration of some function \(f\) can be expressed through the [[superfunction]] \(F\) and the [[Abel function]] \(G=F^{-1}\):
:$ f^c(z)=F(c+G(z))$
+
:\( f^c(z)=F(c+G(z))\)
 
In [[Mathematica]], the operation, that could evaluate such a expression, is called [[Nest]]
 
In [[Mathematica]], the operation, that could evaluate such a expression, is called [[Nest]]
 
<ref name="nest">
 
<ref name="nest">
Line 19: Line 19:
 
The third (and last) argument indicates the number of iterations.
 
The third (and last) argument indicates the number of iterations.
   
Then, the $c$th iteration of function $f$ can be written as $ f^c(z)=\mathrm {Nest}[f,z,c]$.
+
Then, the \(c\)th iteration of function \(f\) can be written as \( f^c(z)=\mathrm {Nest}[f,z,c]\).
   
 
==Restriction==
 
==Restriction==
For year 2013, the implementation of the [[Nest]] has serious defect: the number of iterations should allow the simplification to an integer constant. The intents to call function [[Nest]] with any other expression as the last argument cause the error messages. One may hope, in the future versions of Mathematica this bug will be corrected.
+
For year 2013, the implementation of the [[Nest]] has serious defect: the number of iterations should allow the simplification to an integer constant. The intents to call function [[Nest]] with any other expression as the last argument cause the error messages. One may hope, in the future versions of Mathematica this defect will be corrected.
   
 
==Examples==
 
==Examples==
 
With function Nest, the [[tetration]] could be expressed as follows:
 
With function Nest, the [[tetration]] could be expressed as follows:
:$\mathrm{tet}(z)=\mathrm{Nest}[\exp,0,z]$
+
:\(\mathrm{tet}(z)=\mathrm{Nest}[\exp,0,z]\)
   
The [[square root of factorial]] could be expressed as
+
[[Iteration of exponential]] could be expressed with
:$\sqrt{!\,}(z)=\mathrm{Nest}[\mathrm{Factorial},z,1/2]$
+
: \(\exp^n(z)=\mathrm{Nest}[\exp,z,n]\)
   
  +
The [[square root of factorial]], that is used as [logo]] of the Physics department of the Moscow State University, could be expressed as
Due to the restriction mentioned, yet, such representation cannot be used even to plot graphics of these functions.
 
  +
:\(\sqrt{!\,}(z)=\mathrm{Nest}[\mathrm{Factorial},z,1/2]\)
   
  +
Due to the restriction mentioned, yet, such representation cannot be used even to plot graphics of these functions for non-integer number of iterates.
However, in the trivial case, the expression $~\mathrm{Nest}[\sin,z,2]~$ returns $~\sin(\sin(z))~$.
 
  +
  +
However, in the trivial case, while the number of iteration can be simplified to positive integer constant, the built-in function Nest is usable; for example, expression \(~\mathrm{Nest}[\sin,z,2]~\) returns \(~\sin(\sin(z))~\).
   
 
==Table of superfunctions==
 
==Table of superfunctions==

Latest revision as of 18:25, 30 July 2019

Nest is name of function in the Mathematica software, that evaluates iterations of a function. The call of this function has form

\(\mathrm{Nest}[f,z,c]\)

where \(f\) is name of iterated function, \(z\) is initial value of the argument, and \(c\) is number of iterations. Up to year 2013, the implementation has serious restrictions.

Iteration of functions

The \(c\)th iteration of some function \(f\) can be expressed through the superfunction \(F\) and the Abel function \(G=F^{-1}\):

\( f^c(z)=F(c+G(z))\)

In Mathematica, the operation, that could evaluate such a expression, is called Nest [1]. This function has 3 arguments:

The first argument indicates the name of the function.

The second argument indicates the initial value.

The third (and last) argument indicates the number of iterations.

Then, the \(c\)th iteration of function \(f\) can be written as \( f^c(z)=\mathrm {Nest}[f,z,c]\).

Restriction

For year 2013, the implementation of the Nest has serious defect: the number of iterations should allow the simplification to an integer constant. The intents to call function Nest with any other expression as the last argument cause the error messages. One may hope, in the future versions of Mathematica this defect will be corrected.

Examples

With function Nest, the tetration could be expressed as follows:

\(\mathrm{tet}(z)=\mathrm{Nest}[\exp,0,z]\)

Iteration of exponential could be expressed with

\(\exp^n(z)=\mathrm{Nest}[\exp,z,n]\)

The square root of factorial, that is used as [logo]] of the Physics department of the Moscow State University, could be expressed as

\(\sqrt{!\,}(z)=\mathrm{Nest}[\mathrm{Factorial},z,1/2]\)

Due to the restriction mentioned, yet, such representation cannot be used even to plot graphics of these functions for non-integer number of iterates.

However, in the trivial case, while the number of iteration can be simplified to positive integer constant, the built-in function Nest is usable; for example, expression \(~\mathrm{Nest}[\sin,z,2]~\) returns \(~\sin(\sin(z))~\).

Table of superfunctions

The table of known superfunctions and the corresponding Abel functions (similar to that suggested in [2]) could be loaded in Mathematica in a manned similar to that the table of integrals is loaded. This would allow the correct implementation of Nest for the case of non–integer number of iterations.

References

  1. http://reference.wolfram.com/mathematica/ref/Nest.html
  2. http://www.ils.uec.ac.jp/~dima/PAPERS/2009supefae.pdf D.Kouznetsov, H.Trappmann. Superfunctions and square root of factorial. Moscow University Physics Bulletin, 2010, v.65, No.1, p.6-12.