home *** CD-ROM | disk | FTP | other *** search
- /* This example shows how invisible axes can be used to establish */
- /* an alternate coordinate system and still use the drawdata function */
- /* to draw the curves */
-
- /*draws quantum wells and wave functions */
- #include <splot.h>
- double *data1;
- double *data2;
- double *data3;
- double *data4;
- double *data5;
- main()
- {
- set(LINECOLOUR,INVIS);
- set(FONTWIDTH,0.6);
- set(FONTASPECT,1.4);
- set(LINEWIDTH,0.02);
- /* read in data generated by Mathematica */
- readdata("demo\cdqw_wfc.dat",data1);
- readdata("demo\cdqw_wfc.da2",data2);
- readdata("demo\cdqw_wfc.da3",data3);
- readdata("demo\cdqw_wfc.da4",data4);
- readdata("demo\cdqw_wfc.da5",data5);
- /* drawing turned out too big so reduce the overall size */
- scale(0.7,0.65);
- gsave();
- axes_box(8,15,-185,0.0,185,188.36);
- set(LINECOLOUR,BLACK);
- translate(-1.25,22.5);
- /* even solns to cdqw */
- /* norm = 1.0/0.00009134 * 60.0; */
- set(YMULT,656886.);
- set(YSHIFT,9.13863);
- drawdata(data1);
- /* norm = 1/.0002838 * 60.0; */
- set(YMULT,211416.);
- set(YSHIFT,35.8858);
- drawdata(data1,0,3);
- /* norm = 1/0.008109 * 60.0;*/
- set(YMULT,7400.);
- set(YSHIFT,77.0532);
- drawdata(data3);
- /* call subroutine to draw quantum well. Also sets coordinate scale to match*/
- s_qw_box();
- /* energy eigenvalues */
- moveto(-190,9.13863);
- lineto(190,9.13863);
- moveto(-190,35.8858);
- lineto(190,35.8858);
- moveto(-190,77.0532);
- lineto(190,77.0532);
- stroke();
- text(205,9.13863,"E_0_");
- text(205,35.8858,"E_2_");
- text(205,77.0532,"E_4_");
- text(0,-15,"a) CDQW, even solutions",CENTER);
- grestore();
- /* odd solns to cdqw */
- set(LINECOLOUR,INVIS);
- gsave();
- axes_box(8,15,-185,0.0,185,188.36);
- set(LINECOLOUR,BLACK);
- translate(11,22.5);
- set(YMULT,656886.);
- set(YSHIFT,9.14186);
- drawdata(data1,0,2);
- set(YMULT,211416.);
- set(YSHIFT,35.9177);
- drawdata(data1,0,4);
- set(YMULT,7400.);
- set(YSHIFT,77.4394);
- drawdata(data3,0,2);
- s_qw_box();
- /* energy eigenvalues */
- moveto(-190,9.14186);
- lineto(190,9.14186);
- moveto(-190,35.9177);
- lineto(190,35.9177);
- moveto(-190,77.4394);
- lineto(190,77.4394);
- stroke();
- text(-227,9.14186,"E_1_");
- text(-227,35.9177,"E_3_");
- text(-227,77.4394,"E_5_");
- text(217.,53.,"107meV",CENTER);
- text(0,120,"9 nm",CENTER);
- text(0,-15,"b) CDQW, odd solutions",CENTER);
- grestore();
- /*asymmetric coupled wells */
- set(LINECOLOUR,INVIS);
- gsave();
- axes_box(8,15,-185,0.0,185,188.36);
- set(LINECOLOUR,BLACK);
- translate(5.5,2.5);
- set(YMULT,1000.);
- set(YSHIFT,90.23);
- set(XSHIFT,-95.);
- drawdata(data4,0,2);
- a_qw_box();
- moveto(-195,90.23);
- lineto(190,90.23);
- stroke();
- text(215,90.23,"E_2_",CENTER);
- text(280,90.23,"Resonance");
- text(-270.,104.,"188 meV",CENTER);
- grestore();
- set(LINECOLOUR,INVIS);
- gsave();
- axes_box(8,15,-185,0.0,185,188.36);
- set(LINECOLOUR,BLACK);
- translate(5.5,2.5);
- set(XSHIFT,-95.);
- set(YMULT,-80.0);
- set(YSHIFT,10.29);
- drawdata(data5);
- set(YMULT,-80.0);
- set(YSHIFT,40.81);
- drawdata(data5,0,2);
- set(YMULT,-275.0);
- set(YSHIFT,154.16);
- drawdata(data5,0,3);
- set(YSHIFT,116.97);
- set(YMULT,500.0);
- a_qw_box();
- moveto(-190,10.29);
- lineto(190,10.29);
- moveto(-190,40.81);
- lineto(190,40.81);
- moveto(-190,154.16);
- lineto(190,154.16);
- stroke();
- text(215,10.29,"E_0_",CENTER);
- text(215,40.81,"E_1_",CENTER);
- text(215,154.16,"E_5_",CENTER);
- text(0,200,"c) Asymmetric CDQW",CENTER);
- grestore();
- set(LINECOLOUR,BLACK);
- set(FONTWIDTH,1.);
- set(FONTASPECT,2.5);
- moveto(20.91,36.9);
- arrowto(20.0,36.9);
- moveto(20.91,36.9);
- arrowto(22.0,36.9);
- moveto(25.5,33.02);
- arrowto(25.5,36.53);
- moveto(25.5,31.79);
- arrowto(25.5,27.95);
- moveto(9.9,16.90);
- arrowto(9.9,23.02);
- moveto(9.9,15.70);
- arrowto(9.9,7.93);
- moveto(21.4,15.14);
- arrowto(20.8,15.14);
- stroke();
- }
-
- int s_qw_box()
- {
- set(LINEWIDTH,0.06);
- cmatch();
- /* draw quantum well box */
- moveto(-225.,107.27);
- lineto(-145.,107.27);
- lineto(-145.,0.);
- lineto(-45.,0.);
- lineto(-45.,107.27);
- lineto(45.,107.27);
- lineto(45.,0.);
- lineto(145.,0.);
- lineto(145.,107.27);
- lineto(225.,107.27);
- stroke();
- set(LINEWIDTH,0.02);
- }
-
- int a_qw_box()
- {
- set(LINEWIDTH,0.06);
- cmatch();
- /* draw quantum well box */
- moveto(-225.,188.36);
- lineto(-145.,188.36);
- lineto(-145.,0.);
- lineto(-45.,0.);
- lineto(-45.,188.36);
- lineto(45.,188.36);
- /* 188.36-107.27 */
- lineto(45.,81.09);
- lineto(145.,81.09);
- lineto(145.,188.36);
- lineto(225,188.36);
- stroke();
- set(LINEWIDTH,0.02);
- }
-
-