File:Duration5compar2zoom.jpg
Jump to navigation
Jump to search
Size of this preview: 800 × 409 pixels. Other resolutions: 320 × 164 pixels | 1,000 × 511 pixels.
Original file (1,000 × 511 pixels, file size: 57 KB, MIME type: image/jpeg)
Summary
prepared for articles «Duration» and «Duration5».
The code is extracted from the original and slightly modified; the parameters are hardcoded in the generator below.
C++ generator
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
//#include "ju24da.cin"
double Student(int n,double x)
{double c[11]={0.,
0.31830988618379,
0.35355339059327,
0.36755259694786,
0.37500000000000,
0.37960668982249,
0.38273277230987,
0.38499145083227,
0.38669902096139,
0.38803490887167,
0.38910838396603};
return c[n]*pow(1.+x*x/n, -0.5*(n+1));
}
//#include "Student.cin"
int main(){ int n,N=5; // The 6th case is not yet comleted. Here cases are numerated beginning with 0.
FILE *o; // Input and Output pointers.
double x,y,p,q,r; // coordinates and other dummy variales
double t,T; // mean valies of data for the Linear scale and the Logarithmic scale;
//double s,S; // estimates for standard error;
//double c,C; // parameters of Student for mean value;
//double v,V; // estimates for the standard error of the mean value (width of the distribution)
double c1,C1; // parameters of the Student Distribution for next measurement
//double w,W; //estimates for the widths of distribution for the next measurement
o=fopen("22.tex","w");
fprintf(o,"\\documentclass{standalone}\n");
fprintf(o,"\\usepackage{graphicx}\n");
fprintf(o,"\\usepackage{tikz}\n");
fprintf(o,"\\newcommand \\sx {\\scalebox}\n"); // no need: \Huge does the job
fprintf(o,"\\begin{document}\n");
fprintf(o,"\\Huge\n");
fprintf(o,"\\begin{tikzpicture}[scale=2]\n");
fprintf(o,"\\draw [line width=0.8] (0,0) grid (16,8);\n");
fprintf(o,"\\draw [line width=1.8] (0,8.4) -- (0,0) -- (16.1,0) ;\n");
fprintf(o,"\\draw [line width=1.8] (10,8) -- (10,0) ;\n");
for(n=0;n<9;n+=1) fprintf(o,"\\draw (0,%d) node[left] {\\sx{1.1}{%5.3f}};\n",n,0.001*n);
for(n=0;n<15;n+=2) fprintf(o,"\\draw (%d,0) node[below] {\\sx{1.1}{%3.1f}};\n",n,.1*n);
fprintf(o,"\\draw (%d,-.1) node[below] {\\sx{1.2}{\\(x\\)}};\n",n);
t= 13.2498380526675188;
c1= 4.8036796649277438;
for(n=0;n<163;n+=10)
{ x=.01*n; y=100*Student(N-1,(x-t)/c1)/c1;
x*=10.;
y*=10.;
if(n==0) fprintf(o,"\\draw[line width=3, blue] (0,%6.3f)",y);
else fprintf(o," -- (%6.3f,%6.3f)",x,y);
//printf("curve 2: %6.4lf %6.4lf\n",x,y);
}
fprintf(o,";\n");
T=3.6595690198809008;
C1=0.5585221926655892;
for(n=1;n<204;n+=1)
{
x=.001*n*(1.+.04*n); y=100./M_LN2*Student(N-1,(log2(x)-T)/C1)/C1/x;
if(x>1.64) break;
x*=10.;
y*=10.;
if(n==1) fprintf(o,"\\draw[line width=2.4, black] (%6.3f,%6.3f)",x,y);
else fprintf(o," -- (%6.3f,%6.3f)",x,y);
printf("curve 2: %6.4lf %6.4lf\n",x,y);
}
fprintf(o,";\n");
fprintf(o,"\\end{tikzpicture}\n");
fprintf(o,"\\end{document}\n");
fclose(o);
system("pdflatex 22.tex");
system("open 22.pdf");
}
Warning
This code has no input. Values of parameters are hardcoded. The code is designed to generate only one picture above.
References
Keywords
«C++», «Duration», «Duration5», «Latex», «Student Distribution»,
File history
Click on a date/time to view the file as it appeared at that time.
| Date/Time | Thumbnail | Dimensions | User | Comment | |
|---|---|---|---|---|---|
| current | 20:14, 24 July 2025 | 1,000 × 511 (57 KB) | T (talk | contribs) | == Summary == {{oq|Duration5compar2zoom.jpg|}} Zooming of picture {{pic|Duration5compar2.jpg|200px}} prepared for articles «Duration» and «Duration5». The code is extracted from the original and slightly modified; the parameters are hardcoded in the generator below. ==C++ generator== <pre> #include <stdio.h> #include <math.h> #include <stdlib.h> //#include "ju24da.cin" double Student(int n,double x) {double c[11]={0., 0.31830988618379, 0.35355339059327, 0.36755259694786, 0.3750... |
You cannot overwrite this file.
File usage
There are no pages that use this file.