-
Notifications
You must be signed in to change notification settings - Fork 0
/
SelfShieldingCalculatorClassesMin.pas
2108 lines (2006 loc) · 66 KB
/
SelfShieldingCalculatorClassesMin.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
unit SelfShieldingCalculatorClassesMin;
interface
uses Classes, ObjectsMin, EuLibMin;
type
TOuterModeratorInfo=record
A: double; // Amass
SigmaS: double; // barn
Ro: double; // Atom Concentration 1/(barn*cm)
end;
POuterModeratorInfo=^TOuterModeratorInfo;
TMixedModeratorInfo=record
A: double; // Amass
SigmaS: double; // barn
Ro: double; // Atom Concentration 1/(barn*cm)
end;
PMixedModeratorInfo=^TMixedModeratorInfo;
{TMixedModeratorList}
TMixedModeratorList=class(TList)
protected
function GetMixedModeratorA(Index: integer): double;
procedure SetMixedModeratorA(Index: integer; const aMixedModeratorInfoA: double);
function GetMixedModeratorSigmaS(Index: integer): double;
procedure SetMixedModeratorSigmaS(Index: integer; const aMixedModeratorInfoSigmaS: double);
function GetMixedModeratorRo(Index: integer): double;
procedure SetMixedModeratorRo(Index: integer; const aMixedModeratorInfoRo: double);
function GetMixedModeratorInfo(Index: integer): TMixedModeratorInfo;
procedure SetMixedModeratorInfo(Index: integer; const aMixedModeratorInfo: TMixedModeratorInfo);
public
procedure Add(aMixedModeratorInfo: TMixedModeratorInfo);
destructor Destroy; override;
constructor Create;
property
MixedModeratorInfos[Index: integer]: TMixedModeratorInfo read GetMixedModeratorInfo write SetMixedModeratorInfo; default;
property
A[Index: integer]: double read GetMixedModeratorA write SetMixedModeratorA;
property
SigmaS[Index: integer]: double read GetMixedModeratorSigmaS write SetMixedModeratorSigmaS;
property
Ro[Index: integer]: double read GetMixedModeratorRo write SetMixedModeratorRo;
end;
TResonanceType=(rtSLBWRP, rtMLBWRP, rtRMRP, rtOther);
TResonanceInfo=record
ResonanceType: TResonanceType;
A: double;
TwoI: Longword;
TwoJ: Longword;
SigmaS: double;
L: integer; // ==0
Edown: double; //Energies - in eV, sigmy - barn
Eup: double;
E0: double;
GammaT: double;
GammaN: double;
GammaG: double;
GammaF: double;
// GammaFA: double;// For Reigh-Moore == GF
GammaFB: double; // For Reigh-Moore
end;
PResonanceInfo=^TResonanceInfo;
{TResonanceInfoList}
TResonanceInfoList=class(TList)
protected
function GetResonanceInfo(Index: integer): TResonanceInfo;
procedure SetResonanceInfo(Index: integer; aResonanceInfo: TResonanceInfo);
public
procedure Add(aResonanceInfo: TResonanceInfo);
procedure Assign(aResonanceInfoList: TResonanceInfoList);
function FindInList(const E0: double; const Epsilon: double=1.0E-3): integer;
destructor Destroy; override;
constructor Create;
property
ResonanceInfos[Index: integer]: TResonanceInfo read GetResonanceInfo write SetResonanceInfo; default;
end;
TCellType=(ctNoCell, ctHex, ctSquare);
{TSelfShieldingCalculator}
TSelfShieldingCalculator=class(TObject)
private
fAbortCalcSSK: Boolean;
fAborted: Boolean;
fA: double; // Amass
fT: double; // K
fRo: double; // 1/(barn*cm)
fStepNo: integer;
fMaxStepNo: integer;
fEpsilon: double;
fE_gr: double; // E_granichnaia
fl_mean: double; // cm
fCellType: TCellType;
// Resonance Tables
fResonanceList: TResonanceInfoList;
fMixedModerators: TMixedModeratorList;
fOuterModerator: TOuterModeratorInfo;
fVc: double; // Vskin/Vblock
fVom: double; // Vom/Vblock
fResonanceInCalculationNo: integer;
fRo_mult_fl_mean_min: double;
// for SSKcalculation
fZmis: TFloatList;
fz_smallis: TFloatList;
fdeltais: TFloatList;
protected
function GetE0(Index: Integer): double;
procedure SetE0(Index: Integer; Value: double);
function GetGammaT(Index: Integer): double;
procedure SetGammaT(Index: Integer; Value: double);
function GetGammaG(Index: Integer): double;
procedure SetGammaG(Index: Integer; Value: double);
function GetGammaF(Index: Integer): double;
procedure SetGammaF(Index: Integer; Value: double);
function GetGammaN(Index: Integer): double;
procedure SetGammaN(Index: Integer; Value: double);
function GetNuOfResonanve: integer;
procedure SetOuterModeratorA(Value: double);
function GetOuterModeratorA: double;
procedure SetOuterModeratorSigmaS(Value: double);
function GetOuterModeratorSigmaS: double;
procedure SetOuterModeratorRo(Value: double);
function GetOuterModeratorRo: double;
// procedure SetOuterModerator( aOuterModeratorInfo: TOuterModeratorInfo);
procedure SetVom(aVom: double);
public
property AbortCalcSSK: Boolean read fAbortCalcSSK write fAbortCalcSSK;
property Aborted: Boolean read fAborted;
property A: double read fA write fA; // Resonance adsorber Amass
property T: double read fT write fT; // Temperature
property Ro: double read fRo write fRo; // Resonance adsorber atom/(barn*cm)
property l_mean: double read fl_mean write fl_mean; // Mean hord in block cm
property Vc: double read fVc write fVc; // objemnoe otnoshenie obolochka/block
property Vom: double read fVom write SetVom; // objemnoe otnoshenie OuterModerator/block
property CellType: TCellType read fCellType write fCellType; // Cell Type
property Epsilon: double read fEpsilon write fEpsilon; // Accuracy
property Ro_mult_fl_mean_min: double read fRo_mult_fl_mean_min write fRo_mult_fl_mean_min;
property StepNo: integer read fStepNo;
property MaxStepNo: integer read fMaxStepNo write fMaxStepNo;
property ResonanceList: TResonanceInfoList read fResonanceList write fResonanceList;
property MixedModerators: TMixedModeratorList read fMixedModerators write fMixedModerators;
property OuterModerator: TOuterModeratorInfo read fOuterModerator write fOuterModerator; // SetOuterModerator; //
procedure AddResonance(aResonanceInfo: TResonanceInfo);
procedure ClearResonances;
function CalcI_Infinity: double;
function CalcSSK(const RoSSA: double; const SimpleCalc: Boolean=False; const CalcFissionSSK: Boolean=False;
const Emin: double=0.0; const Emax: double=1.0E18): double;
{$IFDEF DEBUG_SSK}
function CalcSSK_Goldstein(const RoSSA: double;
const UseDNSQ: Boolean=False; const CalcFissionSSK: Boolean=False;
const Emin: double=0.0; const Emax: double=1.0E18): double;
{$ENDIF}
property E0[Index: integer]: double read GetE0 write SetE0;
property GammaT[Index: integer]: double read GetGammaT write SetGammaT;
property GammaG[Index: integer]: double read GetGammaG write SetGammaG;
property GammaF[Index: integer]: double read GetGammaF write SetGammaF;
property GammaN[Index: integer]: double read GetGammaN write SetGammaN;
property NumberOfResonance: integer read GetNuOfResonanve;
property E_gr: double read fE_gr write fE_gr;
property ResonanceInCalculationNo: integer read fResonanceInCalculationNo;
property OuterModeratorA: double read GetOuterModeratorA write SetOuterModeratorA;
property OuterModeratorSigmaS: double read GetOuterModeratorSigmaS write SetOuterModeratorSigmaS;
property OuterModeratorRo: double read GetOuterModeratorRo write SetOuterModeratorRo;
constructor Create;
destructor Destroy; override;
end;
// OOB Classes
TVSLBWRP=class(TVObject)
private
fThZpA_s: integer;
fTwoSpin: Integer;
fFor_pi_AP__2: Single; // Sigma_p
fIsotope_AWR: Single; // A_mean
fl_State: integer; // l of neutron
fEdown: Single;
fEup: Single;
feV: Single;
fTwoJ: integer;
fGT: Single;
fGN: Single;
fGG: Single;
fGF: Single;
public
constructor Create; override;
constructor CreateFromResonanceInfo(const aThZpA_s: integer; const aResonanceInfo: TResonanceInfo);
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
property ThZpA_s: integer read fThZpA_s write fThZpA_s;
property TwoSpin: integer read fTwoSpin write fTwoSpin;
property For_pi_AP__2: Single read fFor_pi_AP__2 write fFor_pi_AP__2; // Sigma_p
property Isotope_AWR: Single read fIsotope_AWR write fIsotope_AWR; // A_mean
property l_State: integer read fl_State write fl_State; // l of neutron
property Edown: Single read fEdown write fEdown;
property Eup: Single read fEup write fEup;
property eV: Single read feV write feV;
property TwoJ: integer read fTwoJ write fTwoJ;
property GT: Single read fGT write fGT;
property GN: Single read fGN write fGN;
property GG: Single read fGG write fGG;
property GF: Single read fGF write fGF;
end;
TVSLBWRPColl=class(TVUniCollection)
private
public
constructor Create; override;
procedure MakeIndexBy_ThZpA_s;
function Clone: Pointer; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
end;
TVMLBWRP=class(TVSLBWRP);
TVMLBWRPcoll=class(TVSLBWRPcoll);
TVRMRP=class(TVSLBWRP)
private
fGFB: Single;
protected
//
public
property GFA: Single read fGF write fGF;
property GFB: Single read fGFB write fGFB;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
end;
TVRMRPcoll=class(TVSLBWRPcoll);
//LIB
procedure CopyResonanceInfo(const Src: TResonanceInfo; var Dst: TResonanceInfo);
function LoadAllResonancesFromOOB(const aDataBaseFileName: string): integer;
function FillResonancesInfoList(const aThZpA_s: integer; var aResInfoList: TResonanceInfoList;
const ResonanceType: string='ALL'; const Emin: double=0.5E-13; const Emax: double=100.0E13;
const l_min: integer=-MaxInt; const l_max: integer=MaxInt): integer;
function Resonances4ThZpA_sLoaded(const aThZpA_s: integer;
const ResonanceType: string='ALL'; const Emin: double=0.5E-13; const Emax: double=100.0E13;
const l_min: integer=-MaxInt; const l_max: integer=MaxInt): integer;
function ResonanceTypeToStr(aType: TResonanceType): string;
function Jfunc(const Theta, Beta: double; Epsilon: double=1.0E-10): double;
const
IndexBy_ThZpA_s='IndexBy_ThZpA_s';
rg_TVSLBWRP=1101;
rg_TVSLBWRPcoll=1102;
rg_TVMLBWRP=1103;
rg_TVMLBWRPcoll=1104;
rg_TVRMRP=1105;
rg_TVRMRPcoll=1106;
implementation
uses
{$IFDEF WINDOWS}
Windows,
{$ENDIF}
Sysutils, Dialogs, Forms,
{$IFDEF DEBUG_SSK}
DNSQ_all,
{$ENDIF}
Math;
const
Ln2=0.69314718055994530942;
TwoPiHsqDivMn_InCm2=2.603910231319732E-18; // 2*Pi*6.582122E-16^2/(9.3956563E8/2.99792458E10^2)
TwoPiHsqDivMn=2.603910231319732E6; // in Barns
Pi=3.1415926535897932385;
PiSqrRoot=1.77245385090551602729;
PiTwoPiHsqDivMnDiv2=1.0*Pi*TwoPiHsqDivMn/2.0; //3.8-qqqq
k_boltzmann=8.617385E-5;
ThreePlusSqrtThreeDiv2=2.366025403784439;
AforCequalOne=1.197168783648703;
Nequation=3;
var
SLBWRPs: TVSLBWRPColl;
MLBWRPs: TVMLBWRPColl;
RMRPs: TVRMRPColl;
ResonanceLoaded: Boolean;
{$IFDEF DEBUG_SSK}
aIOPT: Longint;
aN: Longint;
aX: array[1..Nequation] of Double;
aFVEC: array[1..Nequation] of Double;
aFJAC: array[1..Nequation*Nequation] of Double; // not used 3x3 Jackobian
aLDFJAC: Longint;
aXTOL: Double;
aMAXFEV: Longint;
aML, aMU: Longint;
aEPSFCN: Double;
aDIAG: array[1..Nequation] of Double;
aMODE: Longint;
aFACTOR: Double;
aNPRINT: Longint;
aINFO: Longint;
aNFEV: Longint;
aNJEV: Longint;
aR: array[1..Nequation*Nequation] of Double;
aLR: Longint;
aQTF: array[1..Nequation] of Double;
aWA1, aWA2, aWA3, aWA4: array[1..Nequation*Nequation] of Double;
// for intercommunicztion
a_betaSq: double;
a_beta_111: double;
a_CellType: TCellType;
a_tau, a_s_m, a_l_mean, a_Vom: double;
a_ka, a_lambda, a_mu: double;
a_c, a_aa, a_s, a_N_f, a_N_m: double;
a_sigma_0, a_sigma_am, a_sigma_f, a_G_gamma, a_G_n, a_G, a_beta, a_TmpFloat: double;
a_Er, a_x_ka, a_x_lambda, a_x_mu: double;
a_OneMinusAlpha_ka, a_OneMinusAlpha_lambda, a_OneMinusAlpha_mu: double;
{$ENDIF}// {$IFDEF DEBUG_SSK}
function Jfunc(const Theta, Beta: double; Epsilon: double=1.0E-10): double;
type
TJ_Table=array[0..31, 1..10] of double; // J(j,Theta) Beta=2^j+1e-5 j=0..31 Theta=0.1:0.1:1.0
const
J_table: TJ_Table=(
(4.979E+02, 4.970E+02, 4.969E+02, 4.968E+02, 4.968E+02, 4.968E+02, 4.967E+02, 4.967E+02, 4.967E+02, 4.967E+02),
(3.532E+02, 3.517E+02, 3.514E+02, 3.513E+02, 3.513E+02, 3.513E+02, 3.513E+02, 3.513E+02, 3.513E+02, 3.513E+02),
(2.514E+02, 2.492E+02, 2.487E+02, 2.485E+02, 2.485E+02, 2.484E+02, 2.484E+02, 2.484E+02, 2.484E+02, 2.484E+02),
(1.801E+02, 1.767E+02, 1.761E+02, 1.759E+02, 1.758E+02, 1.757E+02, 1.757E+02, 1.757E+02, 1.757E+02, 1.757E+02),
(1.307E+02, 1.257E+02, 1.248E+02, 1.245E+02, 1.244E+02, 1.243E+02, 1.243E+02, 1.243E+02, 1.242E+02, 1.242E+02),
(9.667E+01, 8.993E+01, 8.872E+01, 8.831E+01, 8.812E+01, 8.802E+01, 8.796E+01, 8.792E+01, 8.790E+01, 8.788E+01),
(7.355E+01, 6.501E+01, 6.335E+01, 6.278E+01, 6.252E+01, 6.238E+01, 6.230E+01, 6.225E+01, 6.221E+01, 6.218E+01),
(5.773E+01, 4.777E+01, 4.562E+01, 4.485E+01, 4.450E+01, 4.430E+01, 4.419E+01, 4.412E+01, 4.407E+01, 4.403E+01),
(4.647E+01, 3.589E+01, 3.328E+01, 3.230E+01, 3.183E+01, 3.158E+01, 3.143E+01, 3.133E+01, 3.126E+01, 3.121E+01),
(3.781E+01, 2.759E+01, 2.471E+01, 2.354E+01, 2.297E+01, 2.265E+01, 2.245E+01, 2.232E+01, 2.223E+01, 2.217E+01),
(3.045E+01, 2.153E+01, 1.867E+01, 1.741E+01, 1.675E+01, 1.638E+01, 1.614E+01, 1.598E+01, 1.587E+01, 1.579E+01),
(2.367E+01, 1.676E+01, 1.423E+01, 1.301E+01, 1.235E+01, 1.194E+01, 1.168E+01, 1.151E+01, 1.138E+01, 1.129E+01),
(1.730E+01, 1.268E+01, 1.074E+01, 9.718E+00, 9.119E+00, 8.739E+00, 8.484E+00, 8.304E+00, 8.174E+00, 8.077E+00),
(1.164E+01, 9.081E+00, 7.815E+00, 7.087E+00, 6.629E+00, 6.322E+00, 6.107E+00, 5.950E+00, 5.833E+00, 5.744E+00),
(7.172E+00, 6.014E+00, 5.342E+00, 4.914E+00, 4.624E+00, 4.419E+00, 4.268E+00, 4.154E+00, 4.066E+00, 3.997E+00),
(4.088E+00, 3.658E+00, 3.371E+00, 3.169E+00, 3.022E+00, 2.911E+00, 2.826E+00, 2.759E+00, 2.706E+00, 2.663E+00),
(2.204E+00, 2.067E+00, 1.966E+00, 1.889E+00, 1.829E+00, 1.781E+00, 1.743E+00, 1.712E+00, 1.687E+00, 1.666E+00),
(1.148E+00, 1.109E+00, 1.078E+00, 1.053E+00, 1.033E+00, 1.016E+00, 1.002E+00, 9.904E-01, 9.805E-01, 9.722E-01),
(5.862E-01, 5.757E-01, 5.671E-01, 5.599E-01, 5.539E-01, 5.488E-01, 5.445E-01, 5.408E-01, 5.376E-01, 5.348E-01),
(2.963E-01, 2.936E-01, 2.913E-01, 2.894E-01, 2.877E-01, 2.863E-01, 2.851E-01, 2.840E-01, 2.831E-01, 2.823E-01),
(1.490E-01, 1.483E-01, 1.477E-01, 1.472E-01, 1.468E-01, 1.464E-01, 1.461E-01, 1.458E-01, 1.455E-01, 1.453E-01),
(7.468E-02, 7.452E-02, 7.437E-02, 7.424E-02, 7.413E-02, 7.403E-02, 7.395E-02, 7.388E-02, 7.381E-02, 7.375E-02),
(3.739E-02, 3.735E-02, 3.732E-02, 3.728E-02, 3.726E-02, 3.723E-02, 3.721E-02, 3.719E-02, 3.718E-02, 3.716E-02),
(1.871E-02, 1.870E-02, 1.869E-02, 1.868E-02, 1.868E-02, 1.867E-02, 1.867E-02, 1.866E-02, 1.866E-02, 1.865E-02),
(9.358E-03, 9.356E-03, 9.355E-03, 9.352E-03, 9.350E-03, 9.349E-03, 9.348E-03, 9.346E-03, 9.345E-03, 9.344E-03),
(4.680E-03, 4.680E-03, 4.679E-03, 4.679E-03, 4.678E-03, 4.678E-03, 4.678E-03, 4.677E-03, 4.677E-03, 4.677E-03),
(2.340E-03, 2.340E-03, 2.340E-03, 2.340E-03, 2.340E-03, 2.340E-03, 2.340E-03, 2.340E-03, 2.340E-03, 2.340E-03),
(1.170E-03, 1.170E-03, 1.170E-03, 1.170E-03, 1.170E-03, 1.170E-03, 1.170E-03, 1.170E-03, 1.170E-03, 1.170E-03),
(5.851E-04, 5.851E-04, 5.851E-04, 5.851E-04, 5.851E-04, 5.851E-04, 5.851E-04, 5.851E-04, 5.851E-04, 5.851E-04),
(2.925E-04, 2.926E-04, 2.926E-04, 2.926E-04, 2.926E-04, 2.926E-04, 2.926E-04, 2.926E-04, 2.926E-04, 2.926E-04),
(1.463E-04, 1.463E-04, 1.463E-04, 1.463E-04, 1.463E-04, 1.463E-04, 1.463E-04, 1.463E-04, 1.463E-04, 1.463E-04),
(7.314E-05, 7.314E-05, 7.315E-05, 7.315E-05, 7.315E-05, 7.315E-05, 7.314E-05, 7.314E-05, 7.314E-05, 7.314E-05));
var
// I: integer;
Theta1, j1, Theta2, j2: integer;
j, Theta10, J_func1, J_func2, J_func3, J_func4, t, u: double;
begin
if Beta<=0 then begin
Result:= -1;
Exit;
end;
// Time Optimization
// if ((Theta>=0.1)and(Theta<=1)and(Beta>=1.0E-5)and(Beta<=2147483648*1.0E-5)) then begin// In J_table
j:= Ln(Beta*1.0E5)/Ln2;
Theta10:= 10*Theta;
if ((Theta10>=1)and(Theta10<=10)and(j>=0)and(j<=31)) then begin// In J_table
// j1:= Floor(j);
j1:= Trunc(j);
if (j1=j) then
j2:= j1
else begin
if (j1<31) then
j2:= j1+1
else
j2:= 31;
end;
// Theta1:= Floor(Theta10);
Theta1:= Trunc(Theta10);
if (Theta1=Theta10) then
Theta2:= Theta1
else begin
if (Theta1<10) then begin
Theta2:= Theta1+1;
end
else
Theta2:= 10;
end;
// Below will be never
(*
if Theta1>Theta2 then begin
I:= Theta1;
Theta1:= Theta2;
Theta2:= I;
end;
if j1>j2 then begin
I:= j1;
j1:= j2;
j2:= I;
end;
*)
if ((j1=j2)and(Theta1=Theta2)) then
Result:= J_table[j1, Theta1]
else if (j1=j2) then // !! Theta1<=10*Theta<=Theta2
Result:= Exp(Ln(J_table[j1, Theta1])+(Ln(J_table[j1, Theta2])-Ln(J_table[j1, Theta1]))/(Theta2-Theta1)*(Theta10-Theta1))
else if (Theta1=Theta2) then
Result:= Exp(Ln(J_table[j1, Theta1])+(Ln(J_table[j1, Theta1])-Ln(J_table[j2, Theta1]))/(j2-j1)*(j1-j))
else begin// Numerical Recipes 3-6 (2D interpolation), Here-for Ln
J_func1:= Ln(J_table[j1, Theta1]);
J_func2:= Ln(J_table[j2, Theta1]);
J_func3:= Ln(J_table[j2, Theta2]);
J_func4:= Ln(J_table[j1, Theta2]);
t:= (j-j1)/(j2-j1);
u:= (Theta10-Theta1)/(Theta2-Theta1);
Result:= Exp((1-t)*(1-u)*J_func1+t*(1-u)*J_func2+t*u*J_func3+(1-t)*u*J_func4);
end;
// Result
end
else begin// analitic
if ((Theta<0.15)and(Beta>Theta*Theta)and(Theta>6*Beta)) then
try
Result:= 2/Theta*sqrt(Ln(Theta*PiSqrRoot/(2.0*Beta)))
except
Result:= Pi/(2*sqrt(Beta*(Beta+1)))
end
else
Result:= Pi/(2*sqrt(Beta*(Beta+1)))
end;
//(* /// qqqqq uncomment
if 2/Pi*Beta*Result>1.0 then //I_infinity<I_self-shielded
Result:= Result/(2/Pi*Beta*Result);
//*)
end;
{TMixedModeratorList}
procedure TMixedModeratorList.Add(aMixedModeratorInfo: TMixedModeratorInfo);
var
NewMixedModeratorInfo: PMixedModeratorInfo;
begin
New(NewMixedModeratorInfo);
with NewMixedModeratorInfo^ do begin
A:= aMixedModeratorInfo.A;
SigmaS:= aMixedModeratorInfo.SigmaS;
Ro:= aMixedModeratorInfo.Ro;
end;
inherited Add(NewMixedModeratorInfo);
end;
constructor TMixedModeratorList.Create;
begin
inherited Create;
end;
destructor TMixedModeratorList.Destroy;
var
I: integer;
begin
for I:= Count-1 downto 0 do
if (Items[I]<>nil) then
Dispose(PMixedModeratorInfo(Items[I]));
inherited Destroy;
end;
function TMixedModeratorList.GetMixedModeratorA(Index: integer): double;
begin
Result:= TMixedModeratorInfo(Items[Index]^).A;
end;
function TMixedModeratorList.GetMixedModeratorInfo(Index: integer): TMixedModeratorInfo;
begin
Result:= TMixedModeratorInfo(Items[Index]^);
end;
function TMixedModeratorList.GetMixedModeratorRo(Index: integer): double;
begin
Result:= TMixedModeratorInfo(Items[Index]^).Ro;
end;
function TMixedModeratorList.GetMixedModeratorSigmaS(
Index: integer): double;
begin
Result:= TMixedModeratorInfo(Items[Index]^).SigmaS;
end;
procedure TMixedModeratorList.SetMixedModeratorA(Index: integer;
const aMixedModeratorInfoA: double);
begin
TMixedModeratorInfo(Items[Index]^).A:= aMixedModeratorInfoA;
end;
procedure TMixedModeratorList.SetMixedModeratorInfo(Index: integer;
const aMixedModeratorInfo: TMixedModeratorInfo);
begin
TMixedModeratorInfo(Items[Index]^).A:= aMixedModeratorInfo.A;
TMixedModeratorInfo(Items[Index]^).SigmaS:= aMixedModeratorInfo.SigmaS;
TMixedModeratorInfo(Items[Index]^).Ro:= aMixedModeratorInfo.Ro;
end;
procedure TMixedModeratorList.SetMixedModeratorRo(Index: integer;
const aMixedModeratorInfoRo: double);
begin
TMixedModeratorInfo(Items[Index]^).Ro:= aMixedModeratorInfoRo;
end;
procedure TMixedModeratorList.SetMixedModeratorSigmaS(Index: integer;
const aMixedModeratorInfoSigmaS: double);
begin
TMixedModeratorInfo(Items[Index]^).SigmaS:= aMixedModeratorInfoSigmaS;
end;
{TResonanceInfoList}
procedure AssignResonanceToResonanceInfo(const aResonance: TResonanceInfo; NewResonanceInfo: PResonanceInfo);
begin
with NewResonanceInfo^, aResonance do begin
NewResonanceInfo^.TwoI:= aResonance.TwoI;
NewResonanceInfo^.TwoJ:= aResonance.TwoJ;
NewResonanceInfo^.SigmaS:= aResonance.SigmaS;
NewResonanceInfo^.L:= aResonance.L;
NewResonanceInfo^.Edown:= aResonance.Edown;
NewResonanceInfo^.Eup:= aResonance.Eup;
NewResonanceInfo^.E0:= aResonance.E0;
NewResonanceInfo^.GammaT:= aResonance.GammaT;
NewResonanceInfo^.GammaN:= aResonance.GammaN;
NewResonanceInfo^.GammaG:= aResonance.GammaG;
NewResonanceInfo^.GammaF:= aResonance.GammaF;
// NewResonanceInfo^.GammaFA:= aResonance.GammaFA;
NewResonanceInfo^.GammaFB:= aResonance.GammaFB;
end;
end;
procedure TResonanceInfoList.Add(aResonanceInfo: TResonanceInfo);
var
NewResonanceInfo: PResonanceInfo;
begin
New(NewResonanceInfo);
with NewResonanceInfo^ do begin
ResonanceType:= aResonanceInfo.ResonanceType;
A:= aResonanceInfo.A;
TwoI:= aResonanceInfo.TwoI;
TwoJ:= aResonanceInfo.TwoJ;
SigmaS:= aResonanceInfo.SigmaS;
L:= aResonanceInfo.L;
Edown:= aResonanceInfo.Edown;
Eup:= aResonanceInfo.Eup;
E0:= aResonanceInfo.E0;
GammaT:= aResonanceInfo.GammaT;
GammaN:= aResonanceInfo.GammaN;
GammaG:= aResonanceInfo.GammaG;
GammaF:= aResonanceInfo.GammaF;
// GammaFA:= aResonanceInfo.GammaFA;
GammaFB:= aResonanceInfo.GammaFB;
end;
inherited Add(NewResonanceInfo);
end;
procedure TResonanceInfoList.Assign(aResonanceInfoList: TResonanceInfoList);
var
I: integer;
aResonanceInfo: TResonanceInfo;
begin
if Self<>aResonanceInfoList then begin
Self.Clear;
for I:= 0 to aResonanceInfoList.Count-1 do begin
aResonanceInfo:= aResonanceInfoList[I];
Self.Add(aResonanceInfo);
end;
// Self.Add(aResonanceInfoList[I]);
end;
end;
constructor TResonanceInfoList.Create;
begin
inherited Create;
end;
destructor TResonanceInfoList.Destroy;
var
I: integer;
begin
for I:= 0 to Count-1 do
if (Items[I]<>nil) then
Dispose(PResonanceInfo(Items[I]));
inherited Destroy;
end;
function TResonanceInfoList.FindInList(const E0: double; const Epsilon: double=1.0E-3): integer;
var
I: integer;
begin
Result:= -1;
for I:= 0 to Self.Count-1 do
if (((1+Epsilon)*E0>=Self[I].E0)and((1-Epsilon)*E0<=Self[I].E0)) then begin
Result:= I;
break;
end;
end;
function TResonanceInfoList.GetResonanceInfo(Index: integer): TResonanceInfo;
begin
Result:= TResonanceInfo(Items[Index]^);
end;
procedure TResonanceInfoList.SetResonanceInfo(Index: integer; aResonanceInfo: TResonanceInfo);
begin
AssignResonanceToResonanceInfo(aResonanceInfo, Items[Index]);
end;
{ShelfShieldingCalculator}
function TSelfShieldingCalculator.GetOuterModeratorA: double;
begin
Result:= fOuterModerator.A;
end;
function TSelfShieldingCalculator.GetOuterModeratorRo: double;
begin
Result:= fOuterModerator.Ro;
end;
function TSelfShieldingCalculator.GetOuterModeratorSigmaS: double;
begin
Result:= fOuterModerator.SigmaS;
end;
procedure TSelfShieldingCalculator.SetOuterModeratorA(Value: double);
begin
fOuterModerator.A:= Value;
end;
procedure TSelfShieldingCalculator.SetOuterModeratorRo(Value: double);
begin
fOuterModerator.Ro:= Value;
end;
procedure TSelfShieldingCalculator.SetOuterModeratorSigmaS(Value: double);
begin
fOuterModerator.SigmaS:= Value;
end;
constructor TSelfShieldingCalculator.Create;
begin
inherited;
fResonanceList:= TResonanceInfoList.Create;
fMixedModerators:= TMixedModeratorList.Create;
fZmis:= TFloatList.Create;
fz_smallis:= TFloatList.Create;
fdeltais:= TFloatList.Create;
fEpsilon:= 1.0E-3;
fMaxStepNo:= 1000;
fE_gr:= 0.215;
fCellType:= ctNoCell;
fl_mean:= 0.5;
fT:= 300.0;
fVc:= 0.0;
fVom:= 0.0;
fRo_mult_fl_mean_min:= 1E-10;
end;
function TSelfShieldingCalculator.GetE0(Index: Integer): double;
begin
Result:= ResonanceList[Index].E0;
end;
function TSelfShieldingCalculator.GetGammaT(Index: Integer): double;
begin
Result:= ResonanceList[Index].GammaT;
end;
function TSelfShieldingCalculator.GetGammaG(Index: Integer): double;
begin
Result:= ResonanceList[Index].GammaG;
end;
function TSelfShieldingCalculator.GetGammaF(Index: Integer): double;
begin
Result:= ResonanceList[Index].GammaF;
end;
function TSelfShieldingCalculator.GetGammaN(Index: Integer): double;
begin
Result:= ResonanceList[Index].GammaN;
end;
function TSelfShieldingCalculator.GetNuOfResonanve: integer;
begin
Result:= ResonanceList.Count;
end;
procedure TSelfShieldingCalculator.SetE0(Index: Integer; Value: double);
var
NewResonanceInfo: PResonanceInfo;
begin
New(NewResonanceInfo);
with NewResonanceInfo^ do begin
AssignResonanceToResonanceInfo(ResonanceList[Index], NewResonanceInfo);
NewResonanceInfo^.E0:= Value;
end;
ResonanceList.SetResonanceInfo(Index, NewResonanceInfo^);
end;
procedure TSelfShieldingCalculator.SetGammaT(Index: Integer; Value: double);
var
NewResonanceInfo: PResonanceInfo;
begin
New(NewResonanceInfo);
with NewResonanceInfo^ do begin
AssignResonanceToResonanceInfo(ResonanceList[Index], NewResonanceInfo);
NewResonanceInfo^.GammaT:= Value;
end;
ResonanceList.SetResonanceInfo(Index, NewResonanceInfo^);
end;
procedure TSelfShieldingCalculator.SetGammaG(Index: Integer; Value: double);
var
NewResonanceInfo: PResonanceInfo;
begin
New(NewResonanceInfo);
with NewResonanceInfo^ do begin
AssignResonanceToResonanceInfo(ResonanceList[Index], NewResonanceInfo);
NewResonanceInfo^.GammaG:= Value;
end;
ResonanceList.SetResonanceInfo(Index, NewResonanceInfo^);
end;
procedure TSelfShieldingCalculator.SetGammaF(Index: Integer; Value: double);
var
NewResonanceInfo: PResonanceInfo;
begin
New(NewResonanceInfo);
with NewResonanceInfo^ do begin
AssignResonanceToResonanceInfo(ResonanceList[Index], NewResonanceInfo);
NewResonanceInfo^.GammaF:= Value;
end;
ResonanceList.SetResonanceInfo(Index, NewResonanceInfo^);
end;
procedure TSelfShieldingCalculator.SetGammaN(Index: Integer; Value: double);
var
NewResonanceInfo: PResonanceInfo;
begin
New(NewResonanceInfo);
with NewResonanceInfo^ do begin
AssignResonanceToResonanceInfo(ResonanceList[Index], NewResonanceInfo);
NewResonanceInfo^.GammaN:= Value;
end;
ResonanceList.SetResonanceInfo(Index, NewResonanceInfo^);
end;
function TSelfShieldingCalculator.CalcI_Infinity: double;
var
I: integer;
g: double;
// GT: double;
begin
Result:= 0.0;
try
for I:= 0 to ResonanceList.Count-1 do begin
g:= (ResonanceList[I].TwoJ+1)/(2*(ResonanceList[I].TwoI+1));
(*
if ResonanceList[I].ResonanceType=rtRMRP then
GT:= sqrt(ResonanceList[I].GammaN*ResonanceList[I].GammaN+ResonanceList[I].GammaG*ResonanceList[I].GammaG+
ResonanceList[I].GammaF*ResonanceList[I].GammaF+ResonanceList[I].GammaFB*ResonanceList[I].GammaFB)
else
GT:= ResonanceList[I].GammaT;
*)
Result:= Result+g*PiTwoPiHsqDivMnDiv2*ResonanceList[I].GammaN*ResonanceList[I].GammaG/
(ResonanceList[I].GammaT*ResonanceList[I].E0*ResonanceList[I].E0)*
(1/2-ArcTan(2.0*(fE_gr-ResonanceList[I].E0)/ResonanceList[I].GammaT)/Pi);
(*
Result:= Result+g*PiTwoPiHsqDivMnDiv2*ResonanceList[I].GammaN*ResonanceList[I].GammaG/
(GT*ResonanceList[I].E0*ResonanceList[I].E0)*
(1/2-ArcTan(2.0*(fE_gr-ResonanceList[I].E0)/GT)/Pi);
*)
end;
except
Result:= -1;
end;
end;
destructor TSelfShieldingCalculator.Destroy;
begin
fResonanceList.Free;
fMixedModerators.Free;
fZmis.Free;
fz_smallis.Free;
fdeltais.Free;
inherited;
end;
procedure TSelfShieldingCalculator.AddResonance(aResonanceInfo: TResonanceInfo);
begin
fResonanceList.Add(aResonanceInfo);
end;
procedure TSelfShieldingCalculator.ClearResonances;
begin
fResonanceList.Clear;
end;
function TSelfShieldingCalculator.CalcSSK(const RoSSA: double; const SimpleCalc: Boolean=False;
const CalcFissionSSK: Boolean=False; const Emin: double=0.0; const Emax: double=1.0E18): double;
var
Z, delta, z_small, Z_m, z_small_m, delta_m, RI, OneResonance: double;
Zmis, z_smallis, deltais: TFloatList;
s, s_prev, Sp, sigma_0, Er, GT, GN, GG, g, m, n, s_m, gamma_0: double;
Theta: double;
SumSigma_mi: double;
aa, c, mu, mu_prev, tau, tau_0, alpha, SigmaOM: double;
procedure InitVars;
var
I: integer;
TheResonance: TResonanceInfo;
begin
// Init vars for a resonance # ResonanceInfoNo
Z_m:= 0;
Z:= 0.5;
Zmis.Clear;
z_smallis.Clear;
deltais.Clear;
TheResonance:= fResonanceList[fResonanceInCalculationNo];
with TheResonance do begin
if TheResonance.A>0 then
fA:= TheResonance.A;
if TheResonance.E0>0 then
Er:= TheResonance.E0
else
Er:= -TheResonance.E0;
GT:= TheResonance.GammaT;
if not(CalcFissionSSK) then
GN:= TheResonance.GammaN
else
GN:= TheResonance.GammaF;
GG:= TheResonance.GammaG;
Sp:= TheResonance.SigmaS;
g:= (TheResonance.TwoJ+1)/(2*(TheResonance.TwoI+1));
sigma_0:= TwoPiHsqDivMn*g*GN/(GT*Er);
m:= sigma_0*GG/GT;
n:= sigma_0*GN/GT;
Theta:= 0.5*GT*sqrt(fA/(Er*k_boltzmann))*1.0E9; // T==0; now - Temperature in the end
(*
if fT>0 then
// Theta:= sqrt(fA*GT*GT/(4*Er*k_boltzmann*fT))
Theta:= 0.5*GT*sqrt(fA/(Er*k_boltzmann*fT))
else
Theta:= 0.5*GT*sqrt(fA/(Er*k_boltzmann))*1.0E9;
// Theta:= sqrt(fA*GT*GT/(4*Er*k_boltzmann*1.0e-18));//1-bad;
*)
end;
// Dancoff
if (fCellType=ctHex) then begin
tau_0:= -0.12;
alpha:= sqrt(3)/2;
end
else if (fCellType=ctSquare) then begin
tau_0:= -0.08;
alpha:= 1.0;
end;
s_m:= fOuterModerator.SigmaS*fOuterModerator.Ro*fVom/fRo;
SigmaOM:= fOuterModerator.SigmaS*fOuterModerator.Ro;
// Dancoff
// First Step Z_m==0 --> mu:= (1-Z_m)/(1+(s/s_m-1)*Z_m)==1
mu:= 1;
if fCellType<>ctNoCell then begin
tau:= (sqrt(Pi/(4*alpha))*sqrt(1+fVom/(1+fVc))-1)/(fVom*sqrt(1+fVc))+tau_0*(1+0.5*sqrt(fVc/(1-fVc)));
c:= 1-exp(-tau*SigmaOM*fl_mean*fVom*mu)/(1+(1-tau)*SigmaOM*fl_mean*fVom*mu);
if c<0 then
c:= 1.0;
//By Toporov
//(*
aa:= (ThreePlusSqrtThreeDiv2+sqrt(c))*(ThreePlusSqrtThreeDiv2+sqrt(c))/
((ThreePlusSqrtThreeDiv2+sqrt(c))*(ThreePlusSqrtThreeDiv2+sqrt(c))-ThreePlusSqrtThreeDiv2*ThreePlusSqrtThreeDiv2*c/3);
s:= aa*c/(fRo*fl_mean); // By Toporov qqqq
//*)
(*
// By Goldstein
aa:= 1.27/(1+0.1*c);
s:= aa*(1-c)/(fRo*fl_mean);// By GoldStein
if s<0 then
s:= fOuterModerator.SigmaS*fOuterModerator.Ro/fRo;
*)
end
else
s:= AforCequalOne/(fRo*fl_mean); // No Cell qqqq was s:= 1/(fRo*fl_mean);
// End Dancoff
SumSigma_mi:= 0;
for I:= 0 to fMixedModerators.Count-1 do
SumSigma_mi:= SumSigma_mi+fMixedModerators[I].SigmaS*fMixedModerators[I].Ro/fRo;
gamma_0:= (s+Sp+SumSigma_mi)/sigma_0;
for I:= 0 to fMixedModerators.Count-1 do begin
Zmis.Add(0.5);
z_smallis.Add(0.0);
deltais.Add(0.0);
end;
end;
function CalcOneResonance: Boolean;
var
I: integer;
gamma_new, gamma_prev, JfromGamma, JfromGamma0, z_small_factor: double;
SumSigma_miMultOneMinusZmi: double;
begin
// OneResonance calculation
Application.ProcessMessages;
try
OneResonance:= 0.0;
// JfromGamma0:= Jfunc(Theta, gamma_0); // now Pi/2.0/sqrt(gamma_0*(1+gamma_0))
JfromGamma0:= Pi/2.0/sqrt(gamma_0*(1+gamma_0));
gamma_prev:= 0; //100;
gamma_new:= 1;
s_prev:= 0; //100;
s:= 1;
mu_prev:= 0.1;
mu:= 0.9;
while ((not AreFloatsEqualRel(gamma_new, gamma_prev, fEpsilon))or(not AreFloatsEqualRel(mu, mu_prev, fEpsilon))
or(not AreFloatsEqualRel(s, s_prev, fEpsilon)))and(fStepNo<fMaxStepNo) do begin
s_prev:= s;
if s_m>0 then begin
mu_prev:= 0.1;
mu:= 0.9;
// Dancoff
while (not AreFloatsEqualRel(mu, mu_prev, fEpsilon)) do begin
Application.ProcessMessages;
mu_prev:= mu;
if (1+(s/s_m-1)*Z_m)>0 then
mu:= (1-Z_m)/(1+(s/s_m-1)*Z_m)
else
mu:= (1-Z_m)/(1+fEpsilon+(s/s_m-1)*Z_m);
if fCellType<>ctNoCell then begin
tau:= (sqrt(Pi/(4*alpha))*sqrt(1+fVom/(1+fVc))-1)/(fVom*sqrt(1+fVc))+
tau_0*(1+0.5*sqrt(fVc/(1-fVc)));
c:= 1-exp(-tau*SigmaOM*fl_mean*fVom*mu)/(1+(1-tau)*SigmaOM*fl_mean*fVom*mu);
if s<0 then
s:= fOuterModerator.SigmaS*fOuterModerator.Ro/fRo;
(*
// By Goldstein
aa:= 1.27/(1+0.1*c);
s:= aa*(1-c)/(fRo*fl_mean);// By GoldStein
if s<0 then
s:= fOuterModerator.SigmaS*fOuterModerator.Ro/fRo;
*)
//(*
// By Toporov
aa:= (ThreePlusSqrtThreeDiv2+sqrt(c))*(ThreePlusSqrtThreeDiv2+sqrt(c))/
((ThreePlusSqrtThreeDiv2+sqrt(c))*(ThreePlusSqrtThreeDiv2+sqrt(c))-ThreePlusSqrtThreeDiv2*ThreePlusSqrtThreeDiv2*c/3);
s:= aa*c/(fRo*fl_mean); // By Toporov qqqq
//*)
end
else begin
s:= AforCequalOne/(fRo*fl_mean); // No Cell qqqq was s:= 1/(fRo*fl_mean); // No Cell
end;
end;
// End Dancoff
end;
if (fStepNo=1) then begin
gamma_new:= (2*s+Sp+SumSigma_mi)/(m+sigma_0);
end;
// JfromGamma:= Jfunc(Theta, gamma_new); // now Pi/2.0/sqrt(gamma_new*(1+gamma_new))
try
JfromGamma:= Pi/2.0/sqrt(gamma_new*(1+gamma_new));
except
; // in codetyphon SIGFPE exception in DuildSSKTable calc tst.chn with SSK
end;
z_small_factor:= (gamma_new*JfromGamma-gamma_0*JfromGamma0)/((gamma_new-gamma_0)*JfromGamma*JfromGamma0);
for i:= 0 to fMixedModerators.Count-1 do begin
//(*
// By TOPOROV
deltais[i]:= 4*Pi*Er*fMixedModerators[i].A/(GT*(fMixedModerators[i].A+1)*(fMixedModerators[i].A+1));
// z_smallis[i]:= deltais[i]*(gamma_new*JfromGamma-gamma_0*JfromGamma0)/((gamma_new-gamma_0)*JfromGamma*JfromGamma0);
z_smallis[i]:= deltais[i]*z_small_factor; //(gamma_new*JfromGamma-gamma_0*JfromGamma0)/((gamma_new-gamma_0)*JfromGamma*JfromGamma0);
if (z_smallis[i]<>0) then
Zmis[i]:= ArcTan(z_smallis[i])/z_smallis[i]
else
Zmis[i]:= 1;
//*)
(*
// By GOLDSTEIN
deltais[i]:= 8.0*Er*fMixedModerators[i].A/(GT*(fMixedModerators[i].A+1)*(fMixedModerators[i].A+1));
// z_smallis[i]:= (Pi*deltais[i]/2)*(gamma_new*JfromGamma-gamma_0*JfromGamma0)/((gamma_new-gamma_0)*JfromGamma*JfromGamma0);
// z_small_factor:= (gamma_new*JfromGamma-gamma_0*JfromGamma0)/((gamma_new-gamma_0)*JfromGamma*JfromGamma0);
z_smallis[i]:= (Pi*deltais[i]/2)*z_small_factor;
if (z_smallis[i]<>0) then
Zmis[i]:= ArcTan(z_smallis[i])/z_smallis[i]
else
Zmis[i]:= 1;
*)
end;
//(*
// By TOPOROV
delta_m:= 4*Pi*Er*fOuterModerator.A/(GT*(fOuterModerator.A+1)*(fOuterModerator.A+1));
z_small_m:= delta_m*(gamma_new*JfromGamma-gamma_0*JfromGamma0)/((gamma_new-gamma_0)*JfromGamma*JfromGamma0);
if (z_small_m<>0) then
Z_m:= ArcTan(z_small_m)/z_small_m
else
Z_m:= 1;
delta:= 4*Pi*Er*fA/(GT*(fA+1)*(fA+1));
z_small:= delta*(gamma_new*JfromGamma-gamma_0*JfromGamma0)/((gamma_new-gamma_0)*JfromGamma*JfromGamma0);