Difference between revisions of "File:TaniaPlot.png"

From TORI
Jump to: navigation, search
(Importing image file)
 
 
Line 1: Line 1:
  +
Explicit plot of the [[Tania function]], $y=\mathrm{Tania}(x)$.
Importing image file
 
  +
  +
$f=\mathrm{Tania}$ is solution of the equaitons
  +
: $ \displaystyle f'(z)= \frac{f(z)}{1+f(z)}$
  +
: $f(0)=1$
  +
Such an equation (and the solution) appears in the [[Laser science]] in the simplest model of the uniformly pumped [[gain medium]].
  +
  +
Copyleft 2011 by Dmitrii Kouznetsov.
  +
  +
==Generation of the figure==
  +
The curves are generated with the [[C++]] code below in the [[Encapsulated Postscript]] format.
  +
The resulting taniaplot.eps is converted to taniaplot.pdf and used as input file by the [[Latex]] document,
  +
that adds labels.
  +
  +
=== [[C++]] Generator of curve of TaniaPlot===
  +
  +
File [[ado.cin]] should be loaded into the working directory for the compliation of the code below:
  +
  +
#include <math.h>
  +
#include <stdio.h>
  +
#include <stdlib.h>
  +
#define DB double
  +
#define DO(x,y) for(x=0;x<y;x++)
  +
using namespace std;
  +
DB ArcTania(DB x){ return x+log(x)-1.;}
  +
#include "ado.cin"
  +
#define M(x,y) fprintf(o,"%6.3f %6.3f M\n",0.+x,0.+y);
  +
#define L(x,y) fprintf(o,"%6.3f %6.3f L\n",0.+x,0.+y);
  +
main(){ int j,k,m,n; DB x,y, a;
  +
FILE *o;o=fopen("tania.eps","w");ado(o,808,408);
  +
fprintf(o,"404 4 translate\n 100 100 scale\n");
  +
for(m=-4;m<5;m++){ M(m,0)L(m,4)}
  +
for(n=0;n<5;n++){ M(-4,n)L(4,n)}
  +
fprintf(o,".01 W 0 0 0 RGB S\n");
  +
for(n=0;n<380;n++){y=.02+.01*n; x=ArcTania(y); if(n==0)M(x,y) else L(x,y) }
  +
fprintf(o,".03 W 0 .5 0 RGB S\n");
  +
fprintf(o,"showpage\n%cTrailer",'%'); fclose(o);
  +
system("epstopdf tania.eps");
  +
system( "open tania.pdf"); //these 2 commands may be specific for macintosh
  +
getchar(); system("killall Preview");// if run at another operational sysetm, may need to modify
  +
}
  +
  +
===[[Latax]] Generator of labels===
  +
<nowiki>
  +
% Gerenator of TaniaPlot.png
  +
% Save the paragraph below as TaniaPlot.tex
  +
% After the latexing is and generation TaniaPlot.pdf
  +
%> convert TaniaPlot.pdf TaniaPlot.png
  +
% Copyleft 2011 by Dmitrii Kouznetsov%<br>
  +
\documentclass[12pt]{article} %<br>
  +
\usepackage{geometry} %<br>
  +
\usepackage{graphicx} %<br>
  +
\usepackage{rotating} %<br>
  +
\paperwidth 810pt %<br>
  +
\paperheight 426pt %<br>
  +
\topmargin -103pt %<br>
  +
\oddsidemargin -96pt %<br>
  +
\textwidth 1200pt %<br>
  +
\textheight 600pt %<br>
  +
\pagestyle {empty} %<br>
  +
\newcommand \sx {\scalebox} %<br>
  +
\newcommand \rot {\begin{rotate}} %<br>
  +
\newcommand \ero {\end{rotate}} %<br>
  +
\newcommand \ing {\includegraphics} %<br>
  +
\begin{document} %<br>
  +
\sx{1}{ \begin{picture}(808,410) %<br>
  +
\put(1,9){\ing{tania}} %<br>
  +
\put(388,393){\sx{2.8}{$y$}} %<br>
  +
\put(388,303){\sx{2.8}{$3$}} %<br>
  +
\put(388,203){\sx{2.8}{$2$}} %<br>
  +
\put(388,103){\sx{2.8}{$1$}} %<br>
  +
\put( 86,-9){\sx{2.5}{$-3$}} %<br>
  +
\put(186,-9){\sx{2.5}{$-2$}} %<br>
  +
\put(286,-9){\sx{2.5}{$-1$}} %<br>
  +
\put(400,-9){\sx{2.5}{$0$}} %<br>
  +
\put(500,-9){\sx{2.5}{$1$}} %<br>
  +
\put(600,-9){\sx{2.5}{$2$}} %<br>
  +
\put(700,-9){\sx{2.5}{$3$}} %<br>
  +
\put(796,-9){\sx{2.5}{$x$}} %<br>
  +
\end{picture} %<br>
  +
} %<br>
  +
\end{document}
  +
</nowiki>
  +
  +
[[Category:Tania function]]
  +
[[Category:Inverse functions]]
  +
[[Category:Explicit plots]]
  +
[[Category:Holomorphic functions]]
  +
[[Category:Laser science]]

Latest revision as of 09:39, 21 June 2013

Explicit plot of the Tania function, $y=\mathrm{Tania}(x)$.

$f=\mathrm{Tania}$ is solution of the equaitons

$ \displaystyle f'(z)= \frac{f(z)}{1+f(z)}$
$f(0)=1$

Such an equation (and the solution) appears in the Laser science in the simplest model of the uniformly pumped gain medium.

Copyleft 2011 by Dmitrii Kouznetsov.

Generation of the figure

The curves are generated with the C++ code below in the Encapsulated Postscript format. The resulting taniaplot.eps is converted to taniaplot.pdf and used as input file by the Latex document, that adds labels.

C++ Generator of curve of TaniaPlot

File ado.cin should be loaded into the working directory for the compliation of the code below:

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define DB double
#define DO(x,y) for(x=0;x<y;x++)
using namespace std;
DB ArcTania(DB x){ return x+log(x)-1.;}
#include "ado.cin"
#define M(x,y) fprintf(o,"%6.3f %6.3f M\n",0.+x,0.+y);
#define L(x,y) fprintf(o,"%6.3f %6.3f L\n",0.+x,0.+y);
main(){ int j,k,m,n; DB x,y, a;
FILE *o;o=fopen("tania.eps","w");ado(o,808,408);
fprintf(o,"404 4 translate\n 100 100 scale\n");
for(m=-4;m<5;m++){ M(m,0)L(m,4)}
for(n=0;n<5;n++){ M(-4,n)L(4,n)}
fprintf(o,".01 W 0 0 0 RGB S\n");
for(n=0;n<380;n++){y=.02+.01*n; x=ArcTania(y); if(n==0)M(x,y) else L(x,y) }
fprintf(o,".03 W 0 .5 0 RGB S\n");
fprintf(o,"showpage\n%cTrailer",'%'); fclose(o);
       system("epstopdf tania.eps");
       system(    "open tania.pdf"); //these 2 commands may be specific for macintosh
getchar(); system("killall Preview");// if run at another operational sysetm, may need to modify
}

Latax Generator of labels

% Gerenator of TaniaPlot.png % Save the paragraph below as TaniaPlot.tex % After the latexing is and generation TaniaPlot.pdf %> convert TaniaPlot.pdf TaniaPlot.png % Copyleft 2011 by Dmitrii Kouznetsov%<br> \documentclass[12pt]{article} %<br> \usepackage{geometry} %<br> \usepackage{graphicx} %<br> \usepackage{rotating} %<br> \paperwidth 810pt %<br> \paperheight 426pt %<br> \topmargin -103pt %<br> \oddsidemargin -96pt %<br> \textwidth 1200pt %<br> \textheight 600pt %<br> \pagestyle {empty} %<br> \newcommand \sx {\scalebox} %<br> \newcommand \rot {\begin{rotate}} %<br> \newcommand \ero {\end{rotate}} %<br> \newcommand \ing {\includegraphics} %<br> \begin{document} %<br> \sx{1}{ \begin{picture}(808,410) %<br> \put(1,9){\ing{tania}} %<br> \put(388,393){\sx{2.8}{$y$}} %<br> \put(388,303){\sx{2.8}{$3$}} %<br> \put(388,203){\sx{2.8}{$2$}} %<br> \put(388,103){\sx{2.8}{$1$}} %<br> \put( 86,-9){\sx{2.5}{$-3$}} %<br> \put(186,-9){\sx{2.5}{$-2$}} %<br> \put(286,-9){\sx{2.5}{$-1$}} %<br> \put(400,-9){\sx{2.5}{$0$}} %<br> \put(500,-9){\sx{2.5}{$1$}} %<br> \put(600,-9){\sx{2.5}{$2$}} %<br> \put(700,-9){\sx{2.5}{$3$}} %<br> \put(796,-9){\sx{2.5}{$x$}} %<br> \end{picture} %<br> } %<br> \end{document}

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current17:50, 20 June 2013Thumbnail for version as of 17:50, 20 June 2013807 × 424 (16 KB)Maintenance script (talk | contribs)Importing image file
  • You cannot overwrite this file.

There are no pages that link to this file.