Difference between revisions of "File:CihplotT.png"

From TORI
Jump to navigation Jump to search
(Importing image file)
 
 
Line 1: Line 1:
  +
Explicit plot $y=\mathrm{Cih}(x)=\cosh(x)/x$.
Importing image file
 
  +
  +
The minimum is realized at
  +
: $x=H\approx 1.199678640257734$ ;
  +
: $J=\mathrm{Cih}(H)\approx 1.50887956153832$
  +
  +
==C++ generator of curve==
  +
  +
File [[ado.cin]] should be placed to the working directory in order to vompile 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 complex<double> z_type;
  +
#define Re(x) x.real()
  +
#define Im(x) x.imag()
  +
#define I z_type(0.,1.)
  +
#include "ado.cin"
  +
//#include "acip.cin"
  +
#define M(x,y) fprintf(o,"%6.4f %6.4f M\n",0.+x,0.+y);
  +
#define L(x,y) fprintf(o,"%6.4f %6.4f L\n",0.+x,0.+y);
  +
#define S(x,y) fprintf(o,"S\n",);
  +
main(){ int j,k,m,n; DB x,y, p,q, t; z_type z,c,d;
  +
//DB y1= 1.1996786402577337;
  +
//DB zL= 2.798386045783887;
  +
//DB fL= -0.33650841691839534;
  +
DB Ho=1.199678640257734;
  +
DB Jo=1.50887956153832;
  +
FILE *o;o=fopen("cihplot1.eps","w");ado(o,320,271);
  +
fprintf(o,"10 -90 translate\n 100 100 scale\n");
  +
for(m=0;m<4;m++){M(m,1)L(m,3.5)}
  +
for(n=1;n<4;n++){M(0,n)L(3,n)}
  +
fprintf(o,"2 setlinecap .008 W 0 0 0 RGB S\n");
  +
for(m=0;m<3;m++){M(.5+m,1)L(.5+m,3.5)}
  +
for(n=1;n<4;n++){M(0,n+.5)L(3,n+.5)}
  +
fprintf(o,"2 setlinecap .003 W 0 0 0 RGB S\n");
  +
//M(fL,zL)
  +
DO(m,274){ x=.298+.01*m;
  +
//z=x; y=Re(ACip5(z));
  +
y=cosh(x)/x;
  +
if(m==0)M(x,y) else L(x,y) }
  +
fprintf(o,"1 setlinejoin 1 setlinecap .012 W 0 .4 0 RGB S\n"); p=1.8;q=.7;
  +
// M(fL,1)L(fL,zL) L(0,zL) fprintf(o,"2 setlinecap .003 W 0 0 0 RGB S\n");
  +
M(Ho,1)L(Ho,Jo) L(0,Jo) fprintf(o,"2 setlinecap .003 W 0 0 0 RGB S\n");
  +
fprintf(o,"showpage\n%c%cTrailer",'%','%'); fclose(o);
  +
system("epstopdf cihplot1.eps");
  +
system( "open cihplot1.pdf");
  +
getchar(); system("killall Preview");//for mac
  +
}
  +
  +
==Latex generator of labels==
  +
  +
FIle [[cihplot1.pdf]] should be generated with the code above in order to compile the [[latex]] document below.
  +
<nowiki>
  +
% Copyleft 2012 by Dmitrii Kouznetsov %<br>
  +
\documentclass[12pt]{article} %<br>
  +
\usepackage{geometry} %<br>
  +
\usepackage{graphicx} %<br>
  +
\usepackage{rotating} %<br>
  +
\paperwidth 610pt %<br>
  +
\paperheight 510pt %<br>
  +
\topmargin -92pt %<br>
  +
\oddsidemargin -106pt %<br>
  +
\textwidth 900pt %<br>
  +
\textheight 900pt %<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>
  +
\parindent 0pt \sx{2}{ \begin{picture}(340,260) %<br>
  +
%\put(4,6){\ing{acosplot}} %<br>
  +
% \put(4,6){\ing{aciplot}} %<br>
  +
\put(4,6){\ing{cihplot1}} %<br>
  +
\put(16,250){\sx{1.8}{$y$}} %v
  +
\put(16,210){\sx{1.8}{\bf 3}} %<br>
  +
\put(16,160){\sx{1.8}{\bf 2.5}} %<br>
  +
\put(16,110){\sx{1.8}{\bf 2}} %<br>
  +
\put(13, 68){\sx{1.8}{$J$}} %<br>
  +
\put(12, 52){\sx{1.8}{\bf 1.5}} %<br>
  +
%\put(58, 19){\sx{2}{\bf 0}} %<br>
  +
\put(108, 19){\sx{2}{\bf 1}} %<br>
  +
\put(124, 19){\sx{2}{$H$}} %<br>
  +
\put(208, 19){\sx{2}{\bf 2}} %<br>
  +
\put(300, 21){\sx{2.1}{$x$}} %<br>
  +
\put(230,124){\sx{1.6}{\rot{54}$y\!=\!\mathrm{Cih}(x)$\ero}} \end{picture} %<br>
  +
} %<br>
  +
\end{document}
  +
  +
</nowiki>
  +
  +
[[Category:Explicit plot]]
  +
[[Category:Elementary function]]
  +
[[Category:Cih]]

Latest revision as of 09:41, 21 June 2013

Explicit plot $y=\mathrm{Cih}(x)=\cosh(x)/x$.

The minimum is realized at

$x=H\approx 1.199678640257734$ ;
$J=\mathrm{Cih}(H)\approx 1.50887956153832$

C++ generator of curve

File ado.cin should be placed to the working directory in order to vompile 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 complex<double> z_type;
#define Re(x) x.real()
#define Im(x) x.imag()
#define I z_type(0.,1.)
#include "ado.cin"
//#include "acip.cin"
#define M(x,y) fprintf(o,"%6.4f %6.4f M\n",0.+x,0.+y);
#define L(x,y) fprintf(o,"%6.4f %6.4f L\n",0.+x,0.+y);
#define S(x,y) fprintf(o,"S\n",);
main(){ int j,k,m,n; DB x,y, p,q, t; z_type z,c,d;
//DB y1= 1.1996786402577337;
//DB zL= 2.798386045783887;
//DB fL= -0.33650841691839534;
DB Ho=1.199678640257734;
DB Jo=1.50887956153832; 
FILE *o;o=fopen("cihplot1.eps","w");ado(o,320,271);
fprintf(o,"10 -90 translate\n 100 100 scale\n");
for(m=0;m<4;m++){M(m,1)L(m,3.5)}
for(n=1;n<4;n++){M(0,n)L(3,n)}
fprintf(o,"2 setlinecap .008 W 0 0 0 RGB S\n");
for(m=0;m<3;m++){M(.5+m,1)L(.5+m,3.5)}
for(n=1;n<4;n++){M(0,n+.5)L(3,n+.5)}
fprintf(o,"2 setlinecap .003 W 0 0 0 RGB S\n"); 
//M(fL,zL)
DO(m,274){ x=.298+.01*m; 
       //z=x; y=Re(ACip5(z)); 
       y=cosh(x)/x;
       if(m==0)M(x,y) else L(x,y) }
fprintf(o,"1 setlinejoin 1 setlinecap .012 W 0 .4 0 RGB S\n"); p=1.8;q=.7;
// M(fL,1)L(fL,zL) L(0,zL) fprintf(o,"2 setlinecap .003 W 0 0 0 RGB S\n");
 M(Ho,1)L(Ho,Jo) L(0,Jo) fprintf(o,"2 setlinecap .003 W 0 0 0 RGB S\n");
fprintf(o,"showpage\n%c%cTrailer",'%','%'); fclose(o);
     system("epstopdf cihplot1.eps");
     system(    "open cihplot1.pdf");
     getchar(); system("killall Preview");//for mac
}

Latex generator of labels

FIle cihplot1.pdf should be generated with the code above in order to compile the latex document below. % Copyleft 2012 by Dmitrii Kouznetsov %<br> \documentclass[12pt]{article} %<br> \usepackage{geometry} %<br> \usepackage{graphicx} %<br> \usepackage{rotating} %<br> \paperwidth 610pt %<br> \paperheight 510pt %<br> \topmargin -92pt %<br> \oddsidemargin -106pt %<br> \textwidth 900pt %<br> \textheight 900pt %<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> \parindent 0pt \sx{2}{ \begin{picture}(340,260) %<br> %\put(4,6){\ing{acosplot}} %<br> % \put(4,6){\ing{aciplot}} %<br> \put(4,6){\ing{cihplot1}} %<br> \put(16,250){\sx{1.8}{$y$}} %v \put(16,210){\sx{1.8}{\bf 3}} %<br> \put(16,160){\sx{1.8}{\bf 2.5}} %<br> \put(16,110){\sx{1.8}{\bf 2}} %<br> \put(13, 68){\sx{1.8}{$J$}} %<br> \put(12, 52){\sx{1.8}{\bf 1.5}} %<br> %\put(58, 19){\sx{2}{\bf 0}} %<br> \put(108, 19){\sx{2}{\bf 1}} %<br> \put(124, 19){\sx{2}{$H$}} %<br> \put(208, 19){\sx{2}{\bf 2}} %<br> \put(300, 21){\sx{2.1}{$x$}} %<br> \put(230,124){\sx{1.6}{\rot{54}$y\!=\!\mathrm{Cih}(x)$\ero}} \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 20131,267 × 1,059 (87 KB)Maintenance script (talk | contribs)Importing image file

The following page uses this file:

Metadata