Difference between revisions of "File:DoyaconT70.png"
(Importing image file) |
|||
Line 1: | Line 1: | ||
+ | [[Contour plot]] of the [[Doya function]] versus argument and parameter. |
||
− | Importing image file |
||
+ | |||
+ | $f=\mathrm{Doya}_t(x)$ is shown in the $x,t$ plane with levels $f\!=\!\mathrm{const}$. |
||
+ | |||
+ | ==Generator of curves== |
||
+ | The files [[ado.cin]] and [[conto.cin]] should be loaded to the working directory in order to compile 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; |
||
+ | #include <complex> |
||
+ | typedef complex<double> z_type; |
||
+ | #define Re(x) x.real() |
||
+ | #define Im(x) x.imag() |
||
+ | #define I z_type(0.,1.) |
||
+ | #include "conto.cin" |
||
+ | |||
+ | z_type ArcTania(z_type z) {return z + log(z) - 1. ;} |
||
+ | z_type ArcTaniap(z_type z) {return 1. + 1./z ;} |
||
+ | |||
+ | z_type TaniaTay(z_type z) { int n; z_type s; |
||
+ | s=1.+z*(.5+z*(1./16.+z*(-1./192.+z*(-1./3072.+z*(1.3/6144.+z*(-4.7/147456. |
||
+ | //+z*(7.3/4128768.) //reserve term for testing |
||
+ | )))))); DO(n,2) s+=(z-ArcTania(s))/ArcTaniap(s); return s ; } |
||
+ | |||
+ | z_type TaniaNega(z_type z){int n;z_type s=exp(z-exp(z)+1.); |
||
+ | DO(n,3) s+=(z-ArcTania(s))/ArcTaniap(s); return s ; } |
||
+ | |||
+ | z_type TaniaBig0(z_type z){int n;z_type L=log(z), s=z-L+1.; |
||
+ | s-=(1.-L)/z; |
||
+ | DO(n,3) s+=(z-ArcTania(s))/ArcTaniap(s); |
||
+ | return s ; |
||
+ | } |
||
+ | |||
+ | z_type TaniaS(z_type z){int n; z_type s,t=z+z_type(2.,-M_PI);t*=2./9.; t=I*sqrt(t); |
||
+ | s=-1.+t*(3.+t*(-3.+t*(.75+t*(.3+t*(.9/16.+t*(-.3/7.+t*(-12.51/224. //+t*(-.9/28.) |
||
+ | ))))))); |
||
+ | DO(n,3) s+=(z-ArcTania(s))/ArcTaniap(s); return s ; } |
||
+ | |||
+ | z_type Tania(z_type z){ z_type t; |
||
+ | if( fabs(Im(z))< M_PI && Re(z)<-2.51) return TaniaNega(z); |
||
+ | if( abs(z)>7. || Re(z)>3.8 ) return TaniaBig0(z); |
||
+ | if( Im(z) > .7 ) return TaniaS(z); |
||
+ | if( Im(z) < -.7) return conj(TaniaS(conj(z))); |
||
+ | return TaniaTay(z); |
||
+ | } |
||
+ | |||
+ | z_type Doya(z_type t, z_type z){ return Tania(t+ArcTania(z)) ;} |
||
+ | |||
+ | main(){ int j,k,m,n; DB x,y, p,q, t; z_type z,c,d; |
||
+ | int M=80,M1=M+1; |
||
+ | int N=80,N1=N+1; |
||
+ | DB X[M1],Y[N1], g[M1*N1],f[M1*N1], w[M1*N1]; // w is working array. |
||
+ | char v[M1*N1]; // v is working array |
||
+ | FILE *o;o=fopen("doyacon1.eps","w");ado(o,42,82); |
||
+ | fprintf(o,"1 41 translate\n 10 10 scale\n"); |
||
+ | DO(m,M1) X[m]=0.005+.05*(m); |
||
+ | DO(n,N1) Y[n]=-4.+.1*n; |
||
+ | for(m= 0;m<5;m++){M(m,-4)L(m,4)} |
||
+ | for(n=-4;n<5;n++){M( 0,n)L(4,n)} |
||
+ | fprintf(o,".011 W 0 0 0 RGB S\n"); |
||
+ | DO(m,M1)DO(n,N1){g[m*N1+n]=9999; f[m*N1+n]=9999;} |
||
+ | DO(m,M1){x=X[m]; //printf("%5.2f\n",x); |
||
+ | DO(n,N1){y=Y[n]; //z=z_type(x,y); |
||
+ | c=Doya(y,x); |
||
+ | p=Re(c);//q=Im(c); |
||
+ | if(p>-99. && p<99. ){ g[m*N1+n]=p;} |
||
+ | }} |
||
+ | fprintf(o,"1 setlinejoin 2 setlinecap\n"); p=3.;q=2.; |
||
+ | for(m=0;m<1;m++) for(n=2;n<10;n+=2)conto(o,g,w,v,X,Y,M,N, (m+.1*n),-q, q); fprintf(o,".02 W 0 0 .9 RGB S\n"); |
||
+ | for(m=-9;m<8;m++) conto(o,g,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".05 W 0 0 0 RGB S\n"); |
||
+ | fprintf(o,"showpage\n%c%cTrailer",'%','%'); fclose(o); |
||
+ | system("epstopdf doyacon1.eps"); |
||
+ | system( "open doyacon1.pdf"); |
||
+ | getchar(); system("killall Preview"); |
||
+ | } |
||
+ | |||
+ | ==Generator of labels== |
||
+ | |||
+ | File doyacon1.pdf should be generated with the code from the previous section in order to pdflatex the document below. |
||
+ | |||
+ | <nowiki> |
||
+ | % Copyleft 2011 by Dmitrii Kouznetsov <br> |
||
+ | \documentclass[12pt]{article} %<br> |
||
+ | \usepackage{geometry} %<br> |
||
+ | \usepackage{graphicx} %<br> |
||
+ | \usepackage{rotating} %<br> |
||
+ | \paperwidth 456pt %<br> |
||
+ | \paperheight 843pt %<br> |
||
+ | \topmargin -94pt %<br> |
||
+ | \oddsidemargin -96pt %<br> |
||
+ | \textwidth 1200pt %<br> |
||
+ | \textheight 1800pt %<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{10}{ \begin{picture}(41,81) %<br> |
||
+ | \put(1,1){\ing{doyacon1}} % <br> |
||
+ | \put(-.5,79.6){\sx{.4}{$t$}}% <br> |
||
+ | \put(-1,71){\sx{.4}{$3$}}% <br> |
||
+ | \put(-1,61){\sx{.4}{$2$}}% <br> |
||
+ | \put(-1,51){\sx{.4}{$1$}}% <br> |
||
+ | \put(-1,41){\sx{.4}{$0$}}% <br> |
||
+ | \put(-4,31){\sx{.4}{$-1$}}% <br> |
||
+ | \put(-4,21){\sx{.4}{$-2$}}% <br> |
||
+ | \put(-4,11){\sx{.4}{$-3$}}% <br> |
||
+ | %\put(-4, 1){\sx{.4}{$-4$}}% <br> |
||
+ | \put( 1,-1.5){\sx{.4}{0}}% <br> |
||
+ | \put(11,-1.5){\sx{.4}{1}}% <br> |
||
+ | \put(21,-1.5){\sx{.4}{2}}% <br> |
||
+ | \put(31,-1.5){\sx{.4}{3}}% <br> |
||
+ | \put(39.8,-1.2){\sx{.42}{$x$}}% <br> |
||
+ | \put(9.7,16){\rot{-62}\sx{.33}{$f\!=\!0.2$}\ero}% <br> |
||
+ | \put(14.,18){\rot{-60}\sx{.33}{$f\!=\!0.4$}\ero}% <br> |
||
+ | \put(25.4,22){\rot{-56}\sx{.33}{$f\!=\!1$}\ero}% <br> |
||
+ | \put(30.4,25.5){\rot{-55}\sx{.33}{$f\!=\!2$}\ero} % <br> |
||
+ | \put(30.4,40){\rot{-55}\sx{.33}{$f\!=\!3$}\ero} % <br> |
||
+ | \put(31.3,51){\rot{-54}\sx{.33}{$f\!=\!4$}\ero} % <br> |
||
+ | \put(31.6,62){\rot{-53}\sx{.33}{$f\!=\!5$}\ero} % <br> |
||
+ | \put(32.8,73){\rot{-52}\sx{.33}{$f\!=\!6$}\ero} % <br> |
||
+ | \put(35,81.6){\rot{-51}\sx{.33}{$f\!=\!7$}\ero} % <br> |
||
+ | \end{picture} %<br> |
||
+ | } %<br> |
||
+ | \end{document} |
||
+ | </nowiki> |
||
+ | |||
+ | [[Category:Doya function]] |
||
+ | [[Category:Transfer function]] |
||
+ | [[Category:Laser science]] |
||
+ | [[Category:Contour plot]] |
Latest revision as of 09:39, 21 June 2013
Contour plot of the Doya function versus argument and parameter.
$f=\mathrm{Doya}_t(x)$ is shown in the $x,t$ plane with levels $f\!=\!\mathrm{const}$.
Generator of curves
The files ado.cin and conto.cin should be loaded to the working directory in order to compile 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; #include <complex> typedef complex<double> z_type; #define Re(x) x.real() #define Im(x) x.imag() #define I z_type(0.,1.) #include "conto.cin"
z_type ArcTania(z_type z) {return z + log(z) - 1. ;} z_type ArcTaniap(z_type z) {return 1. + 1./z ;}
z_type TaniaTay(z_type z) { int n; z_type s; s=1.+z*(.5+z*(1./16.+z*(-1./192.+z*(-1./3072.+z*(1.3/6144.+z*(-4.7/147456. //+z*(7.3/4128768.) //reserve term for testing )))))); DO(n,2) s+=(z-ArcTania(s))/ArcTaniap(s); return s ; }
z_type TaniaNega(z_type z){int n;z_type s=exp(z-exp(z)+1.); DO(n,3) s+=(z-ArcTania(s))/ArcTaniap(s); return s ; }
z_type TaniaBig0(z_type z){int n;z_type L=log(z), s=z-L+1.; s-=(1.-L)/z; DO(n,3) s+=(z-ArcTania(s))/ArcTaniap(s); return s ; }
z_type TaniaS(z_type z){int n; z_type s,t=z+z_type(2.,-M_PI);t*=2./9.; t=I*sqrt(t); s=-1.+t*(3.+t*(-3.+t*(.75+t*(.3+t*(.9/16.+t*(-.3/7.+t*(-12.51/224. //+t*(-.9/28.) ))))))); DO(n,3) s+=(z-ArcTania(s))/ArcTaniap(s); return s ; }
z_type Tania(z_type z){ z_type t; if( fabs(Im(z))< M_PI && Re(z)<-2.51) return TaniaNega(z); if( abs(z)>7. || Re(z)>3.8 ) return TaniaBig0(z); if( Im(z) > .7 ) return TaniaS(z); if( Im(z) < -.7) return conj(TaniaS(conj(z))); return TaniaTay(z); }
z_type Doya(z_type t, z_type z){ return Tania(t+ArcTania(z)) ;}
main(){ int j,k,m,n; DB x,y, p,q, t; z_type z,c,d; int M=80,M1=M+1; int N=80,N1=N+1; DB X[M1],Y[N1], g[M1*N1],f[M1*N1], w[M1*N1]; // w is working array. char v[M1*N1]; // v is working array FILE *o;o=fopen("doyacon1.eps","w");ado(o,42,82); fprintf(o,"1 41 translate\n 10 10 scale\n"); DO(m,M1) X[m]=0.005+.05*(m); DO(n,N1) Y[n]=-4.+.1*n; for(m= 0;m<5;m++){M(m,-4)L(m,4)} for(n=-4;n<5;n++){M( 0,n)L(4,n)} fprintf(o,".011 W 0 0 0 RGB S\n"); DO(m,M1)DO(n,N1){g[m*N1+n]=9999; f[m*N1+n]=9999;} DO(m,M1){x=X[m]; //printf("%5.2f\n",x); DO(n,N1){y=Y[n]; //z=z_type(x,y); c=Doya(y,x); p=Re(c);//q=Im(c); if(p>-99. && p<99. ){ g[m*N1+n]=p;} }} fprintf(o,"1 setlinejoin 2 setlinecap\n"); p=3.;q=2.; for(m=0;m<1;m++) for(n=2;n<10;n+=2)conto(o,g,w,v,X,Y,M,N, (m+.1*n),-q, q); fprintf(o,".02 W 0 0 .9 RGB S\n"); for(m=-9;m<8;m++) conto(o,g,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".05 W 0 0 0 RGB S\n"); fprintf(o,"showpage\n%c%cTrailer",'%','%'); fclose(o); system("epstopdf doyacon1.eps"); system( "open doyacon1.pdf"); getchar(); system("killall Preview"); }
Generator of labels
File doyacon1.pdf should be generated with the code from the previous section in order to pdflatex the document below.
% Copyleft 2011 by Dmitrii Kouznetsov <br> \documentclass[12pt]{article} %<br> \usepackage{geometry} %<br> \usepackage{graphicx} %<br> \usepackage{rotating} %<br> \paperwidth 456pt %<br> \paperheight 843pt %<br> \topmargin -94pt %<br> \oddsidemargin -96pt %<br> \textwidth 1200pt %<br> \textheight 1800pt %<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{10}{ \begin{picture}(41,81) %<br> \put(1,1){\ing{doyacon1}} % <br> \put(-.5,79.6){\sx{.4}{$t$}}% <br> \put(-1,71){\sx{.4}{$3$}}% <br> \put(-1,61){\sx{.4}{$2$}}% <br> \put(-1,51){\sx{.4}{$1$}}% <br> \put(-1,41){\sx{.4}{$0$}}% <br> \put(-4,31){\sx{.4}{$-1$}}% <br> \put(-4,21){\sx{.4}{$-2$}}% <br> \put(-4,11){\sx{.4}{$-3$}}% <br> %\put(-4, 1){\sx{.4}{$-4$}}% <br> \put( 1,-1.5){\sx{.4}{0}}% <br> \put(11,-1.5){\sx{.4}{1}}% <br> \put(21,-1.5){\sx{.4}{2}}% <br> \put(31,-1.5){\sx{.4}{3}}% <br> \put(39.8,-1.2){\sx{.42}{$x$}}% <br> \put(9.7,16){\rot{-62}\sx{.33}{$f\!=\!0.2$}\ero}% <br> \put(14.,18){\rot{-60}\sx{.33}{$f\!=\!0.4$}\ero}% <br> \put(25.4,22){\rot{-56}\sx{.33}{$f\!=\!1$}\ero}% <br> \put(30.4,25.5){\rot{-55}\sx{.33}{$f\!=\!2$}\ero} % <br> \put(30.4,40){\rot{-55}\sx{.33}{$f\!=\!3$}\ero} % <br> \put(31.3,51){\rot{-54}\sx{.33}{$f\!=\!4$}\ero} % <br> \put(31.6,62){\rot{-53}\sx{.33}{$f\!=\!5$}\ero} % <br> \put(32.8,73){\rot{-52}\sx{.33}{$f\!=\!6$}\ero} % <br> \put(35,81.6){\rot{-51}\sx{.33}{$f\!=\!7$}\ero} % <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/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 17:50, 20 June 2013 | 442 × 817 (98 KB) | Maintenance script (talk | contribs) | Importing image file |
- You cannot overwrite this file.
File usage
There are no pages that link to this file.