Difference between revisions of "File:Yulya01plot80.png"

From TORI
Jump to navigation Jump to search
(Importing image file)
 
 
Line 1: Line 1:
  +
Plot of the [[Yulya function]]
Importing image file
 
  +
: $\mathrm{Yulya}_a(x)= \frac{a\!+\!x}{\sqrt{1-(a\!+\!x)^2}}-\frac{a\!-\!x}{\sqrt{1-(a\!-\!x)^2}}$
  +
  +
$f\!=\!\mathrm{Yulya}_a(x)~$ is shown in the $x,a$ plane with levels $f=\rm const.$
  +
  +
== Generator of the curves==
  +
For the plotting of curves, the routines<br>
  +
[[conto.cin]] and<br>
  +
[[ado.cin]]<br>
  +
are necessary. These files should be stored in the working directory to compile the [[C++]] 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 Yulya(DB a, DB x){ DB p=a+x; DB m=a-x;
  +
return p/sqrt(1.-p*p)-m/sqrt(1.-m*m);}
  +
  +
DB Yulyap(DB a, DB x){ DB p,m; p=a+x; m=a-x; p=1.-p*p; m=1.-m*m;
  +
return 1./(p*sqrt(p))+1./(m*sqrt(m));}
  +
  +
DB ArcYulya0(DB a, DB f){ DB m=1.-a; DB p=1.+a;
  +
return m*f / sqrt( 4./(m*p*p*p) + f*f );}
  +
  +
DB ArcYulya2(DB a, DB f){ int n; DB y=ArcYulya0(a,f);
  +
DO(n,7) y+=(f-Yulya(a,y))/Yulyap(a,y); return y;}
  +
//#include "yulya.cin"
  +
  +
#include "conto.cin"
  +
main(){ int j,k,m,n; DB x,y, p,q, t;
  +
int M=401,M1=M+1;
  +
int N=401,N1=N+1;
  +
DB X[M1],Y[N1], g[M1*N1], w[M1*N1]; // w is working array.
  +
char v[M1*N1]; // v is working array
  +
FILE *o;o=fopen("yulya01.eps","w");ado(o,208,208);
  +
fprintf(o,"104 104 translate\n 100 100 scale\n");
  +
DO(m,M1) X[m]=-1.+.005*(m-.1);
  +
DO(n,N1) Y[n]=-1.+.005*(n-.1);
  +
M(1,0)L(0,1)L(1,1) fprintf(o,"C 1 .9 1 RGB fill\n");
  +
M(-1,0)L(0,1)L(-1,1) fprintf(o,"C 1 .9 1 RGB fill\n");
  +
M(1,0)L(0,-1)L(1,-1) fprintf(o,"C 1 .9 1 RGB fill\n");
  +
M(-1,0)L(0,-1)L(-1,-1) fprintf(o,"C 1 .9 1 RGB fill\n");
  +
for(m=-1;m<2;m+=1){ M(m,-1)L(m,1)}
  +
for(n=-1;n<2;n+=1){ M(-1,n)L(1,n)}
  +
fprintf(o,".003 W 0 0 0 RGB S\n");
  +
M( .5,-1)L( .5,1) M(-.5,-1)L(-.5,1)
  +
M(-1, .5)L(1, .5) M(-1,-.5)L(1,-.5)
  +
M(0,1)L(1,0)L(0,-1)L(-1,0) fprintf(o,"C .002 W 0 0 0 RGB S\n");
  +
DO(m,M1)DO(n,N1){g[m*N1+n]=9999;}
  +
DO(m,M1){x=X[m]; //printf("run at x=%6.3f\n",x);
  +
DO(n,N1){y=Y[n];
  +
p=Yulya(y,x);
  +
// p=ArcYulya2(y,p);
  +
// p=-log(fabs(p-x)/fabs(p+x))/log(10.);
  +
if(p>-85 && p<85) g[m*N1+n]=p;
  +
}}
  +
fprintf(o,"1 setlinejoin 1 setlinecap\n");
  +
p=4.;
  +
conto(o,g,w,v,X,Y,M,N,.2,-p,p);fprintf(o,".003 W 0 0 .5 RGB S\n");
  +
conto(o,g,w,v,X,Y,M,N,.4,-p,p);fprintf(o,".003 W 0 0 .5 RGB S\n");
  +
conto(o,g,w,v,X,Y,M,N,.6,-p,p);fprintf(o,".003 W 0 0 .5 RGB S\n");
  +
conto(o,g,w,v,X,Y,M,N,.8,-p,p);fprintf(o,".003 W 0 0 .5 RGB S\n");
  +
conto(o,g,w,v,X,Y,M,N,-.2,-p,p);fprintf(o,".003 W .5 0 0 RGB S\n");
  +
conto(o,g,w,v,X,Y,M,N,-.4,-p,p);fprintf(o,".003 W .5 0 0 RGB S\n");
  +
conto(o,g,w,v,X,Y,M,N,-.6,-p,p);fprintf(o,".003 W .5 0 0 RGB S\n");
  +
conto(o,g,w,v,X,Y,M,N,-.8,-p,p);fprintf(o,".003 W .5 0 0 RGB S\n");
  +
conto(o,g,w,v,X,Y,M,N,1.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
  +
conto(o,g,w,v,X,Y,M,N,2.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
  +
conto(o,g,w,v,X,Y,M,N,3.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
  +
conto(o,g,w,v,X,Y,M,N,4.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
  +
conto(o,g,w,v,X,Y,M,N,-1.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
  +
conto(o,g,w,v,X,Y,M,N,-2.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
  +
conto(o,g,w,v,X,Y,M,N,-3.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
  +
conto(o,g,w,v,X,Y,M,N,-4.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
  +
fprintf(o,"showpage\n%cTrailer",'%'); fclose(o);
  +
system("epstopdf yulya01.eps");
  +
system( "open yulya01.pdf"); //these 2 commands may be specific for macintosh
  +
getchar(); system("killall Preview");// if run at another operational sysetm, may need to modify
  +
}
  +
//End of generator of yulya01.pdf
  +
  +
== Generator of the labels ==
  +
Once the curves are generated and stored as yulya.pdf
  +
the image can be generated with the [[latex]] file below:
  +
  +
<nowiki>
  +
% Gerenator of Yulya01plot80.png %<br>
  +
% Save this paragraph as yulya01plot.tex %<br>
  +
% Copyleft 2011 by Dmitrii Kouznetsov %<br>
  +
\documentclass[12pt]{article} %<br>
  +
\usepackage{geometry} %<br>
  +
\usepackage{graphicx} %<br>
  +
\usepackage{rotating} %<br>
  +
\paperwidth 1050pt %<br>
  +
\paperheight 1040pt %<br>
  +
\topmargin -114pt %<br>
  +
\oddsidemargin -100pt %<br>
  +
\textwidth 1200pt %<br>
  +
\textheight 1200pt %<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{5}{ \begin{picture}(208,208) %<br>
  +
\put(3,2){\ing{yulya01}} %<br>
  +
\put(1,203){\sx{.6}{$a$}} %<br>
  +
\put(-1,154){\sx{.9}{$\frac 12$}} %<br>
  +
\put(0,104){\sx{.6}{$0$}} %<br>
  +
\put(-3,54){\sx{.9}{$\frac{-\!1}{2}$}} %<br>
  +
\put(-3, 4){\sx{.6}{$-1$}} %<br>
  +
\put(50,0){\sx{.6}{$-0.5$}} %<br>
  +
\put(105,0){\sx{.6}{$0$}} %<br>
  +
\put(153,0){\sx{.6}{$0.5$}} %<br>
  +
\put(204,0){\sx{.6}{$x$}} %<br>
  +
\put(108,140){\rot{-90} \sx{.5}{$f\!=\!0$} \ero} %<br>
  +
\put(117,139){\rot{-87} \sx{.5}{$f\!=\!0.2$} \ero} %<br>
  +
\put(125,137){\rot{-82} \sx{.5}{$f\!=\!0.4$} \ero} %<br>
  +
\put(133,135){\rot{-78} \sx{.5}{$f\!=\!0.6$} \ero} %<br>
  +
\put(141,131){\rot{-76} \sx{.5}{$f\!=\!0.8$} \ero} %<br>
  +
\put(149,129){\rot{-76} \sx{.5}{$f\!=\!1$} \ero} %<br>
  +
\put(164,128){\rot{-56} \sx{.5}{$f\!=\!2$} \ero} %<br>
  +
\put(175,125){\rot{-53} \sx{.5}{$f\!=\!3$} \ero} %<br>
  +
\put(192,122){\rot{-45} \sx{.5}{$f\!=\!\infty$} \ero} %<br>
  +
% %<br>
  +
% \put(108,60){\rot{-90} \sx{.5}{$f\!=\!0$} \ero} %<br>
  +
\put(93,104){\rot{-87} \sx{.5}{$f\!=\!-0.2$} \ero} %<br>
  +
\put(83,104){\rot{-84} \sx{.5}{$f\!=\!-0.4$} \ero} %<br>
  +
\put(74,104){\rot{-82} \sx{.5}{$f\!=\!-0.6$} \ero} %<br>
  +
\put(65,104){\rot{-78} \sx{.5}{$f\!=\!-0.8$} \ero} %<br>
  +
\put(59,95){\rot{-76} \sx{.5}{$f\!=\!-1$} \ero} %<br>
  +
\put(39,97){\rot{-56} \sx{.5}{$f\!=\!-\!2$} \ero} %<br>
  +
\put(27,98){\rot{-53} \sx{.5}{$f\!=\!-\!3$} \ero} %<br>
  +
% %<br>
  +
\put(158,189){\sx{.74}{$f\!=\!\mathrm{Yulya}_a\!(x)$}} %<br>
  +
\put(167,179){\sx{.8}{has}} %<br>
  +
\put(160,170){\sx{.8}{complex}} %<br>
  +
\put(164,161){\sx{.8}{values}} %<br>
  +
\end{picture} %<br>
  +
} %<br>
  +
\end{document} %<br>
  +
</nowiki>
  +
  +
  +
[[Category:Yulya function]]
  +
[[Category:Contour plots]]
  +
[[Category:Matan]]

Latest revision as of 09:39, 21 June 2013

Plot of the Yulya function

$\mathrm{Yulya}_a(x)= \frac{a\!+\!x}{\sqrt{1-(a\!+\!x)^2}}-\frac{a\!-\!x}{\sqrt{1-(a\!-\!x)^2}}$

$f\!=\!\mathrm{Yulya}_a(x)~$ is shown in the $x,a$ plane with levels $f=\rm const.$

Generator of the curves

For the plotting of curves, the routines
conto.cin and
ado.cin
are necessary. These files should be stored in the working directory to compile the C++ code below:

  1. 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 Yulya(DB a, DB x){ DB p=a+x; DB m=a-x; 
 return p/sqrt(1.-p*p)-m/sqrt(1.-m*m);}
DB Yulyap(DB a, DB x){ DB p,m; p=a+x; m=a-x; p=1.-p*p; m=1.-m*m; 
 return 1./(p*sqrt(p))+1./(m*sqrt(m));}
DB ArcYulya0(DB a, DB f){ DB m=1.-a; DB p=1.+a; 
 return m*f / sqrt( 4./(m*p*p*p) + f*f );}
DB ArcYulya2(DB a, DB f){ int n; DB y=ArcYulya0(a,f);
 DO(n,7) y+=(f-Yulya(a,y))/Yulyap(a,y);        return y;}
//#include "yulya.cin"
#include "conto.cin"
main(){ int j,k,m,n; DB x,y, p,q, t;
int M=401,M1=M+1;
int N=401,N1=N+1;
DB X[M1],Y[N1], g[M1*N1], w[M1*N1]; // w is working array.
char v[M1*N1]; // v is working array
FILE *o;o=fopen("yulya01.eps","w");ado(o,208,208);
fprintf(o,"104 104 translate\n 100 100 scale\n");
DO(m,M1) X[m]=-1.+.005*(m-.1);
DO(n,N1) Y[n]=-1.+.005*(n-.1);
M(1,0)L(0,1)L(1,1) fprintf(o,"C 1 .9 1 RGB fill\n");
M(-1,0)L(0,1)L(-1,1) fprintf(o,"C 1 .9 1 RGB fill\n");
M(1,0)L(0,-1)L(1,-1) fprintf(o,"C 1 .9 1 RGB fill\n");
M(-1,0)L(0,-1)L(-1,-1) fprintf(o,"C 1 .9 1 RGB fill\n");
for(m=-1;m<2;m+=1){    M(m,-1)L(m,1)}
for(n=-1;n<2;n+=1){    M(-1,n)L(1,n)}
fprintf(o,".003 W 0 0 0 RGB S\n");
M( .5,-1)L( .5,1) M(-.5,-1)L(-.5,1) 
M(-1, .5)L(1, .5) M(-1,-.5)L(1,-.5)
M(0,1)L(1,0)L(0,-1)L(-1,0) fprintf(o,"C .002 W 0 0 0 RGB S\n");
DO(m,M1)DO(n,N1){g[m*N1+n]=9999;}
DO(m,M1){x=X[m]; //printf("run at x=%6.3f\n",x);
DO(n,N1){y=Y[n];
 p=Yulya(y,x);
//     p=ArcYulya2(y,p);
//     p=-log(fabs(p-x)/fabs(p+x))/log(10.);
if(p>-85 && p<85)  g[m*N1+n]=p;
  }}
fprintf(o,"1 setlinejoin 1 setlinecap\n");
p=4.;
conto(o,g,w,v,X,Y,M,N,.2,-p,p);fprintf(o,".003 W 0 0 .5 RGB S\n");
conto(o,g,w,v,X,Y,M,N,.4,-p,p);fprintf(o,".003 W 0 0 .5 RGB S\n");
conto(o,g,w,v,X,Y,M,N,.6,-p,p);fprintf(o,".003 W 0 0 .5 RGB S\n");
conto(o,g,w,v,X,Y,M,N,.8,-p,p);fprintf(o,".003 W 0 0 .5 RGB S\n");
conto(o,g,w,v,X,Y,M,N,-.2,-p,p);fprintf(o,".003 W .5 0 0 RGB S\n");
conto(o,g,w,v,X,Y,M,N,-.4,-p,p);fprintf(o,".003 W .5 0 0 RGB S\n");
conto(o,g,w,v,X,Y,M,N,-.6,-p,p);fprintf(o,".003 W .5 0 0 RGB S\n");
conto(o,g,w,v,X,Y,M,N,-.8,-p,p);fprintf(o,".003 W .5 0 0 RGB S\n");
conto(o,g,w,v,X,Y,M,N,1.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
conto(o,g,w,v,X,Y,M,N,2.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
conto(o,g,w,v,X,Y,M,N,3.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
conto(o,g,w,v,X,Y,M,N,4.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
conto(o,g,w,v,X,Y,M,N,-1.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
conto(o,g,w,v,X,Y,M,N,-2.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
conto(o,g,w,v,X,Y,M,N,-3.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
conto(o,g,w,v,X,Y,M,N,-4.,-p,p);fprintf(o,".004 W 0 0 0 RGB S\n");
fprintf(o,"showpage\n%cTrailer",'%'); fclose(o);
       system("epstopdf yulya01.eps");
       system(    "open yulya01.pdf"); //these 2 commands may be specific for macintosh
getchar(); system("killall Preview");// if run at another operational sysetm, may need to modify
}
//End of generator of yulya01.pdf

Generator of the labels

Once the curves are generated and stored as yulya.pdf the image can be generated with the latex file below:

% Gerenator of Yulya01plot80.png %<br> % Save this paragraph as yulya01plot.tex %<br> % Copyleft 2011 by Dmitrii Kouznetsov %<br> \documentclass[12pt]{article} %<br> \usepackage{geometry} %<br> \usepackage{graphicx} %<br> \usepackage{rotating} %<br> \paperwidth 1050pt %<br> \paperheight 1040pt %<br> \topmargin -114pt %<br> \oddsidemargin -100pt %<br> \textwidth 1200pt %<br> \textheight 1200pt %<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{5}{ \begin{picture}(208,208) %<br> \put(3,2){\ing{yulya01}} %<br> \put(1,203){\sx{.6}{$a$}} %<br> \put(-1,154){\sx{.9}{$\frac 12$}} %<br> \put(0,104){\sx{.6}{$0$}} %<br> \put(-3,54){\sx{.9}{$\frac{-\!1}{2}$}} %<br> \put(-3, 4){\sx{.6}{$-1$}} %<br> \put(50,0){\sx{.6}{$-0.5$}} %<br> \put(105,0){\sx{.6}{$0$}} %<br> \put(153,0){\sx{.6}{$0.5$}} %<br> \put(204,0){\sx{.6}{$x$}} %<br> \put(108,140){\rot{-90} \sx{.5}{$f\!=\!0$} \ero} %<br> \put(117,139){\rot{-87} \sx{.5}{$f\!=\!0.2$} \ero} %<br> \put(125,137){\rot{-82} \sx{.5}{$f\!=\!0.4$} \ero} %<br> \put(133,135){\rot{-78} \sx{.5}{$f\!=\!0.6$} \ero} %<br> \put(141,131){\rot{-76} \sx{.5}{$f\!=\!0.8$} \ero} %<br> \put(149,129){\rot{-76} \sx{.5}{$f\!=\!1$} \ero} %<br> \put(164,128){\rot{-56} \sx{.5}{$f\!=\!2$} \ero} %<br> \put(175,125){\rot{-53} \sx{.5}{$f\!=\!3$} \ero} %<br> \put(192,122){\rot{-45} \sx{.5}{$f\!=\!\infty$} \ero} %<br> % %<br> % \put(108,60){\rot{-90} \sx{.5}{$f\!=\!0$} \ero} %<br> \put(93,104){\rot{-87} \sx{.5}{$f\!=\!-0.2$} \ero} %<br> \put(83,104){\rot{-84} \sx{.5}{$f\!=\!-0.4$} \ero} %<br> \put(74,104){\rot{-82} \sx{.5}{$f\!=\!-0.6$} \ero} %<br> \put(65,104){\rot{-78} \sx{.5}{$f\!=\!-0.8$} \ero} %<br> \put(59,95){\rot{-76} \sx{.5}{$f\!=\!-1$} \ero} %<br> \put(39,97){\rot{-56} \sx{.5}{$f\!=\!-\!2$} \ero} %<br> \put(27,98){\rot{-53} \sx{.5}{$f\!=\!-\!3$} \ero} %<br> % %<br> \put(158,189){\sx{.74}{$f\!=\!\mathrm{Yulya}_a\!(x)$}} %<br> \put(167,179){\sx{.8}{has}} %<br> \put(160,170){\sx{.8}{complex}} %<br> \put(164,161){\sx{.8}{values}} %<br> \end{picture} %<br> } %<br> \end{document} %<br>

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 20131,163 × 1,152 (287 KB)Maintenance script (talk | contribs)Importing image file

The following page uses this file:

Metadata