File:Sunemplo4t.jpg

From TORI
Revision as of 08:53, 1 December 2018 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Original file(846 × 2,092 pixels, file size: 203 KB, MIME type: image/jpeg)

[Explicit plot]] of function SuNem for vationus values of parameter.

$y=\mathrm{SuNem}_q(x)~ ~ $ versus $x$ for

$q\!=\!0$, (black)

$q\!=\!0.5$, (pink)

$q\!=\!1$, (red)

$q\!=\!2$, (green)

$q\!=\!3$, (blue)


Description

References


C++ generator of curves

Files ado.cin, conto.cin, sune.cin, sunema.txt should be loaded in order 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;
#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 "ado.cin"
#define M(x,y) fprintf(o,"%8.4lf %8.4lf M\n",0.+x,0.+y);
#define L(x,y) fprintf(o,"%8.4lf %8.4lf L\n",0.+x,0.+y);

DB Q;
z_type nem(z_type z){ return z*(1.+z*z*(1.+z*Q)); }
z_type nem1(z_type z){ return 1.+z*z*(3.+z*(4.*Q)); } // WARNING: Q is global!

// DB Q=2.;
// z_type nem(z_type z){ return z*(1.+z*z*(1.+z*Q)); }
// z_type nem1(z_type z){ return 1.+z*z*(3.+z*(4.*Q)); } // WARNING: Q is global!

/*

DB K=Q*Q;
DB A[37][19];
int co(){
#include "sunema.txt"
return 0;}

z_type sun(z_type z){ z_type p[37],s; int m,M,n,N;
z_type L=log(-z);
z_type t=1./sqrt(-2.*z);
M=36;
//M=10;
for(m=2;m<M+1;m++){ N=m/2; s=A[m][N]*L; for(n=N-1;n>0;n--) { s+=A[m][n]; s*=L; }
                p[m]=A[m][0]+s;
                }
s=p[M]*t; for(m=M-1; m>1;m--) { s+=p[m]; s*=t;}
        return t*( 1. + t* (-Q + s) );
}

z_type sune(z_type z){ int m,n; DB x,y; z_type s;
//DB R=20.+20.*Q*Q;
DB R=20.+20.*Q*Q;
x=Re(z); if(x<-R) return sun(z);
y=Im(z); if(fabs(y)>R) return sun(z);
n=int(x+R);
s=sun(z-(0.+n));
DO(m,n) s=nem(s);
return s;
}
*/
#include "sune.cin"

DB SUNo=0;

z_type sunem(z_type z){ return sune(z + SUNo);}

int main(){ int Max; int j,k,m,n; DB x,y, p,q, t; z_type z,c,d;
// DB rr,ti;
FILE *o;o=fopen("sunemplo4.eps","w");ado(o,420,1020);
fprintf(o,"210 10 translate\n 100 100 scale 2 setlinecap\n");
for(m=-2;m<3;m+=1){ M(m,0)L(m,10)}
for(n=0;n<11;n+=1){ M(-2,n)L(2,n)}
fprintf(o,".008 W 0 0 0 RGB 2 setlinecap S\n");


Q=0; K=Q*Q; x=0; co(); printf("Q=%9.4lf\n",Q);
DO(n,50) { y=Re(sunem(0)); SUNo-= y-1.; printf("%19.16lf %19.16lf\n", SUNo,y);} // getchar();
DO(n,402){ x=-2.01+.01*n; y=Re(sunem(x)); if(n==0) M(x,y) else L(x,y); printf("%6.1lf %18.15lf\n", x,y); if(y>10) break;}
fprintf(o,".02 W 0 0 0 RGB 1 setlinejoin S\n");

Q=.5; K=Q*Q; x=0; co(); printf("Q=%9.4lf\n",Q);
DO(n,50) { y=Re(sunem(0)); SUNo-= y-1.; printf("%19.16lf %19.16lf\n", SUNo,y);} // getchar();
DO(n,400){ x=-2.01+.01*n; y=Re(sunem(x)); if(n==0) M(x,y) else L(x,y); printf("%6.1lf %18.15lf\n", x,y); if(y>10) break;}
fprintf(o,".01 W .7 0 .6 RGB 1 setlinejoin S\n");


Q=1; K=Q*Q; x=0; co(); printf("Q=%9.4lf\n",Q);
DO(n,50) { y=Re(sunem(0)); SUNo-= y-1.; printf("%19.16lf %19.16lf\n", SUNo,y);} // getchar();
DO(n,400){ x=-2.01+.01*n; y=Re(sunem(x)); if(n==0) M(x,y) else L(x,y); printf("%6.1lf %18.15lf\n", x,y); if(y>10) break;}
fprintf(o,".02 W .8 .2 0 RGB 1 setlinejoin S\n");

Q=2; K=Q*Q; x=0; co(); printf("Q=%9.4lf\n",Q);
DO(n,50) { y=Re(sunem(0)); SUNo-= y-1.; printf("%19.16lf %19.16lf\n", SUNo,y);} // getchar();
DO(n,400){ x=-2.01+.01*n; y=Re(sunem(x)); if(n==0) M(x,y) else L(x,y); printf("%6.1lf %18.15lf\n", x,y); if(y>10) break;}
fprintf(o,".02 W 0 .6 0 RGB 1 setlinejoin S\n");

/*
Q=3; K=Q*Q; SUNo=-2.; co(); printf("Q=%9.4lf\n",Q);
DO(n,50) { y=Re(sunem(0)); SUNo-= y-1.; printf("%19.16lf %19.16lf\n", SUNo,y);} // getchar();
DO(n,40){ x=-2.01+.1*n; y=Re(sunem(x)); if(n==0) M(x,y) else L(x,y); printf("%6.1lf %18.15lf\n", x,y); if(y>10) break;}
fprintf(o,".02 W 0 0 .8 RGB 1 setlinejoin S\n");

Q=4; K=Q*Q; SUNo=-8.; co(); printf("Q=%9.4lf\n",Q);
DO(n,50) { y=Re(sunem(0)); SUNo-= y-1.; printf("%19.16lf %19.16lf\n", SUNo,y);} // getchar();
DO(n,40){ x=-2.01+.1*n; y=Re(sunem(x)); if(n==0) M(x,y) else L(x,y); printf("%6.1lf %18.15lf\n", x,y); if(y>10) break;}
fprintf(o,".02 W 0 0 .8 RGB 1 setlinejoin S\n");

Q=5; K=Q*Q; SUNo=-20.; co(); printf("Q=%9.4lf\n",Q);
DO(n,50) { y=Re(sunem(0)); SUNo-= y-1.; printf("%19.16lf %19.16lf\n", SUNo,y);} // getchar();
DO(n,40){ x=-2.01+.1*n; y=Re(sunem(x)); if(n==0) M(x,y) else L(x,y); printf("%6.1lf %18.15lf\n", x,y); if(y>10) break;}
fprintf(o,".02 W 0 0 .8 RGB 1 setlinejoin S\n");

Q=6; K=Q*Q; SUNo=-30.; co(); printf("Q=%9.4lf\n",Q);
DO(n,50) { y=Re(sunem(0)); SUNo-= y-1.; printf("%19.16lf %19.16lf\n", SUNo,y);} // getchar();
DO(n,40){ x=-2.01+.1*n; y=Re(sunem(x)); if(n==0) M(x,y) else L(x,y); printf("%6.1lf %18.15lf\n", x,y); if(y>10) break;}
fprintf(o,".02 W 0 0 .8 RGB 1 setlinejoin S\n");

Q=7; K=Q*Q; SUNo=-60.; co(); printf("Q=%9.4lf\n",Q);
DO(n,50) { y=Re(sunem(0)); SUNo-= y-1.; printf("%19.16lf %19.16lf\n", SUNo,y);} // getchar();
DO(n,40){ x=-2.01+.1*n; y=Re(sunem(x)); if(n==0) M(x,y) else L(x,y); printf("%6.1lf %18.15lf\n", x,y); if(y>10) break;}
fprintf(o,".02 W 0 0 .8 RGB 1 setlinejoin S\n");
*/
Q=8; K=Q*Q; SUNo=-100.; co(); printf("Q=%9.4lf\n",Q);
DO(n,50) { y=Re(sunem(0)); SUNo-= y-1.; printf("%19.16lf %19.16lf\n", SUNo,y);} // getchar();
DO(n,400){ x=-2.01+.01*n; y=Re(sunem(x)); if(n==0) M(x,y) else L(x,y); printf("%6.1lf %18.15lf\n", x,y); if(y>10) break;}
fprintf(o,".015 W 0 0 .8 RGB 1 setlinejoin S\n");

/*
Q=10; K=Q*Q; SUNo=-150.; co(); printf("Q=%9.4lf\n",Q);
DO(n,50) { y=Re(sunem(0)); SUNo-= y-1.; printf("%19.16lf %19.16lf\n", SUNo,y);} // getchar();
DO(n,400){ x=-2.01+.01*n; y=Re(sunem(x)); if(n==0) M(x,y) else L(x,y); printf("%6.1lf %18.15lf\n", x,y); if(y>10) break;}
fprintf(o,".015 W 0 0 .8 RGB 1 setlinejoin S\n");
*/

fprintf(o,"showpage\n%cTrailer",'%'); fclose(o);

        system("epstopdf sunemplo4.eps");
        system( "open sunemplo4.pdf"); //mac

return 0;
}

Latex generator of curves


\documentclass{mcom-l}
% \documentclass[12pt]{article}
 \usepackage{graphics}
 \paperwidth 408pt
 \paperheight 1008pt
 \usepackage{geometry}
 \usepackage{rotating}
 \textwidth 2560pt
 \textheight 2260pt
 \topmargin -98pt
 \oddsidemargin -84pt
 \parindent 0pt
 \pagestyle{empty}
\newcommand \ing {\includegraphics}
\newcommand \sx {\scalebox}
\newcommand \rot {\begin{rotate}}
\newcommand \ero {\end{rotate}}
\begin{document}

\begin{picture}(620,1020)
\put(4,0){\ing{sunemplo4}}
\put(224,1000){\sx{3.4}{$y$}}
\put(224,900){\sx{3.2}{$9$}}
\put(224,800){\sx{3.2}{$8$}}
\put(224,700){\sx{3.2}{$7$}}
\put(224,600){\sx{3.2}{$6$}}
\put(224,500){\sx{3.2}{$5$}}
\put(224,400){\sx{3.2}{$4$}}
\put(224,300){\sx{3.2}{$3$}}
\put(224,200){\sx{3.2}{$2$}}
\put(225, 99){\sx{3.2}{$1$}}
%\put(420, -7){\sx{3.3}{$0$}}
\put( 88,14){\sx{3.3}{$-1$}}
\put(207,14){\sx{3.3}{$0$}}
\put(308,14){\sx{3.3}{$1$}}
\put(398,14){\sx{3.4}{$x$}}
\put(322,932){\sx{3.4}{\rot{88}$q\!=\!8$\ero}}%
\put(348,834){\sx{3.4}{\rot{87}$q\!=\!2$\ero}}%
\put(361,734){\sx{3.4}{\rot{86}$q\!=\!1$\ero}}%
\put(372,614){\sx{3.4}{\rot{85}$q\!=\!0.5$\ero}}%
\put(392,518){\sx{3.4}{\rot{83}$q\!=\!0$\ero}}%
\end{picture}
\end{document}

File history

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

Date/TimeThumbnailDimensionsUserComment
current06:14, 1 December 2018Thumbnail for version as of 06:14, 1 December 2018846 × 2,092 (203 KB)Maintenance script (talk | contribs)Importing image file

The following 2 pages use this file:

Metadata