Difference between revisions of "File:Besselj0map4.jpg"

From TORI
Jump to: navigation, search
(Importing image file)
 
 
Line 1: Line 1:
  +
[[Complex map]] of function $j_0=\,$[[BesselJ0]]:
Importing image file
 
  +
  +
$f=\mathrm{BesselJ}_0(x+\mathrm i y)$ is shown in the $x$,$y$ plane with
  +
  +
lines $u\!=\!\Re(f)\!=\!\mathrm{const}$ and
  +
lines $v\!=\!\Im(f)\!=\!\mathrm{const}$.
  +
  +
==[[C++]] generator of curves==
  +
Files [[ado.cin]], [[besselj0.cin]], [[conto.cin]] should be loaded in order to compile the code below.
  +
<poem><nomathjax><nowiki>
  +
#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 std::complex<double> z_type;
  +
#define Re(x) x.real()
  +
#define Im(x) x.imag()
  +
#define I z_type(0.,1.)
  +
#include "conto.cin"
  +
#include "besselj0.cin"
  +
  +
int main(){ int j,k,m,n; DB x,y, p,q, t; z_type z,c,d;
  +
int M=801,M1=M+1;
  +
int N=401,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("besselj0map1.eps","w");ado(o,162,82);
  +
//FILE *o;o=fopen("01.eps","w");ado(o,1620,820);
  +
//FILE *o;o=fopen("morima4.eps","w");ado(o,1620,820);
  +
FILE *o;o=fopen("besselj0ma4.eps","w");ado(o,1620,820);
  +
fprintf(o,"810 410 translate\n 100 100 scale\n");
  +
DO(m,400) X[m]=-8.+.02*m;
  +
X[400]=-.001;
  +
X[401]= .001;
  +
for(m=402;m<M1;m++) X[m]=-8.+.02*(m-1.);
  +
DO(n,200)Y[n]=-4.+.02*n;
  +
Y[200]=-.001;
  +
Y[201]= .001;
  +
for(n=202;n<N1;n++) Y[n]=-4.+.02*(n-1.);
  +
//DO(m,M1)X[m]=Y[m];
  +
for(m=-8;m<9;m++){if(m==0){M(m,-4.1)L(m,4.1)} else{M(m,-4)L(m,4)}}
  +
for(n=-4;n<5;n++){ M( -8,n)L(8,n)}
  +
fprintf(o,".01 W 0 0 0 RGB S\n");
  +
DO(m,M1)DO(n,N1){g[m*N1+n]=99999; f[m*N1+n]=99999;}
  +
DO(m,M1){x=X[m]; //printf("%5.2f\n",x);
  +
DO(n,N1){y=Y[n]; z=z_type(x,y);
  +
c=BesselJ0(z);
  +
// c=mori(z);
  +
p=Re(c); q=Im(c);
  +
if(p>-999. && p<999. && q>-999. && q<999
  +
)
  +
{g[m*N1+n]=p;
  +
f[m*N1+n]=q;
  +
}
  +
}}
  +
//#include "plodi.cin"
  +
fprintf(o,"1 setlinejoin 1 setlinecap\n"); p=4;q=.2;
  +
for(m=-4;m<4;m++)for(n=1;n<10;n+=1)conto(o,f,w,v,X,Y,M,N,(m+.1*n),-q, q); fprintf(o,".01 W 0 .6 0 RGB S\n");
  +
for(m=0;m<4;m++) for(n=1;n<10;n+=1)conto(o,g,w,v,X,Y,M,N,-(m+.1*n),-q, q); fprintf(o,".01 W .9 0 0 RGB S\n");
  +
for(m=0;m<4;m++) for(n=1;n<10;n+=1)conto(o,g,w,v,X,Y,M,N, (m+.1*n),-q, q); fprintf(o,".01 W 0 0 .9 RGB S\n");
  +
for(m=1;m<9;m++) conto(o,f,w,v,X,Y,M,N, (0.-m),-p,p); fprintf(o,".02 W .9 0 0 RGB S\n");
  +
for(m=1;m<9;m++) conto(o,f,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".02 W 0 0 .9 RGB S\n");
  +
conto(o,f,w,v,X,Y,M,N, (0. ),-2*p,2*p); fprintf(o,".02 W .6 0 .6 RGB S\n");
  +
for(m=-8;m<0;m++) conto(o,g,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".02 W 0 0 0 RGB S\n");
  +
m=0; conto(o,g,w,v,X,Y,M,N, (0.+m),-2*p,2*p); fprintf(o,".02 W 0 0 0 RGB S\n");
  +
for(m=1;m<9;m++) conto(o,g,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".02 W 0 0 0 RGB S\n");
  +
//#include "plofu.cin"
  +
fprintf(o,"showpage\n%c%cTrailer",'%','%'); fclose(o);
  +
system("epstopdf besselj0ma4.eps");
  +
system( "open besselj0ma4.pdf");
  +
}
  +
</nowiki></nomathjax></poem>
  +
  +
==[[Latex]] generator of curves==
  +
  +
<poem><nomathjax><nowiki>
  +
\documentclass[12pt]{article}
  +
\paperheight 838px
  +
\paperwidth 1644px
  +
\textwidth 1294px
  +
\textheight 1200px
  +
\topmargin -80px
  +
\oddsidemargin -80px
  +
\usepackage{graphics}
  +
\usepackage{rotating}
  +
\usepackage{color}%<br>
  +
\newcommand \sx {\scalebox}
  +
\newcommand \rot {\begin{rotate}}
  +
\newcommand \ero {\end{rotate}}
  +
\newcommand \ing {\includegraphics}
  +
\newcommand \rmi {\mathrm{i}}
  +
\begin{document}
  +
\newcommand \zoomax {
  +
\put(16,820){\sx{4.4}{$y$}}
  +
\put(16,630){\sx{4}{$2$}}
  +
\put(16,430){\sx{4}{$0$}}
  +
\put(-4, 230){\sx{4}{$-\!2$}}
  +
\put(220, 5){\sx{4}{$-\!6$}}
  +
\put(420, 5){\sx{4}{$-\!4$}}
  +
\put(620, 5){\sx{4}{$-\!2$}}
  +
\put(843, 5){\sx{4}{$0$}}
  +
\put(1043, 5){\sx{4}{$2$}}
  +
\put(1243, 5){\sx{4}{$4$}}
  +
\put(1443, 5){\sx{4}{$6$}}
  +
\put(1631,6){\sx{4}{$x$}}
  +
}
  +
\parindent 0pt
  +
\begin{picture}(1616,816)
  +
%\put(40,30){\sx{10}{\ing{besselj0map1}}}
  +
%\put(40,30){\ing{02}}
  +
%\put(40,30){\ing{morima}}
  +
\put(40,30){\ing{besselj0ma4}}
  +
\zoomax
  +
\put(170,430){\sx{4}{\rot{0}$v\!=\!0$\ero}}
  +
\put(865,470){\sx{4}{\rot{90}$v\!=\!0$\ero}}
  +
\put(872,442){\sx{4}{\rot{47}$u\!=\!1$\ero}}
  +
\put(860,420){\sx{4}{\rot{-48}$u\!=\!1$\ero}}
  +
\put(630,445){\sx{3.6}{\rot{0}$v\!=\!0.1$\ero}}
  +
%\put(660,430){\sx{4}{\rot{0}$v\!=\!0$\ero}}
  +
\put(620,410){\sx{3.6}{\rot{0}$v\!=\!-0.1$\ero}}
  +
%
  +
\put(1106,390){\sx{4}{\rot{90}$u\!=\!0$\ero}}
  +
\put(1250,390){\sx{4}{\rot{90}$v\!=\!0$\ero}}
  +
\put(1418,390){\sx{4}{\rot{90}$u\!=\!0$\ero}}
  +
%
  +
\put(1570,390){\sx{4}{\rot{90}$v\!=\!0$\ero}}
  +
\put(1456,310){\sx{4}{\rot{49}$u\!=\!0.3$\ero}}
  +
%
  +
\put(580,274){\sx{4}{\rot{9}$v\!=\!-1$\ero}}
  +
\put(580,200){\sx{4}{\rot{9}$v\!=\!-2$\ero}}
  +
%
  +
\put(808,244){\sx{4}{\rot{0}$u\!=\!2$\ero}}
  +
\put(808,186){\sx{4}{\rot{0}$u\!=\!3$\ero}}
  +
\put(808,150){\sx{4}{\rot{0}$u\!=\!4$\ero}}
  +
%
  +
\put(1000,292){\sx{4}{\rot{-6}$v\!=\!1$\ero}}
  +
\put(1000,218){\sx{4}{\rot{-6}$v\!=\!2$\ero}}
  +
\put(1000,176){\sx{4}{\rot{-6}$v\!=\!3$\ero}}
  +
\put(1000,140){\sx{4}{\rot{-7}$v\!=\!4$\ero}}
  +
%
  +
%\put(1026,356){\sx{3.4}{\rot{66}$u\!=\!0.1$\ero}}
  +
%
  +
%\put(844,32){\sx{3.3}{\rot{98}$v\!=\!-8$\ero}}
  +
%\put(883,32){\sx{3.3}{\rot{80}$v\!=\!8$\ero}}
  +
%\put(929,32){\sx{3.3}{\rot{90}$u\!=\!8$\ero}}
  +
%\put(964,32){\sx{3.3}{\rot{70}$u\!=\!-8$\ero}}
  +
\end{picture}
  +
\end{document}
  +
  +
</nowiki></nomathjax></poem>
  +
  +
==References==
  +
<references/>
  +
  +
[[Category:Bessel function]]
  +
[[Category:BesselJ0]]
  +
[[Category:Complex map]]

Latest revision as of 08:31, 1 December 2018

Complex map of function $j_0=\,$BesselJ0:

$f=\mathrm{BesselJ}_0(x+\mathrm i y)$ is shown in the $x$,$y$ plane with

lines $u\!=\!\Re(f)\!=\!\mathrm{const}$ and lines $v\!=\!\Im(f)\!=\!\mathrm{const}$.

C++ generator of curves

Files ado.cin, besselj0.cin, conto.cin should be loaded in order to compile the code below.


#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 std::complex<double> z_type;
#define Re(x) x.real()
#define Im(x) x.imag()
#define I z_type(0.,1.)
#include "conto.cin"
#include "besselj0.cin"

int main(){ int j,k,m,n; DB x,y, p,q, t; z_type z,c,d;
int M=801,M1=M+1;
int N=401,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("besselj0map1.eps","w");ado(o,162,82);
//FILE *o;o=fopen("01.eps","w");ado(o,1620,820);
//FILE *o;o=fopen("morima4.eps","w");ado(o,1620,820);
FILE *o;o=fopen("besselj0ma4.eps","w");ado(o,1620,820);
fprintf(o,"810 410 translate\n 100 100 scale\n");
DO(m,400) X[m]=-8.+.02*m;
     X[400]=-.001;
     X[401]= .001;
for(m=402;m<M1;m++) X[m]=-8.+.02*(m-1.);
DO(n,200)Y[n]=-4.+.02*n;
      Y[200]=-.001;
      Y[201]= .001;
for(n=202;n<N1;n++) Y[n]=-4.+.02*(n-1.);
//DO(m,M1)X[m]=Y[m];
for(m=-8;m<9;m++){if(m==0){M(m,-4.1)L(m,4.1)} else{M(m,-4)L(m,4)}}
for(n=-4;n<5;n++){ M( -8,n)L(8,n)}
fprintf(o,".01 W 0 0 0 RGB S\n");
DO(m,M1)DO(n,N1){g[m*N1+n]=99999; f[m*N1+n]=99999;}
DO(m,M1){x=X[m]; //printf("%5.2f\n",x);
DO(n,N1){y=Y[n]; z=z_type(x,y);
         c=BesselJ0(z);
// c=mori(z);
     p=Re(c); q=Im(c);
     if(p>-999. && p<999. && q>-999. && q<999
     )
{g[m*N1+n]=p;
 f[m*N1+n]=q;
}
                     }}
//#include "plodi.cin"
fprintf(o,"1 setlinejoin 1 setlinecap\n"); p=4;q=.2;
for(m=-4;m<4;m++)for(n=1;n<10;n+=1)conto(o,f,w,v,X,Y,M,N,(m+.1*n),-q, q); fprintf(o,".01 W 0 .6 0 RGB S\n");
for(m=0;m<4;m++) for(n=1;n<10;n+=1)conto(o,g,w,v,X,Y,M,N,-(m+.1*n),-q, q); fprintf(o,".01 W .9 0 0 RGB S\n");
for(m=0;m<4;m++) for(n=1;n<10;n+=1)conto(o,g,w,v,X,Y,M,N, (m+.1*n),-q, q); fprintf(o,".01 W 0 0 .9 RGB S\n");
for(m=1;m<9;m++) conto(o,f,w,v,X,Y,M,N, (0.-m),-p,p); fprintf(o,".02 W .9 0 0 RGB S\n");
for(m=1;m<9;m++) conto(o,f,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".02 W 0 0 .9 RGB S\n");
                conto(o,f,w,v,X,Y,M,N, (0. ),-2*p,2*p); fprintf(o,".02 W .6 0 .6 RGB S\n");
for(m=-8;m<0;m++) conto(o,g,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".02 W 0 0 0 RGB S\n");
    m=0; conto(o,g,w,v,X,Y,M,N, (0.+m),-2*p,2*p); fprintf(o,".02 W 0 0 0 RGB S\n");
for(m=1;m<9;m++) conto(o,g,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".02 W 0 0 0 RGB S\n");
//#include "plofu.cin"
fprintf(o,"showpage\n%c%cTrailer",'%','%'); fclose(o);
     system("epstopdf besselj0ma4.eps");
     system( "open besselj0ma4.pdf");
}

Latex generator of curves


\documentclass[12pt]{article}
\paperheight 838px
\paperwidth 1644px
\textwidth 1294px
\textheight 1200px
\topmargin -80px
\oddsidemargin -80px
\usepackage{graphics}
\usepackage{rotating}
\usepackage{color}%<br>
\newcommand \sx {\scalebox}
\newcommand \rot {\begin{rotate}}
\newcommand \ero {\end{rotate}}
\newcommand \ing {\includegraphics}
\newcommand \rmi {\mathrm{i}}
\begin{document}
\newcommand \zoomax {
\put(16,820){\sx{4.4}{$y$}}
\put(16,630){\sx{4}{$2$}}
\put(16,430){\sx{4}{$0$}}
\put(-4, 230){\sx{4}{$-\!2$}}
\put(220, 5){\sx{4}{$-\!6$}}
\put(420, 5){\sx{4}{$-\!4$}}
\put(620, 5){\sx{4}{$-\!2$}}
\put(843, 5){\sx{4}{$0$}}
\put(1043, 5){\sx{4}{$2$}}
\put(1243, 5){\sx{4}{$4$}}
\put(1443, 5){\sx{4}{$6$}}
\put(1631,6){\sx{4}{$x$}}
}
\parindent 0pt
\begin{picture}(1616,816)
%\put(40,30){\sx{10}{\ing{besselj0map1}}}
%\put(40,30){\ing{02}}
%\put(40,30){\ing{morima}}
\put(40,30){\ing{besselj0ma4}}
\zoomax
\put(170,430){\sx{4}{\rot{0}$v\!=\!0$\ero}}
\put(865,470){\sx{4}{\rot{90}$v\!=\!0$\ero}}
\put(872,442){\sx{4}{\rot{47}$u\!=\!1$\ero}}
\put(860,420){\sx{4}{\rot{-48}$u\!=\!1$\ero}}
\put(630,445){\sx{3.6}{\rot{0}$v\!=\!0.1$\ero}}
%\put(660,430){\sx{4}{\rot{0}$v\!=\!0$\ero}}
\put(620,410){\sx{3.6}{\rot{0}$v\!=\!-0.1$\ero}}
%
\put(1106,390){\sx{4}{\rot{90}$u\!=\!0$\ero}}
\put(1250,390){\sx{4}{\rot{90}$v\!=\!0$\ero}}
\put(1418,390){\sx{4}{\rot{90}$u\!=\!0$\ero}}
%
\put(1570,390){\sx{4}{\rot{90}$v\!=\!0$\ero}}
\put(1456,310){\sx{4}{\rot{49}$u\!=\!0.3$\ero}}
%
\put(580,274){\sx{4}{\rot{9}$v\!=\!-1$\ero}}
\put(580,200){\sx{4}{\rot{9}$v\!=\!-2$\ero}}
%
\put(808,244){\sx{4}{\rot{0}$u\!=\!2$\ero}}
\put(808,186){\sx{4}{\rot{0}$u\!=\!3$\ero}}
\put(808,150){\sx{4}{\rot{0}$u\!=\!4$\ero}}
%
\put(1000,292){\sx{4}{\rot{-6}$v\!=\!1$\ero}}
\put(1000,218){\sx{4}{\rot{-6}$v\!=\!2$\ero}}
\put(1000,176){\sx{4}{\rot{-6}$v\!=\!3$\ero}}
\put(1000,140){\sx{4}{\rot{-7}$v\!=\!4$\ero}}
%
%\put(1026,356){\sx{3.4}{\rot{66}$u\!=\!0.1$\ero}}
%
%\put(844,32){\sx{3.3}{\rot{98}$v\!=\!-8$\ero}}
%\put(883,32){\sx{3.3}{\rot{80}$v\!=\!8$\ero}}
%\put(929,32){\sx{3.3}{\rot{90}$u\!=\!8$\ero}}
%\put(964,32){\sx{3.3}{\rot{70}$u\!=\!-8$\ero}}
\end{picture}
\end{document}

References

File history

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

Date/TimeThumbnailDimensionsUserComment
current06:10, 1 December 2018Thumbnail for version as of 06:10, 1 December 20183,425 × 1,745 (1.47 MB)Maintenance script (talk | contribs)Importing image file
  • You cannot overwrite this file.

The following page links to this file:

Metadata