#=============================================== # TkCarrierTransport #=============================================== package TkCarrierTransport; use clib::TkFittingCommon; @ISA = qw(TkFittingCommon); #公開したいサブルーチン #@EXPORT = qw(DelSpace Reduce01 MakePath RegExpQuote); use strict; use Utils; use IniFile; use CSV; use MyTk::GraphFrameArray; use GraphData; use MultiColumnData; use Sci qw($pi $kB $e $e0 $me $h $hbar $KToeV erfc); use Sci::ConductingMaterial; use Sci::Optimize; #============================================================ # 変数等取得関数 #============================================================ #============================================================ # コンストラクタ、デストラクタ #============================================================ #呼び出されることはない sub new { my ($module, $app) = @_; my $this = {}; bless $this; return $this;} sub DESTROY { my $this = shift; $this->SUPER::DESTROY(@_); } #============================================================ # 継承クラスで定義しなおす関数 #============================================================ sub CreateLeftFrame { my ($this, $ConfigSide, @args) = @_; # return $this->SUPER::CreateLeftFrame(); return undef; } sub CreateSelectFilePane { my ($this) = @_; # return $this->SUPER::CreateSelectFilePane(); return undef; } sub CreateFileContentPane { return undef; } sub CreateWidgets { my ($this, $DoSuperOnly) = @_; $DoSuperOnly = 0 if(!defined $DoSuperOnly); my $App = $this->App(); my $args = $App->Args(); my $mw = $this->mw(); my $Program = "Carrier Transport2007"; $this->{ini} = new ConductingMaterial(); $this->{dini} = new ConductingMaterial(); $this->InitializeParameters($this->{ini}, $this->{dini}); $this->{DataFile} = new MultiColumnData; $this->SUPER::CreateWidgets(); return if($DoSuperOnly); $mw->SetTitle("$Program / TkPlot"); $this->App()->SetProgram("$Program / TkPlot"); #=================================================== # ペインを作製 #=================================================== my $EntryWidth = 12; my $Frame = $mw->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->MakeChooseFileEntry($Frame, 'Param', 'Param:', $this->{ini}->pVariable("ParameterFile", ""), '&Choose', sub { $this->ChooseFile(@_); }, "ChooseParameterFile"); $this->{SaveParamButton} = $Frame->MyButton( -text => '&Save', -takefocus => 1, -command => sub { $this->ButtonPressed('RButtonDown', 'SaveParam'); }, )->pack(-side => 'left'); $this->{EditParamButton} = $Frame->MyButton( -text => 'ed', -takefocus => 1, -command => sub { $this->ButtonPressed('RButtonDown', 'EditParam'); }, )->pack(-side => 'left'); $Frame = $mw->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->MakeChooseFileEntry($Frame, 'SampleCSV', 'Sample:', $this->{ini}->pVariable("SampleCSVFile", ""), '&Choose', sub { $this->ChooseFile(@_); }, "ChooseSampleFile"); $this->{EditDataButton} = $Frame->MyButton( -text => 'ed', -takefocus => 1, -command => sub { $this->ButtonPressed('RButtonDown', 'EditSampleCSV'); }, )->pack(-side => 'left'); $Frame = $mw->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->{ChooseXListBox} = $Frame->MyBrowseEntry( -label => "X:", -state => "readonly", -takefocus => 1, -width => 5, -Selections => [], -SelIndex => 0, )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); $this->{ChooseXListBox}->configure(-browsecmd => sub { $this->SelChangeListBox("X", $this->{ChooseXListBox}); } ); $this->{ChooseY1ListBox} = $Frame->MyBrowseEntry( -label => "Y1:", -state => "readonly", -takefocus => 1, -width => 5, -Selections => [], -SelIndex => 1, )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); $this->{ChooseY2ListBox} = $Frame->MyBrowseEntry( -label => "Y2:", -state => "readonly", -takefocus => 1, -width => 5, -Selections => [], -SelIndex => 1, )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); $Frame = $mw->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->MakeLabelEntry($Frame, "FitXMin", "XMin:", $this->{ini}->pVariable('FitXMin', ''), "%s", $EntryWidth, "", 0, 0); $this->MakeLabelEntry($Frame, "FitXMax", "XMax:", $this->{ini}->pVariable('FitXMax', ''), "%s", $EntryWidth, "", 0, 1); $this->MakeLabelEntry($Frame, "nSkipData", "nSkip:", $this->{ini}->pVariable('nSkipData', 0), "%d", $EntryWidth, "", 0, 2); $this->MakeLabelEntry($Frame, "EPS", "EPS:", $this->{ini}->pVariable('EPS', 1.0e-5), "%12.4g", $EntryWidth, "", 1, 0); $this->MakeLabelEntry($Frame, "nMaxIter", "MaxIter:", $this->{ini}->pVariable('nMaxIter', 1000), "%d", $EntryWidth, "", 1, 1); $this->MakeLabelEntry($Frame, "nSaveSpectraInterval", "SaveIntvl:", $this->{ini}->pVariable('nSaveSpectraInterval', 10), "%d", $EntryWidth, "", 1, 2); $Frame = $mw->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->{ChooseLSQMethodListBox} = $Frame->MyBrowseEntry( -label => "LSQ Method:", -state => "readonly", -takefocus => 1, -width => 5, -Selections => ['Amoeba::Simplex', 'PDL::Simplex', 'ModifiedNewton'], -SelIndex => 0, )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); $this->{ChooseFitToListBox} = $Frame->MyBrowseEntry( -label => "Fit To:", -state => "readonly", -takefocus => 1, -width => 10, -Selections => ['Ne,sigma', 'Ne,ue', 'Ne', 'sigma', 'ue'], -SelIndex => 1, )->pack(-side => 'left', -expand => 'yes', -fill => 'x'); $Frame = $mw->MyLabFrame( -label => 'Simulation', -labelside => 'acrosstop', )->pack(-anchor => 'nw'); $this->MakeLabelEntry($Frame, "Tstart", "T:", $this->{ini}->pVariable('Tstart', 40.0), "%g", $EntryWidth, "", 0, 0); $this->MakeLabelEntry($Frame, "Tend", "-", $this->{ini}->pVariable('Tend', 350.0), "%g", $EntryWidth, "K", 0, 1); $this->MakeLabelEntry($Frame, "Tstep", "Step", $this->{ini}->pVariable('Tstep', 20.0), "%g", $EntryWidth, "K", 0, 2); $Frame = $mw->MyLabFrame( -label => 'Integration', -labelside => 'acrosstop', )->pack(-anchor => 'nw'); $this->MakeLabelEntry($Frame, "dE", "dE:", $this->{ini}->pVariable('dE', 0.1), "%g", $EntryWidth, "kBT", 0, 0); $this->MakeLabelEntry($Frame, "KIntegrationErange", "Krange:", $this->{ini}->pVariable('KIntegrationErange', 20), "%g", $EntryWidth, "kBT", 0, 1); $Frame = $mw->MyLabFrame( -label => 'Fermi-Dirac distribution', -labelside => 'acrosstop', )->pack(-anchor => 'nw'); $this->MakeLabelEntry($Frame, "T", "T:", $this->{ini}->pVariable('T', 300.0), "%g", $EntryWidth, "K", 0, 0); $this->MakeLabelEntry($Frame, "EFEPS", "EF EPS:", $this->{ini}->pVariable('EFEPS', 1.0e-6), "%12.4g", $EntryWidth, "", 0, 1); $this->MakeLabelEntry($Frame, "S EPS", "S EPS:", $this->{ini}->pVariable('EFSEPS', 1.0e-15), "%12.4g", $EntryWidth, "", 0, 2); $Frame = $mw->MyLabFrame( -label => 'Conduction band', -labelside => 'acrosstop', )->pack(-anchor => 'nw'); $this->MakeCheckEntry($Frame, "Ec", "Ec:", $this->{dini}->pVariable('Eccheck', 0), $this->{ini}->pVariable('Ec', 3.0), "%g", $EntryWidth, "", 0, 0); # $this->MakeLabelEntry($Frame, "Ec", "Ec:", # $this->{ini}->pVariable('Ec', 3.0), "%g", $EntryWidth, "eV", 0, 0); $this->MakeLabelEntry($Frame, "Effme", "me:", $this->{ini}->pVariable('Effme', 0.35), "%g", $EntryWidth, "me", 0, 1); $this->MakeLabelEntry($Frame, "CBMultiplicity", "M:", $this->{ini}->pVariable('CBMultiplicity', 1.0), "%g", $EntryWidth, "", 0, 2); $this->MakeLabelEntry($Frame, "Nc", "Nc:", $this->{ini}->pVariable('Nc', 0.0), "%g", $EntryWidth, "cm-3", 1, 0, "disable"); $this->MakeLabelEntry($Frame, "Dc0", "Dc0:", $this->{ini}->pVariable('Dc0', 0.0), "%g", $EntryWidth, "cm^-3/eV^1.5", 1, 1, "disable"); $Frame = $mw->MyLabFrame( -label => 'Valence band', -labelside => 'acrosstop', )->pack(-anchor => 'nw'); $this->MakeLabelEntry($Frame, "Ev", "Ev:", $this->{ini}->pVariable('Ev', 0.0), "%g", $EntryWidth, "eV", 0, 0); $this->MakeLabelEntry($Frame, "Effmh", "mh:", $this->{ini}->pVariable('Effmh', 1.5), "%g", $EntryWidth, "me", 0, 1); $this->MakeLabelEntry($Frame, "VBMultiplicity", "M:", $this->{ini}->pVariable('VBMultiplicity', 1.0), "%g", $EntryWidth, "", 0, 2); $this->MakeLabelEntry($Frame, "Nv", "Nv:", $this->{ini}->pVariable('Nv', 0.0), "%g", $EntryWidth, "cm-3", 1, 0, "disable"); $this->MakeLabelEntry($Frame, "Dv0", "Dv0:", $this->{ini}->pVariable('Dv0', 0.0), "%g", $EntryWidth, "cm^-3/eV^1.5", 1, 1, "disable"); if(1) { $Frame = $mw->MyLabFrame( -label => 'Scattering', -labelside => 'acrosstop', )->pack(-anchor => 'nw'); $this->MakeCheckEntry($Frame, "tau0", "tau0:", $this->{dini}->pVariable('tau0check', 0), $this->{ini}->pVariable('tau0', 4.0e-15), "%g", $EntryWidth, "", 0, 0); $this->MakeCheckEntry($Frame, "r", "r:", $this->{dini}->pVariable('rcheck', 0), $this->{ini}->pVariable('r', 0.5), "%g", $EntryWidth, "", 0, 1); $this->MakeCheckEntry($Frame, "PowerT", "pT:", $this->{dini}->pVariable('PowerTcheck', 0), $this->{ini}->pVariable('PowerT', 0.0), "%g", $EntryWidth, "", 0, 2); $this->MakeCheckEntry($Frame, "tau02", "tau0:", $this->{dini}->pVariable('tau02check', 0), $this->{ini}->pVariable('tau02', 0.0), "%g", $EntryWidth, "", 1, 0); $this->MakeCheckEntry($Frame, "r2", "r:", $this->{dini}->pVariable('r2check', 0), $this->{ini}->pVariable('r2', 0.0), "%g", $EntryWidth, "", 1, 1); $this->MakeCheckEntry($Frame, "PowerT2", "pT:", $this->{dini}->pVariable('PowerT2check', 0), $this->{ini}->pVariable('PowerT2', 0.0), "%g", $EntryWidth, "", 1, 2); } $Frame = $mw->MyLabFrame( -label => 'Doping', -labelside => 'acrosstop', )->pack(-anchor => 'nw'); $this->MakeCheckEntry($Frame, "ND", "ND:", $this->{dini}->pVariable('NDcheck', 0), $this->{ini}->pVariable('ND', 1.0e18), "%g", $EntryWidth, "cm-3", 0, 0); $this->MakeCheckEntry($Frame, "ED", "ED:", $this->{dini}->pVariable('EDcheck', 0), $this->{ini}->pVariable('ED', 2.955), "%g", $EntryWidth, "eV", 0, 1); $this->MakeCheckEntry($Frame, "NA", "NA:", $this->{dini}->pVariable('NAcheck', 0), $this->{ini}->pVariable('NA', 0.0), "%g", $EntryWidth, "cm-3", 1, 0); $this->MakeCheckEntry($Frame, "EA", "EA:", $this->{dini}->pVariable('EAcheck', 0), $this->{ini}->pVariable('EA', 0.045), "%g", $EntryWidth, "eV", 1, 1); if(0) { $this->MakeCheckEntry($Frame, "ND2", "ND2:", $this->{dini}->pVariable('ND2check', 0), $this->{ini}->pVariable('ND2', 0.0), "%g", $EntryWidth, "cm-3", 2, 0); $this->MakeCheckEntry($Frame, "ED2", "ED2:", $this->{dini}->pVariable('ED2check', 0), $this->{ini}->pVariable('ED2', 2.800), "%g", $EntryWidth, "eV", 2, 1); $this->MakeCheckEntry($Frame, "NA2", "NA2:", $this->{dini}->pVariable('NA2check', 0), $this->{ini}->pVariable('NA2', 0.0), "%g", $EntryWidth, "cm-3", 3, 0); $this->MakeCheckEntry($Frame, "EA2", "EA2:", $this->{dini}->pVariable('EA2check', 0), $this->{ini}->pVariable('EA2', 0.230), "%g", $EntryWidth, "eV", 3, 1); } if(0) { $Frame = $mw->MyLabFrame( -label => 'Tail state', -labelside => 'acrosstop', )->pack(-anchor => 'nw'); $this->MakeLabelEntry($Frame, "Nctail", "Nctail:", $this->{ini}->pVariable('Nctail', 0.0), "%g", $EntryWidth, "cm-3", 0, 0); $this->MakeLabelEntry($Frame, "Ecu", "Ecu:", $this->{ini}->pVariable('Ecu', 0.01), "%g", $EntryWidth, "eV", 0, 1); $this->MakeLabelEntry($Frame, "Ecconnect", "Ecc:", $this->{ini}->pVariable('Ecconnect', 3.05), "%g", $EntryWidth, "eV", 0, 2); $this->MakeLabelEntry($Frame, "Nvtail", "Nvtail:", $this->{ini}->pVariable('Nvtail', 0.0), "%g", $EntryWidth, "cm-3", 1, 0); $this->MakeLabelEntry($Frame, "Evu", "Evu:", $this->{ini}->pVariable('Evu', 0.01), "%g", $EntryWidth, "eV", 1, 1); $this->MakeLabelEntry($Frame, "Evconnect", "Evc:", $this->{ini}->pVariable('Evconnect', -0.05), "%g", $EntryWidth, "eV", 1, 2); } if(1) { $Frame = $mw->MyLabFrame( -label => 'Percolation', -labelside => 'acrosstop', )->pack(-anchor => 'nw'); $this->MakeCheckEntry($Frame, "Ecenter", "Ecenter:", $this->{dini}->pVariable('Ecentercheck', 0), $this->{ini}->pVariable('Ecenter', 3.00), "%g", $EntryWidth, "eV", 0, 0); $this->MakeCheckEntry($Frame, "E0", "E0:", $this->{dini}->pVariable('E0check', 0), $this->{ini}->pVariable('E0', 0.0), "%g", $EntryWidth, "eV", 0, 1); $Frame = $mw->MyLabFrame( -label => 'Others', -labelside => 'acrosstop', )->pack(-anchor => 'nw'); $this->MakeLabelEntry($Frame, "Eg", "Eg:", $this->{ini}->pVariable('Eg', 0.0), "%g", $EntryWidth, "eV", 0, 0, "disable"); } $this->UpdateParameters(); $Frame = $mw->MyFrame()->pack(-anchor => 'nw', -fill => 'x'); $this->{RecalcButton} = $Frame->MyButton( -text => 'Re&calc', -takefocus => 1, -command => sub { $this->ButtonPressed('RButtonDown', 'Recalc'); }, )->pack(-side => 'left'); $this->{FitButton} = $Frame->MyButton( -text => '&Fit', -takefocus => 1, -command => sub { $this->ButtonPressed('RButtonDown', 'Fit'); }, )->pack(-side => 'left'); $this->{CalAllButton} = $Frame->MyButton( -text => 'Cal All', -takefocus => 1, -command => sub { $this->ButtonPressed('RButtonDown', 'CalAll'); }, )->pack(-side => 'left'); $this->{SaveAllButton} = $Frame->MyButton( -text => 'Save All', -takefocus => 1, -command => sub { $this->ButtonPressed('RButtonDown', 'SaveAll'); }, )->pack(-side => 'left'); #ツールバーのOpenボタンをファイル読み込みにバインドする $mw->{OpenButton}->configure( -command => sub { $this->ChooseFile('SampleCSV', $this->{SPEFileFileEntry}); }, ) if($mw->{OpenButton}); } sub Initialize { my ($this, $InitializeParameterFile, $InitializeData) = @_; $this->{DataFile} = new Ellipsometry; if($InitializeParameterFile) { $this->{ini}->{SampleCSVFile} = ''; $this->{ini}->{FitXMin} = ''; $this->{ini}->{FitXMax} = ''; } if($InitializeData) { $this->{pCalX} = undef; $this->{pCalY} = undef; } } sub UpdateParameters { my ($this) = @_; my $ini = $this->{ini}; $ini->{Eg} = $ini->{Ec} - $ini->{Ev}; $ini->{Nc} = $ini->Nc($ini->{Effme}*$me, $ini->{CBMultiplicity}, $ini->{T}, 0) * 1.0e-6; $ini->{Dc0} = $ini->Dc0($ini->{Effme}*$me, $ini->{CBMultiplicity}, 0) * $e**1.5 * 1.0e-6; # cm^-3/eV^1.5 $ini->{Nv} = $ini->Nv($ini->{Effmh}*$me, $ini->{VBMultiplicity}, $ini->{T}, 0) * 1.0e-6; $ini->{Dv0} = $ini->Dv0($ini->{Effmh}*$me, $ini->{VBMultiplicity}, 0) * $e**1.5 * 1.0e-6; # cm^-3/eV^1.5 $ini->{Ni} = $ini->Ni($ini->{T}, $ini->{Eg}); return if(!defined $this->{pEntryArray}); my $pEA = $this->{pEntryArray}; for(my $i = 0 ; $i < @$pEA ; $i++) { $pEA->[$i]->Update(); } } sub EntryFocusedIn { my ($this, $obj, $event, $type) = @_; if($event eq 'FocusIn') { $obj->{PrevValue} = $obj->GetText(); } } sub EntryFocusedOut { my ($this, $obj, $event, $type) = @_; my $ini = $this->{ini}; my $dini = $this->{dini}; if($event eq 'FocusOut') { } if($ini->{AutoUpdate} and defined $dini->{"${type}check"} and $obj->{PrevValue} != $obj->GetText()) { $this->Recalc(); # $this->CreateGraphFrame(); $this->AssignGraphData(0); $this->Draw(); } else { $this->UpdateParameters(); } } sub ButtonPressed { my ($this, $event, $type) = @_; my $App = $this->App(); if($type eq 'CalAll') { $this->CalAll(); } elsif($type eq 'SaveAll') { my $FileName = $this->{SampleCSVFileEntry}->GetText(); $FileName = Deps::ReplaceExtension($FileName, "AllData.csv"); $this->print("Save All Data\n"); $this->print(" Save to [$FileName].\n"); $this->CalAll($FileName); $this->print(" Data saved to [$FileName].\n"); } else { $this->SUPER::ButtonPressed($event, $type); } } #=================================================== # データ処理 #=================================================== sub Recalc { my ($this) = @_; return if(!defined $this->{DataFile}); printf "\nRecalc\n"; my $ini = $this->{ini}; my $XLabel = $this->{"ChooseXListBox"}->GetText(); my $Y1Label = $this->{"ChooseY1ListBox"}->GetText(); my $Y2Label = $this->{"ChooseY2ListBox"}->GetText(); my $pX = $this->{DataFile}->GetData($XLabel) if($XLabel); my $pY1 = $this->{DataFile}->GetData($Y1Label) if($Y1Label); my $pY2 = $this->{DataFile}->GetData($Y2Label) if($Y2Label); # my $T = $ini->{T}; $ini->{Ecmin} = $ini->{Ec} - 0.0; $ini->{Evmax} = $ini->{Ev} + 0.0; $ini->{Em} = $ini->{Ec}; my ($Ne, $Nh); my (@T, @InvT, @Ne, @Nh, @ue, @sigma, @S); my $EF = $ini->{Ec}; $EF = $ini->{ED} if($ini->{ND} > 1.0e15 and $ini->{ED} > $ini->{Ec}); for(my $i = 0 ; ; $i++) { my $Tcal = $ini->{Tstart} + $i * $ini->{Tstep}; last if($Tcal > $ini->{Tend}); my ($EFopt, $Ne, $NeHall, $Nh, $NDp, $NAm, $ND2p, $NA2m, $ue, $ueHall, $sigma, $S) = $this->CalTransport($Tcal, $EF); $T[$i] = $Tcal; $InvT[$i] = 1.0 / $Tcal; $Ne[$i] = $NeHall; $ue[$i] = $ueHall; # $Ne[$i] = $Ne; # $ue[$i] = $ue; $Nh[$i] = $Nh; $sigma[$i] = $sigma; $S[$i] = $S; if(1) { printf "%5.1f: EF=%5.3feV: Ne=%10.3g NDp=%10.3g/%10.3g NAm=%10.3g/%10.3g s=%10.3g S/cm\n", $Tcal, $EFopt, $Ne, $NDp, $ND2p, $NAm, $NA2m, $sigma; } else { printf "%5.1f: EF=%5.3feV: Ne=%10.3g ue=%10.3g s=%10.3g S/cm\n", $Tcal, $EFopt, $Ne, $ue, $sigma; } } $this->{pCalT} = \@T; $this->{pCalInvT} = \@InvT; $this->{pCalNe} = \@Ne; $this->{pCalue} = \@ue; $this->{pCalNh} = \@Nh; $this->{pCalsigma} = \@sigma; $this->{pCalS} = \@S; # $this->SetS2($S2); $this->CreateGraphFrame() if(!defined $this->{GraphFrameArray}); $this->AssignGraphData(1); $this->Draw(); } sub CalAll { my ($this, $OutFile) = @_; return if(!defined $this->{DataFile}); printf "\nCalculate all transport properties\n"; my $ini = $this->{ini}; $ini->{Ecmin} = $ini->{Ec} - 0.0; $ini->{Evmax} = $ini->{Ev} + 0.0; $ini->{Em} = $ini->{Ec}; my $out; if($OutFile) { $out = new JFile($OutFile, "w"); if($out) { $out->print("T(K),EF(eV),dS(cm-3),Ne(cm-3),Nh(cm-3),NDp(cm-3),NAm(cm-3),ND2p(cm-3),NA2m(cm-3),ue(cm2/Vs),sigma(S/cm),"); $out->print("(s),(s),(s),(s),(m/s),(m),"); $out->print("ueDrift(cm2/Vs),ueHall(cm2/Vs),RHall/Drift,S(exact uV/K),S(nondeg uV/K),S(deg uV/K)\n"); } } my $EF = $ini->{Ec}; $EF = $ini->{ED} if($ini->{ND} > 1.0e15 and $ini->{ED} > $ini->{Ec}); for(my $i = 0 ; ; $i++) { my $Tcal = $ini->{Tstart} + $i * $ini->{Tstep}; last if($Tcal > $ini->{Tend}); my ($EFopt, $Ne, $NeHall, $Nh, $NDp, $NAm, $ND2p, $NA2m, $ue, $ueHall, $sigma, $S) = $this->CalTransport($Tcal, $EF); my $tauaveraged = $ini->CalTauAveraged($EFopt, $Tcal, 1); my $tau2averaged = $ini->CalTauAveraged($EFopt, $Tcal, 2); my $ueDrift = $ini->CalDriftMobility($EFopt, $Tcal); # my $ueHall = $ini->CalHallMobility($EFopt, $Tcal); my $Sexact = $ini->CalSeebeck($EFopt, $Tcal); my $Snondeg = $ini->CalSeebeckWithNonDegenerateApproximation($EFopt, $Tcal); my $Sdegenerated = $ini->CalSeebeckWithDegenerateApproximation($EFopt, $Tcal); my $tau0averaged = $ini->CalTauAveraged($EFopt, $Tcal, 1, 0); my $tau02averaged = $ini->CalTauAveraged($EFopt, $Tcal, 2, 0); my $vth = Material::ElectronThermalVelocity(undef, $Tcal, $ini->{Effme} * $me, 0); my $lth = $vth * $tau0averaged; printf "%5.1f: EF=%5.3feV (%6.3g):\n", $Tcal, $EFopt, $S; printf "%15s Ne=%10.3g NDp=%10.3g/%10.3g Nh=%10.3g NAm=%10.3g/%10.3g cm-3\n", '', $Ne, $NDp, $ND2p, $Nh, $NAm, $NA2m; printf "%15s ue=%10.3g cm2/Vs s=%10.3g S/cm\n", '', $ue, $sigma; printf "%15s =%10.3g s =%10.3g s2\n", '', $tauaveraged, $tau2averaged; printf "%15s =%10.3g s =%10.3g s2\n", '', $tau0averaged, $tau02averaged; printf "%15s =%10.3g m/s =%10.3g m\n", '', $vth, $lth; my $RHall = 0.0; $RHall = $ueHall / $ueDrift if($ueDrift > 0.0); printf "%15s udrift=%10.3g uHall=%10.3g cm2/Vs r=%6.3f\n", '', $ueDrift, $ueHall, $RHall; printf "%15s S(exact)=%10.3g (nondeg)=%10.3g (deg)=%10.3g uV/K\n", '', $Sexact*1e6, $Snondeg*1e6, $Sdegenerated*1e6; if($out) { $out->print("$Tcal,$EFopt,$S,$Ne,$Nh,$NDp,$NAm,$ND2p,$NA2m,$ue,$sigma,"); $out->print("$tauaveraged,$tau2averaged,$tau0averaged,$tau02averaged,$vth,$lth,"); $out->print("$ueDrift,$ueHall,$RHall,$Sexact,$Snondeg,$Sdegenerated\n"); } } if($out) { $out->Close(); } } sub CalTransport { my ($this, $T, $EF) = @_; my $ini = $this->{ini}; if(!defined $EF) { $EF = $ini->{Ec}; $EF = $ini->{ED} if($ini->{ND} > 1.0e15 and $ini->{ED} > $ini->{Ec}); } my $dE = $T * $KToeV * $ini->{dE}; my $Ecrange = $T * $KToeV * $ini->{KIntegrationErange} + ($ini->{Ec} - $ini->{Ecmin}); #print "Ecrange=$Ecrange : "; $Ecrange += $EF - $ini->{Ec} if($EF > $ini->{Ec}); #print "Ecrange=$Ecrange EF=$EF\n"; my $nEc = int($Ecrange / $dE + 1.001); my $Evrange = $T * $KToeV * 20.0 + ($ini->{Evmax} - $ini->{Ev}); $Evrange += $ini->{Ev} - $EF if($EF < $ini->{Ev}); my $nEv = int($Evrange / $dE + 1.001); $nEc = int($nEc / 2) * 2 + 1; $nEv = int($nEv / 2) * 2 + 1; if(1) { printf "T=%4.1f K: Integraction (CB): %6.3f, %10.3g eV step [%d]\n", $T, $Ecrange, $dE, $nEc; printf " (VB): %6.3f, %10.3g eV step [%d]\n", $Evrange, $dE, $nEv; } $ini->CalDOSc($ini->{Dc0}, $ini->{Ec}, $ini->{Nctail}, $ini->{Ecconnect}, $ini->{Ecu}, $nEc, $ini->{Ecmin}, $dE); $ini->CalDOSv($ini->{Dv0}, $ini->{Ev}, $ini->{Nvtail}, $ini->{Ecconnect}, $ini->{Evu}, $nEv, $ini->{Evmax}, -$dE); my ($EFopt, $S) = $ini->CalEF($T, $ini->{nMaxIter}, $ini->{EFEPS}, $ini->{EFSEPS}, 0); my $Ne = $ini->CalNe($EFopt, $T); my $Nh = $ini->CalNh($EFopt, $T); my $NDp = $ini->CalNDp($EFopt, $T); my $ND2p = $ini->CalND2p($EFopt, $T); my $NAm = $ini->CalNAm($EFopt, $T); my $NA2m = $ini->CalNA2m($EFopt, $T); my $sigma = $ini->CalSigma($EFopt, $T); print "Ne=$Ne,$Nh,$NDp,$NAm,$ND2p,$NA2m\n"; # EDが伝導帯に入っている場合、電子濃度 $Ne に非イオン化ドナー密度 $ND-$NDp を加える if(1) { $Ne += $ini->{ND} - $NDp if($ini->{ED} >= $ini->{Em}); $Ne += $ini->{ND2} - $ND2p if($ini->{ED2} >= $ini->{Em}); $Nh += $ini->{NA} - $NAm if($ini->{EA} <= $ini->{Ev}); $Nh += $ini->{NA2} - $NA2m if($ini->{EA2} <= $ini->{Ev}); } my $tau0averaged = $ini->CalTauAveraged($EFopt, $T, 1, 0); my $tau02averaged = $ini->CalTauAveraged($EFopt, $T, 2, 0); my $RHall = ($tau0averaged == 0.0)? 0.0 : $tau02averaged / $tau0averaged / $tau0averaged; my $NeHall = ($RHall == 0.0)? 0.0 : $Ne / $RHall; #print "tau0=$tau0averaged / $tau02averaged\n"; my ($ue, $ueHall); if($NeHall > 0.0) { # if($Ne > 0.0) { $ueHall = $sigma / $e / $NeHall; $ue = $sigma / $e / $Ne; } else { $ue = 0.0; $ueHall = 0.0; } return ($EFopt, $Ne, $NeHall, $Nh, $NDp, $NAm, $ND2p, $NA2m, $ue, $ueHall, $sigma, $S); } sub Fit { my ($this) = @_; return if(!defined $this->{DataFile}); my $App = $this->App(); my $ini = $this->{ini}; printf "\nFit\n"; $this->UpdateParameters(); $this->BuildOptimize(0); my $optimize = $this->{Optimize}; my $FitXMin = $ini->{FitXMin}; my $FitXMax = $ini->{FitXMax}; my $nSkipData = $ini->{nSkipData}; my $Method = $this->{ChooseLSQMethodListBox}->GetText(); my $FitTo = $this->{ChooseFitToListBox}->GetText(); my $pX = $this->{DataFile}->GetData('T.*'); my ($pY1, $pY2); if($FitTo eq 'Ne,sigma') { $pY1 = $this->{DataFile}->GetData('Ne.*'); $pY2 = $this->{DataFile}->GetData('sigma.*'); } elsif($FitTo eq 'Ne,ue') { $pY1 = $this->{DataFile}->GetData('Ne.*'); $pY2 = $this->{DataFile}->GetData('u.*'); } elsif($FitTo eq 'Ne') { $pY1 = $this->{DataFile}->GetData('Ne.*'); } elsif($FitTo eq 'sigma') { $pY1 = $this->{DataFile}->GetData('sigma.*'); } elsif($FitTo eq 'ue') { $pY1 = $this->{DataFile}->GetData('u.*'); } $ini->{Ecmin} = $ini->{Ec} - 0.0; $ini->{Evmax} = $ini->{Ev} + 0.0; $ini->{Em} = $ini->{Ec}; my ($OptVars, $MinVal) = $optimize->Optimize( $Method, undef, undef, undef, $ini->{EPS}, $ini->{nMaxIter}, $ini->{iPrintLevel}, sub { $this->CalS2($FitTo, $pX, $pY1, $pY2, $FitXMin, $FitXMax, $nSkipData, @_); }, undef, sub { Optimize::BuildDifferentialMatrixes(@_); }, ); print "\nOptimized at:\n"; $optimize->PrintParameters(1); $optimize->RecoverParameters($OptVars); $this->SetS2($MinVal); $this->UpdateParameters(); $this->Recalc(); $this->RePlot(); # $this->CreateGraphFrame() if(!defined $this->{GraphFrameArray}); # $this->AssignGraphData(1); # $this->Draw(); } sub CalS2 { my ($this, $FitTo, $pX, $pY1, $pY2, $FitXMin, $FitXMax, $nSkipData, $pVars, $iPrintLeve) = @_; my $optimize = $this->{Optimize}; my $ini = $this->{ini}; $optimize->RecoverParameters($pVars); $optimize->IncrementnS2(); my $nS2 = $optimize->nS2Calculation(); my $nS2Interval = $ini->{nSaveSpectraInterval}; my ($Ne, $Nh); my (@T, @InvT, @Ne, @Nh, @ue, @sigma, @S); my $EF = $ini->{Ec}; $EF = $ini->{ED} if($ini->{ND} > 1.0e15 and $ini->{ED} > $ini->{Ec}); my ($d1, $d2); my $S2 = 0.0; my $c = 0; my $nData = @$pX; for(my $i = 0 ; $i < $nData ; $i++) { next if($nSkipData > 0 and $i % $nSkipData != 0); my $T = $pX->[$i]; next if($T < $FitXMin or $FitXMax < $T); my ($EFopt, $Ne, $NeHall, $Nh, $NDp, $NAm, $ND2p, $NA2m, $ue, $ueHall, $sigma, $S) = $this->CalTransport($T, $EF); if($FitTo eq 'Ne,sigma') { $d1 = log(abs($pY1->[$i])+1.0) - log(abs($NeHall)+1.0); # $d1 = log(abs($pY1->[$i])+1.0) - log(abs($Ne)+1.0); $d2 = log(abs($pY2->[$i])+1.0) - log(abs($sigma)+1.0); $S2 += $d1 * $d1 + $d2 * $d2; } elsif($FitTo eq 'Ne,ue') { $d1 = log(abs($pY1->[$i])+1.0) - log(abs($NeHall)+1.0); # $d1 = log(abs($pY1->[$i])+1.0) - log(abs($Ne)+1.0); $d2 = $pY2->[$i] - $ueHall; # $d2 = $pY2->[$i] - $ue; $S2 += $d1 * $d1 + $d2 * $d2; } elsif($FitTo eq 'Ne') { $d1 = log(abs($pY1->[$i])+1.0) - log(abs($NeHall)+1.0); # $d1 = log(abs($pY1->[$i])+1.0) - log(abs($Ne)+1.0); $S2 += $d1 * $d1; } elsif($FitTo eq 'sigma') { $d1 = log(abs($pY1->[$i])+1.0) - log(abs($sigma)+1.0); $S2 += $d1 * $d1; } elsif($FitTo eq 'ue') { $d1 = $pY1->[$i] - $ueHall; # $d1 = $pY1->[$i] - $ue; $S2 += $d1 * $d1; } $c++; } #print "S2=$S2 c=$c => "; $S2 /= $c if($c > 0); #print "$S2\n"; print "S2[$nS2] = $S2 / "; $S2 += $optimize->CalPenalty(1.0e10, $pVars, 1); print "$S2\n"; $optimize->PrintParameters(1, $pVars, $S2, 0); if($nS2Interval > 0 and $nS2 % $nS2Interval == 0) { $this->SetS2($S2, 0); $this->Recalc(); # $this->CreateGraphFrame(); $this->AssignGraphData(0); $this->Draw(); } $this->UpdateParameters(); $this->mw()->update(); return $S2; } sub BuildOptimize { my ($this, $IsPrint) = @_; my $ini = $this->{ini}; my $dini = $this->{dini}; my $XLabel = $this->{"ChooseXListBox"}->GetText(); my $Y1Label = $this->{"ChooseY1ListBox"}->GetText(); my $Y2Label = $this->{"ChooseY2ListBox"}->GetText(); my $pX = $this->{DataFile}->GetData($XLabel) if($XLabel); my $pY1 = $this->{DataFile}->GetData($Y1Label) if($Y1Label); my $pY2 = $this->{DataFile}->GetData($Y2Label) if($Y2Label); my $nData = $this->{DataFile}->nData(); my $optimize = new Optimize(); $optimize->AddParameters( "Ec", \$ini->{Ec}, $dini->{Eccheck}, $dini->{Ecscale}, $dini->{Ecmin}, $dini->{Ecmax}, sub { $ini->{Ec} = $_[0]; }, "tau0", \$ini->{tau0}, $dini->{tau0check}, $dini->{tau0scale}, $dini->{tau0min}, $dini->{tau0max}, sub { $ini->{tau0} = $_[0]; }, "r", \$ini->{r}, $dini->{rcheck}, $dini->{rscale}, $dini->{rmin}, $dini->{rmax}, sub { $ini->{r} = $_[0]; }, "tau02", \$ini->{tau02}, $dini->{tau02check}, $dini->{tau02scale}, $dini->{tau02min}, $dini->{tau02max}, sub { $ini->{tau02} = $_[0]; }, "r2", \$ini->{r2}, $dini->{r2check}, $dini->{r2scale}, $dini->{r2min}, $dini->{r2max}, sub { $ini->{r2} = $_[0]; }, "ND", \$ini->{ND}, $dini->{NDcheck}, $dini->{NDscale}, $dini->{NDmin}, $dini->{NDmax}, sub { $ini->{ND} = $_[0]; }, "ED", \$ini->{ED}, $dini->{EDcheck}, $dini->{EDscale}, $dini->{EDmin}, $dini->{EDmax}, sub { $ini->{ED} = $_[0]; }, "NA", \$ini->{NA}, $dini->{NAcheck}, $dini->{NAscale}, $dini->{NAmin}, $dini->{NAmax}, sub { $ini->{NA} = $_[0]; }, "EA", \$ini->{EA}, $dini->{EAcheck}, $dini->{EAscale}, $dini->{EAmin}, $dini->{EAmax}, sub { $ini->{EA} = $_[0]; }, "ND2", \$ini->{ND2}, $dini->{ND2check}, $dini->{ND2scale}, $dini->{ND2min}, $dini->{ND2max}, sub { $ini->{ND2} = $_[0]; }, "ED2", \$ini->{ED2}, $dini->{ED2check}, $dini->{ED2scale}, $dini->{ED2min}, $dini->{ED2max}, sub { $ini->{ED2} = $_[0]; }, "NA2", \$ini->{NA2}, $dini->{NA2check}, $dini->{NA2scale}, $dini->{NA2min}, $dini->{NA2max}, sub { $ini->{NA2} = $_[0]; }, "EA2", \$ini->{EA2}, $dini->{EA2check}, $dini->{EA2scale}, $dini->{EA2min}, $dini->{EA2max}, sub { $ini->{EA2} = $_[0]; }, "Ecenter", \$ini->{Ecenter}, $dini->{Ecentercheck}, $dini->{Ecenterscale}, $dini->{Ecentermin}, $dini->{Ecentermax}, sub { $ini->{Ecenter} = $_[0]; }, "E0", \$ini->{E0}, $dini->{E0check}, $dini->{E0scale}, $dini->{E0min}, $dini->{E0max}, sub { $ini->{E0} = $_[0]; }, ); $this->{Optimize} = $optimize; } sub SaveParameterFile { my ($this, $filepath) = @_; $this->{ini}->{X} = $this->{ChooseXListBox}->GetText(); $this->{ini}->{Y1} = $this->{ChooseY1ListBox}->GetText(); $this->{ini}->{Y2} = $this->{ChooseY2ListBox}->GetText(); $this->{ini}->{FitTo} = $this->{ChooseFitToListBox}->GetText(); $this->{ini}->{LSQMethod} = $this->{ChooseLSQMethodListBox}->GetText(); if(!defined $filepath or $filepath eq '') { $filepath = $this->ChooseSaveFile('save.prm', '*.prm'); if($filepath) { $this->{ini}->{ParameterFile} = $filepath; } else { return; } } $this->{ini}->SetIniFile($filepath, undef, 1); $this->App()->print("\nSaveParameterFile:\n"); $this->ComposeParameters($this->{dini}, $this->{ini}); $this->{ini}->WriteAll(); $this->DecomposeParameters($this->{ini}, $this->{dini}); } sub ReadParameterFile { my ($this, $filepath) = @_; my $DirectorySeparator = Deps::DirectorySeparator(); my $RegSeparator = Utils::RegExpQuote($DirectorySeparator); my $ini = $this->{ini}; my $dini = $this->{dini}; $this->Initialize(1, 1); $this->App()->print("\nRead paramter from [$filepath].\n"); $this->{ini}->ReadAll($filepath); # $this->{ini}->{ParameterFile} = $filepath; $this->DecomposeParameters($ini, $dini); if($this->{ini}->{SampleCSVFile}) { my $ret; if(-e $this->{ini}->{SampleCSVFile}) { $ret = $this->ReadSampleDataFile($this->{ini}->{SampleCSVFile}, 1, 0, 0); } unless($ret) { my ($drive0, $directory0, $filename0, $ext0, $lastdir0, $filebody0) = Deps::SplitFilePath($this->{ini}->{ParameterFile}); my ($drive1, $directory1, $filename1, $ext1, $lastdir1, $filebody1) = Deps::SplitFilePath($filepath); $this->{ini}->{SampleCSVFile} =~ s/\//$DirectorySeparator/g; #print "RelPath = Utils::MakeRelativePath($this->{ini}->{SampleCSVFile}, $drive0$directory0, 0)\n"; my $RelPath = Utils::MakeRelativePath($this->{ini}->{SampleCSVFile}, "$drive0$directory0"); #print "R: $RelPath\n"; $RelPath =~ s/^\.$RegSeparator/$drive1$directory1/; #print "R: $RelPath\n"; if(-e $RelPath) { $ret = $this->ReadSampleDataFile($RelPath, 1, 0, 0); } unless($ret) { ($drive0, $directory0, $filename0, $ext0, $lastdir0, $filebody0) = Deps::SplitFilePath($filepath); ($drive1, $directory1, $filename1, $ext1, $lastdir1, $filebody1) = Deps::SplitFilePath($this->{ini}->{SampleCSVFile}); my $f = Deps::MakePath("$drive0$directory0", $filename1, 0); $ret = $this->ReadSampleDataFile($f, 1, 0, 0); return undef unless($ret); $this->{ini}->{SampleCSVFile} = $f; } else { $this->{ini}->{SampleCSVFile} = $RelPath; } } } $this->{ini}->{ParameterFile} = $filepath; $this->{ini}->{FitTo} = 'Ne,sigma' if(!$this->{ini}->{FitTo}); $this->{ini}->{LSQMethod} = 'Amoeba::Simplex' if(!$this->{ini}->{LSQMethod}); $this->{ChooseXListBox}->SetText($this->{ini}->{X}); $this->{ChooseY1ListBox}->SetText($this->{ini}->{Y1}); $this->{ChooseY2ListBox}->SetText($this->{ini}->{Y2}); $this->{ChooseFitToListBox}->SetText($this->{ini}->{FitTo}); $this->{ChooseLSQMethodListBox}->SetText($this->{ini}->{LSQMethod}); $this->RePlot(1); return 1; } sub ReadSampleDataFile { my ($this, $filepath, $IsPrint, $UpdateRange) = @_; $UpdateRange = 1 if(!defined $UpdateRange); my $App = $this->App(); #print "type=$type\n"; $this->Initialize(0, 1); $this->{Path} = $filepath; my ($nData, $pLabelArray, @pDataArray) = $this->{DataFile}->Read($filepath); if(!defined $nData) { $App->print("Error: Can not read [$filepath].\n"); return $this->{Path} = undef; } my $nDataArray = $this->{DataFile}->nDataArray(); #print "nDataArray: $nDataArray\n"; $this->{"ChooseXListBox"}->DeleteAllItem(); $this->{"ChooseY1ListBox"}->DeleteAllItem(); $this->{"ChooseY2ListBox"}->DeleteAllItem(); for(my $i = 0 ; $i < $nDataArray ; $i++) { #print "$i: $pLabelArray->[$i]\n"; $this->{"ChooseXListBox"}->AddItem($pLabelArray->[$i]); $this->{"ChooseY1ListBox"}->AddItem($pLabelArray->[$i]); $this->{"ChooseY2ListBox"}->AddItem($pLabelArray->[$i]); } $this->{"ChooseXListBox"}->SetCurSel('T.*', '1/T.*'); $this->{"ChooseY1ListBox"}->SetCurSel('sigma.*', 'ue.*', 'mobility.*'); $this->{"ChooseY2ListBox"}->SetCurSel('Ne.*', 'ue.*', '.mobility.*'); # $this->{"ChooseXListBox"}->SetCurSel(0); # $this->{"ChooseY1ListBox"}->SetCurSel(1); # $this->{"ChooseY2ListBox"}->SetCurSel(2); if($UpdateRange or !defined $this->{ini}->{FitXMin}) { ($this->{ini}->{FitXMin}, $this->{ini}->{FitXMax}) = Utils::CalMinMax($pDataArray[0]); } $this->RePlot(1); # $this->CreateGraphFrame(); # $this->AssignGraphData(); return $filepath; } sub CreateGraphFrame { my ($this, $canvas, $TargetData) = @_; $canvas = $this->Canvas(); my $App = $this->App(); my $font = $App->{'GraphFrameFont'}; my @font = split(/,/, $font) if($font); my $w = $canvas->width(); my $h = $canvas->height(); my $GraphFrameArray = $this->{'GraphFrameArray'} = new GraphFrameArray($this->mw()); $GraphFrameArray->SetCanvasSize($w, $h); $GraphFrameArray->AddGraphFrame(); my $GraphFrame0 = $GraphFrameArray->GetGraphFrame(0); my $FramePosStr0 = $App->{"GraphFrame0Position"}; $GraphFrame0->SetPositionByStr($FramePosStr0); my $XScale0 = $GraphFrame0->GetXScale(0); my $YScale0 = $GraphFrame0->GetYScale(0); $XScale0->SetScaleStringVisible(1); $XScale0->SetCaptionVisible(1); $GraphFrame0->SetViewRange(0, 0, 1, 1); $GraphFrameArray->AddGraphFrame(); my $GraphFrame1 = $GraphFrameArray->GetGraphFrame(1); my $FramePosStr1 = $App->{"GraphFrame1Position"}; $GraphFrame1->SetPositionByStr($FramePosStr1); my $XScale1 = $GraphFrame1->GetXScale(0); my $YScale1 = $GraphFrame1->GetYScale(0); $XScale1->SetScaleStringVisible(1); $XScale1->SetCaptionVisible(1); $GraphFrame1->SetViewRange(0, 0, 1, 1); } sub AssignGraphData { my ($this, $ResetViewRange) = @_; $ResetViewRange = 1 if(!defined $ResetViewRange); my $GraphFrameArray = $this->GetGraphFrameArray(); my $GraphFrame0 = $GraphFrameArray->GetGraphFrame(0); my $GraphFrame1 = $GraphFrameArray->GetGraphFrame(1); $GraphFrame0->ClearAllData(); $GraphFrame1->ClearAllData(); my $XLabel = $this->{"ChooseXListBox"}->GetText(); $XLabel = 'T / K' if(!$XLabel); my $Y1Label = $this->{"ChooseY1ListBox"}->GetText(); $Y1Label = 'ue / cm2/Vs' if(!$Y1Label); my $Y2Label = $this->{"ChooseY2ListBox"}->GetText(); $Y2Label = 'Ne / cm-3' if(!$Y2Label); $GraphFrame0->SetXCaption($XLabel); $GraphFrame0->SetYCaption($Y1Label); $GraphFrame1->SetXCaption($XLabel); $GraphFrame1->SetYCaption($Y2Label); my $pX = $this->{DataFile}->GetData($XLabel) if($XLabel); my $pY1 = $this->{DataFile}->GetData($Y1Label) if($Y1Label); my $pY2 = $this->{DataFile}->GetData($Y2Label) if($Y2Label); my $nData = $this->{DataFile}->nData(); if($pX) { $GraphFrame0->AddGraphData($pX, $pY1, 0, "black", "circle", 6, "red", 0, "red", "XAutoSkip", "T(K)", "${Y1Label}") if($pY1); $GraphFrame1->AddGraphData($pX, $pY2, 0, "black", "circle", 6, "red", 0, "red", "XAutoSkip", "T(K)", "${Y2Label}") if($pY2); } my $pT = $this->{pCalT}; my $pInvT = $this->{pCalInvT}; my $pNe = $this->{pCalNe}; my $pue = $this->{pCalue}; my $pNh = $this->{pCalNh}; my $psigma = $this->{pCalsigma}; my $pS = $this->{pCalS}; my ($pCalX, $pCalY1, $pCalY2) = ($pT, $pue, $pNe); for(my $i = 0 ; $i < 3 ; $i++) { my ($p, $l); if($i == 0) { $p = \$pCalX; $l = $XLabel; } elsif($i == 1) { $p = \$pCalY1; $l = $Y1Label; } elsif($i == 2) { $p = \$pCalY2; $l = $Y2Label; } if($l =~ /^T/) { $$p = $pT; } elsif($l =~ /^1\/T/) { $$p = $pInvT; } elsif($l =~ /^ue/) { $$p = $pue; } elsif($l =~ /^Ne/) { $$p = $pNe; } elsif($l =~ /^sigma/) { $$p = $psigma; } } if($pCalX) { $GraphFrame0->AddGraphData($pT, $pCalY1, 1, "black", "", 3, "", 1, "red", "XAutoSkip", "T(K)", "$Y1Label (cal)") if($pCalY1); $GraphFrame1->AddGraphData($pT, $pCalY2, 1, "black", "", 3, "", 1, "red", "XAutoSkip", "T(K)", "$Y2Label (cal)") if($pCalY2); } # $GraphFrame0->SetYScalePlotType('x'); # $GraphFrame1->SetYScalePlotType('x'); if($ResetViewRange) { $GraphFrame0->CalMinMax(); $GraphFrame1->CalMinMax(); $GraphFrame0->AdjustViewRange(0.05, 0.05, 0.05, 0.05); $GraphFrame1->AdjustViewRange(0.05, 0.05, 0.05, 0.05); # $GraphFrame0->SetViewYRange(0); # $GraphFrame1->SetViewYRange(0); } } sub AdjustViewRange { my ($this) = @_; my $GraphFrameArray = $this->GetGraphFrameArray(); my $pGraphFrame = $GraphFrameArray->GetpGraphFrameArray(); my $FileType = $this->FileType(); # if($FileType =~ /(Ids)/i) { # } } sub InitializeParameters { my ($this, $ini, $dini) = @_; $this->AddParameters($ini, $dini, "EF", 0.0, 0, 1.0, '', ''); $this->AddParameters($ini, $dini, "Ec", 3.0, 0, 0.1, 0.0, ''); $this->AddParameters($ini, $dini, "tau0", 4.0e-15, 0, 1.0e-15, 0.0, ''); $this->AddParameters($ini, $dini, "r", 0.5, 0, 0.5, -2.0, 2.0); $this->AddParameters($ini, $dini, "PowerT", 0.0, 0, 0.5, -2.0, 2.0); $this->AddParameters($ini, $dini, "tau02", 0.0, 0,1.0e-15, 0.0, ''); $this->AddParameters($ini, $dini, "r2", 0.0, 0, 0.5, -2.0, 2.0); $this->AddParameters($ini, $dini, "PowerT2", 0.0, 0, 0.5, -2.0, 2.0); $this->AddParameters($ini, $dini, "ND", 1.0e16, 0, 1.0e19, 0.0, ''); $this->AddParameters($ini, $dini, "ED", 2.955, 0, 0.1, 0.0, ''); $this->AddParameters($ini, $dini, "NA", 0.0, 0, 1.0e19, 0.0, ''); $this->AddParameters($ini, $dini, "EA", 0.05, 0, 0.1, 0.0, ''); $this->AddParameters($ini, $dini, "ND2", 0.0, 0, 1.0e19, 0.0, ''); $this->AddParameters($ini, $dini, "ED2", 2.8, 0, 0.1, 0.0, ''); $this->AddParameters($ini, $dini, "NA2", 0.0, 0, 1.0e19, 0.0, ''); $this->AddParameters($ini, $dini, "EA2", 0.3, 0, 0.1, 0.0, ''); $this->AddParameters($ini, $dini, "Ecenter", 0.0, 0, 0.5, 0.0, ''); $this->AddParameters($ini, $dini, "E0", 0.0, 0, 0.01, 0.0, ''); } 1;