Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

As explained to me here, one can plot iterations of a point "b" in A under the functions f:A -> A. Is it also possible to plot the entire function iterated, meaning given a function "f", is it possible to plot f composed with f; or f composed m times with itself ?

share|improve this question
3  
As mentioned in the comments of your earlier question, you should show what you have tried so far, preferably as a a fully compilable MWE –  Peter Grill Apr 1 '12 at 14:59

1 Answer 1

up vote 2 down vote accepted

I'm not sure if I understand correctly the question but a possibility is below. I give you two different ways but for f composed m times with itself I think it's not possible. Perhaps a TeX's wizard can find a solution but I'm very sceptic. Perhaps you can provide further informations so that we can give you a better solution.

\documentclass[11pt]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{ arrows, calc}

\begin{document}
\begin{tikzpicture}[scale=10,
                    declare function={f(\t)=(exp(\t)-1)/(exp(1)-1);},
                    declare function={f2(\t)=f(f(\t)));},
                    declare function={f3(\t)=f(f(f(\t))));}]
  \draw [help lines,step=.2] (0,0) grid (1,1);
  \draw[->] (-0.2,0) -- (1.2,0) node[right] {$x$};
  \draw[->] (0,-0.2) -- (0,1.2) node[above] {$y$};
  \draw [blue, 
         thick]
            plot [domain=0:1, samples=100, smooth] (\x,{f(\x)}); 
   \draw [red, 
          thick]
            plot [domain=0:1, samples=100, smooth] (\x,{f2(\x)});
   \draw [green, 
          thick]
            plot [domain=0:1, samples=100, smooth] (\x,{f3(\x)});  
\end{tikzpicture} 

\begin{tikzpicture}[scale=10,
                    declare function={f(\t)=(exp(\t)-1)/(exp(1)-1);},
                    declare function={g(\t,\n)= equal(2,\n) ? f(f(\t)) : f(f(f(\t)));}
                    ]
  \draw [help lines,step=.2] (0,0) grid (1,1);
  \draw[->] (-0.2,0) -- (1.2,0) node[right] {$x$};
  \draw[->] (0,-0.2) -- (0,1.2) node[above] {$y$};
  \draw [blue, 
         thick]
            plot [domain=0:1, samples=100, smooth] (\x,{f(\x)}); 
   \draw [red, 
          thick]
            plot [domain=0:1, samples=100, smooth] (\x,{g(\x,2)});
   \draw [green, 
          thick]
            plot [domain=0:1, samples=100, smooth] (\x,{g(\x,3)});   
\end{tikzpicture}  

\end{document} 

enter image description here

Function involutive fof =Id

\begin{tikzpicture}[scale=2,
                    declare function={f(\t)=1/(\t-1)+1;},
                    declare function={f2(\t)=f(f(\t)));}]
  \draw [help lines] (0,0) grid (5,5);
  \draw[->] (-0.2,0) -- (5.2,0) node[right] {$x$};
  \draw[->] (0,-0.2) -- (0,5.2) node[above] {$y$};
  \draw [blue, 
         thick]
            plot [domain=1.3:5, samples=100, smooth] (\x,{f(\x)}); 
   \draw [red, 
          thick]
            plot [domain=1.3:5, samples=100, smooth] (\x,{f2(\x)}); 
\end{tikzpicture}  

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.