SRIMfit
Users Manual

Update Log :2018.10/22 ver 3.01.03E English edition

2018/10/22 (v.3.01.03E)

SRIMfit Users Manual

1SRIMfit Users ManualContents⚫ SRIMfit User I/F⚫ SRIM-2013 data book ( MySRIMwb.xlsx )⚫ Function help message⚫ Function list
⚫ List (1) Fundamental functions⚫ List (2a) Combination functions⚫ List (2b) Combination functions for Gas target⚫ How to prepare MySRIMwb

2018/10/22 (v.3.01.03E)

SRIMfit Users Manual2SRIMfit User I/F
SRIMfit is a macro function library for MS-Excel which calculate range, stopping power andenergy loss of ions in a matter. The function reads a stopping/range table provided by SRIM2013 1) and returns a fitted result at a certain energy.
MS-Office system AddIn folder

User Document Folder
UserBook.xlｓｘ

function call

SRIMfit. xlam

MySRIMwb. xlsx

AddIn code

SRIM data book
retrievesr**( )
= srE2Rng( WSname , E )Macro Function Lib.

WSname =srim40Ar_Si（Beam_Target）

SRIM data table Lib.

➢ “SRIMfit.xlam” is macro-function libraries corded by using Excel Visual Basic.
➢ “MySRIMwb.xlsx” is stopping/range data tables provided by SRIM-2013 code.
➢ SRIMfit modules are installed as an Excel “system Add-In macro” function
All SRIMfit functions are named as “sr**( )”. For example, the range calculation function
named srE2Rng( ) needs two parameters; Energy of the beam and WSnm in order to specify
the combination of beam nuclide and target material. The function retrieves the SRIM data
book using the specified WSnm, then reads its stopping/range table and calculates range at a
specified energy using a simple linear interpolation. Finally, the calculated range-value isreturned to user’s spread sheet.
➢ “SRIMfit.xlam” provides about 80 functions.
➢ “MySRIMwb.xlsx” can include many work-sheets. The name of the work-sheet (WSnm)
can be defined as “BeamNuclide_TargetMaterial”, for example, “srim40Ar_Si”.
In this manner, one function can calculate many combinations of beam and target, justchanging the WSnm parameter.
➢ Operating environment:
MS-Excel later than ver. 2003 running on
MS-Windows OS later than XP or MacOS (*)(*)

MacOS 10.14 + Excel for Mac 2016 has been tested.

Ref.) 1) J.F. Ziegler, SRIM-2013 code home page; http://srim.org/

2018/10/22 (v.3.01.03E)

SRIMfit Users Manual3

SRIM-2013 data book ( MySRIMwb.xlsx )Example of “MySRIMwb.xslx”
WSname = srim40Ar_Kapton

In a work sheet named “srim40Ar_Kapton”, the values in yellow cells are all copied fromthe stopping/range table provided by SRIM code. The format of the work sheet is strictly
defined in the macro code. Not only E vs. Range table, but also dE/dX and straggling table andall other information are included in this sheet. That is to say, this one work sheet has object
data structure which includes all calculation conditions and results using SRIM code.
➢ “MySRIMwb.xlsx” data-base file should be prepared manually as users own purpose.
e.g.) combination of beams (Ar, Kr and Xe ) times
combination of targets (Kapton, Mylar, Air, Plastic scintillator, Al and Si) makes
18 data sheets should be prepared in advance by using SRIM-2013 code.
➢ A macro utility “srOut2Ws.xlsm” helps you to convert
a SRIM-2013 output.txt file to “MySRIMwb.xlsx” work-sheet format.
The nickname “SRIMfit” is named as “macro function library for fitting SRIM-2013 like
output”. You may be noticed, as long as the format of the data-base sheet is identical, you can
use not only the SRIM output but can use any stopping/range table provided by other codes.

2018/10/22 (v.3.01.03E)

SRIMfit Users Manual

4Function help message

Function help messages are available.
• Click “fx” insert function icon
• Category = “SRIMfit”
Then you can see a list of SRIMfit functions.

Almost every function requires
WSname argument to specify
a retrieval data sheet.

➢ Unit system for function arguments.
••••

Beam Energy[MeV/u]Range, Straggling [µm]Thickness[µm] or [mm] for Gas target
LET (dE/dX)[MeV/(mg/cm2)] as default.

➢ Unit conversion• [MeV/u] = E [MeV] / srInfoIonA(WSname)• [µm] = srmg2um( WSname, T [mg/cm2] ) , [mg/cm2] = srum2mg( WSname, T [µm] )• For the unit of LET (dE/dX), SRIM-2013 supports eight kinds of unit system.
The “Uid = 0 .. 8” argument specify the unit system.

e.g.) [keV/µm] = LET [MeV/(mg/cm2)] * srLETCnvF(WSname, Uid=2 )2018/10/22 (v.3.01.03E)

SRIMfit Users Manual

5

Func.List(1)Function List (1) Fundamental functions
Original list below is included in SRIMfit.xlsm< Type of Param, Return >I
Integer
D Double
B Boolean
S String
V Variant type
< Notation for Parameters >WS S SRIMoutput WorkSheet nameE, Eu D Beam Energy [MeV/u]
Et D Beam Energy [MeV]
R D Range [μm]Uid I
LET unit ID# 0..8
LET D defa. [MeV/(mg/cm2)] dep.on Uid
Th,Tum,Tmm D Thickness [μm] | [mm]
Pa D Gas Pressure [Pa]dgC D Gas Temperature [degC]●< Variant type function : Error return values >#NUM!
xlErrNum 2036 Invalid NUMber as parameter#N/A
xlErrNA 2042 return value Not Available< Private Variables defined in this macro code >Clm*Column number in a WS
Row*
Row number in a WS
MySRwbNow
Current WorkBook pointerMySRwsNow
Current WorkSheet pointer
WSnow
Current WorkSheet name
Cur.WS parameters
IxE{min|max}, E{min|max}, R{min|max},
St{Lng|Ltr}{min|max}, SPfct()

mark indicates most useful functions.

Category

Return type Func.nameparams.

type

Func. Description
Return value Error conditions

Param. Description

Comments

Macro Init / Term procedures
Sub srMySRwb_open
MyFn
S MySRwb file name

SRIMoutput WorkBook (MySRwb) Open procedure
As default, Const MySRwbFn ="MySRIMwb.xlsx" is used
Its Path is MySRwbDir= ThisWorkbook.Path as a default.

Sub srMySRwb_close

SRIMoutput WorkBook (MySRwb) Close procedure

Macro informationsS

srMcrVerSRIMfit version number
defined as Const SRIMfitVerS

srMcrPath

Installed Path of MySRwb
returns ThisWorkbook.PathS

srMcrWBname

File name of current MySRwb
returns MySRwbFnNow

S

srMcrWBname

File path of current MySRwb
returns MySRwbDirNow

I

srMcrWScountNum. of Sheets included in MySRwb

S()

srMcrWSlist

Sub srMcr_WSlistsToRngS S

returns All-Sheet.names included in MySRwb
in 1-dim string array format
make a list of All-Sheet.names included in MySRwb
Top cell position for the list. Eg.) "A10"

WS independent functions
S

srElmNmZ

I

2018/10/22 (v.3.01.03E)●

Element symbol

Atomic number Z= 1..118

SRIMfit Users Manual

6Func.List(1)Category

Return type Func.nameparams.

type

Param. Description

Func. Description
Return value Error conditions

Comments

WS information(1) : directly read from a current WS
S
I
IS

srInfoVer
WS

S

WSnameSRIM version num.

srInfoIonZ
WS

S

WSnamesrInfoIonA
WS

S

WSnamesrInfoTrgName
WS
S

WSname● Beam Z ; Atomic number● Beam A ; Mass number
Target name (in short format)

S

srInfoTrgNameLWS
S WSname

Target name (in long format)

D

srInfoTrgDens
WS
S

Target density in [g/cm3]
WSnameD

srInfoTrgDensAWS
S WSname

Target density in [atoms/cm3]D

srInfoBrgC
WS

Bragg Correction in [%]

D
D
B

S

WSnamesrInfoTrgPtbl
WSS

WSnameif GasTarget, a specified gas pressure in [Pa]when you calculated this WS using SRIM-2013

srInfoTrgTtbl
WS
S

WSnameif GasTarget, a specified gas temperature in [℃]when you calculated this WS using SRIM-2013

srInfoIsGasWSSWSnamereturns 'TRUE' when the WS is for Gas target

S

srInfoTgCmAtmNm
WS
S WSnamei
I
Columb number (1..8)

Target Composition List: Atomic nameI

srInfoTgCmAtmNo
WS
S WSnamei
I
Columb number (1..8)

Target Composition List: Atomic numberD

srInfoTgCmAtmPct
WS
S WSnamei
I
Columb number (1..8)

Target Composition List: Atomic [%]D

srInfoTgCmMasPct
WS
S WSnamei
I
Columb number (1..8)

Target Composition List: Mass [%]S

srInfoWScorded
WS
S WSname

Corded information of this WS

2018/10/22 (v.3.01.03E)

SRIMfit Users Manual

7

Func.List(1)Category

Return type Func.nameparams.

type

Param. Description

Func. Description
Return value Error conditions

Comments

LET Unit Name#NUM!
Uid<0 | >8

Uid invalid

Unit conversion functions
V,S srLETUNmI

LET Unit ID (0..8, =0 defa)

WS
Uid

S
I

WS nameLET Unit ID (0..8, =0 defa)

srum2mg
WSum

S
D

WS nameTarget thickness [μm]srmg2um
WSmg

S
D

WS nameTarget thickness [mg/cm2]

Uid

V,D srLETCnvF

D

D

LET Unit Conversion Factor for [Uid=0 MeV/(mg/cm2)]#NUM!
Uid<0 | >8
Uid invalid● Target Thickness unit conversion [um] --> [mg/cm2]
using ｓｒInforTrgDens()● Target Thickness unit conversion [mg/cm2] --> [um]using ｓｒInforTrgDens()

Work Sheet Info (2) Table min/max
D
D
D
D
D
D
D
D

srMinE
WSS

WS namemin. of Beam E table [MeV/u]

srMaxE
WSS

WS namesrMinRng
WS

S

WS namesrMaxRng
WS

S

WS namesrMinStLng
WS
S

WS namesrMaxStLng
WS
S

WS namesrMinStLtr
WS

S

WS namesrMaxStLtr
WS
S

WS namemax. of Beam E table [MeV/u]min. of Range table [μm]max. of Range table [μm]min. of Straggling Longitudinal table [μm]max. of Straggling Longitudinal table [μm]min. of Straggling Lateral table [μm]2018/10/22 (v.3.01.03E)

max. of Straggling Lateral table [μm]SRIMfit Users Manual8

Func.List(1)Category

Return type Func.nameparams.

type

Func. Description
Return value Error conditions

Param. Description

Comments

Work Sheet Look up (1) E <-> LETe,n,t
V,D srE2LETe
WS
E

S
D

Uid

I

WS nameBeam E [MeV/u] as look-up key
LET Unit ID (0..8) for the returnvalue

V,D srE2LETn
WS
E

S
D

Uid

I

WS nameBeam E [MeV/u] as look-up key
LET Unit ID (0..8) for the return
value

Look up E -> LETe [in Uid unit] ; Electric Stopping Power#NUM!
Uid<0 | >8
Uid invalid#N/A
E is out of range in the WS

Look up E -> LETn [in Uid unit] ; Nuclear Stopping Power#NUM!
Uid<0 | >8
Uid invalid#N/A
E is out of range in the WS● Look up E -> LETt [in Uid unit] ;Total= Nuclear+Electric Stopping PowerV,D srE2LETt
WS
E

S
D

Uid

I

WS nameBeam E [MeV/u] as look-up key
LET Unit ID (0..8) for the return
value

#NUM!
#N/A

Uid<0 | >8

Uid invalid
E is out of range in the WS

LET subscription { e | n | t } indicates{ electronic | nuclear | total = electric + nuclear } Stopping PowerV,D srLETe2E
WS
Lt

S
D

Uid

I

Ehl

I

WS name
LETe [Uid] as look-up key
LET Unit ID (0..8) for the look-up
key={+1|-1} = E-search from
{Ehigh|Elow} side

V,D srLETn2E
WS
Lt

S
D

Uid

I

Ehl

I

V,D srLETt2E
WS
Lt

S
D

Uid

I

Ehl

I

2018/10/22 (v.3.01.03E)

WS name
LETn [Uid] as look-up key
LET Unit ID (0..8) for the look-up
key={+1|-1} = E-search from
{Ehigh|Elow} side

Look up LETe -> E [MeV/u]#NUM!
Uid<0 | >8
#N/A

Uid invalid
LETe is out of range in the WS

Look up LETn -> E [MeV/u]#NUM!
Uid<0 | >8
#N/A

Uid invalid
LETn is out of range in the WS● Look up LETt -> E [MeV/u]
WS name
LETt [Uid] as look-up key
LET Unit ID (0..8) for the look-up
key={+1|-1} = E-search from
{Ehigh|Elow} side

#NUM!
#N/A

Uid<0 | >8

SRIMfit Users Manual

Uid invalid
LETt is out of range in the WS

9

Func.List(1)Category

Return type Func.nameparams.

type

Param. Description

Func. Description
Return value Error conditions

Comments

max. of LETe [Uid] table#NUM!
Uid<0 | >8

Uid invalid

max. of LETn [Uid] table#NUM!
Uid<0 | >8

Uid invalid

Work Sheet Look up (1) E <-> LETe,n,t
V,D srMaxLETe
WS

S

Uid

I

WS nameLET Unit ID (0..8) for the returnvalue

V,D srMaxLETn
WS

S

Uid

I

WS nameLET Unit ID (0..8) for the returnvalue

V,D srMaxLETt

D
D
D

WS

S

Uid

I

● max. of LETt [Uid] table

WS nameLET Unit ID (0..8) for the returnvalue

srMaxLETe2E
WS
S

WS namesrMaxLETn2E
WSS

WS namesrMaxLETt2E
WS
S

WS name#NUM!

Uid<0 | >8

Uid invalid

E [MeV/u] at max LETeE [MeV/u] at max LETn

● E [MeV/u] at max LETt

Work Sheet Look up (2) E <-> Range
V,D srE2Rng
WS
E

S
D

● Look up E -> Range [μm]WS nameBeam E [MeV/u] as look-up key

E<0

E is out of range ( >Emax)
E=0● Look up Range -> E [MeV/u]

V,D srRng2E
WS
Rng

#NUM!
#N/A
=0

S
D

WS nameRange [μm] as look-up key

#NUM!
#N/A
=0

Rng<0
Rng is out of range (>Rmax)
Rng=0

These two functions are important functions and are often usedin the following combination functions.

2018/10/22 (v.3.01.03E)

SRIMfit Users Manual

10Func.List(1)Category

Return type Func.nameparams.

type

Func. Description
Return value Error conditions

Param. Description

Comments

Work Sheet Look up (3) E <-> Straggling
V,D srE2StLng
S
D

WS nameBeam E [MeV/u] as look-up key

Look up E -> Straggling Longitudinal [μm]
#NUM!
E<0
#N/A
E is out of range ( >Emax)
=0
E=0

S
D

WS nameBeam E [MeV/u] as look-up key

Look up E -> Straggling Lateral [μm]
#NUM!
E<0
#N/A
E is out of range ( >Emax)
=0
E=0

WS

S

WS name

Strg

D

WS
E

V,D srE2StLtr
WS
E

V,D srStLng2E

Look up Straggling Longitudinal -> E [MeV/u]#NUM!
Strg<0Strg is out of range
Strag. Long. [μm] as look-up key#N/A(>StLngmax)=0
Strg=0V,D srStLtr2E
WS

S

WS nameStrg

D

Strag. Later. [μm] as look-up key

Look up Straggling Lateral -> E [MeV/u]#NUM!
Strg<0Strg is out of range#N/A(>StLtrmax)=0
Strg=0Gas Target : "Standard" Pressure & Temperature"Standard"is at P=srInfoTrgPtbl() and at T=srInfoTrgTtbl() where the WS is calculated by SRIM-2013
Conversion coeff. for the standard P & T
V,D srThkStd●
WS
S WS name for Gas Target#NUM!
WS<>GasWS is not for Gas TargetPa

D

Gas Pressure [Pa]dgC

DGas Temperature [℃]

Pa<0 Pa | dgC<0
K= (Pa/P0)*(273.15+T0)/(273.15+dgC) <-- This is the coeff.
#NUM!

Concerning Gas-Target work sheet
Gas functions calculate a range thickness in the gas as following formula ;Thick [μm] @(P, T) = srE2Rng( WS, E ) / srThkStd( WS, P, T )2018/10/22 (v.3.01.03E)

SRIMfit Users Manual11

Func.List(1)Category

Return type Func.nameparams.

type

Func. Description
Return value Error conditions

Param. Description

Comments

for Debugging public functions
S
S
V

V

V

srIxEmin
WSS

WS nameget IxEmin

srIxEmax
WSS

WS namesrE2IxWSEi

S
D

WS nameE [MeV/u]srVal2Ix
WS
Vc

S
D

Clm

I

WS nameValue
Clm# = 1..7 ; E, SPe, SPn, SPt, Rng,
StLng, StLtr

srIx2Val
WS
ixE

S
I

Clm

I

get IxEmax

WS nameixEClm# = 1..7 ; E, SPe, SPn, SPt, Rng,
StLng, StLtr

V,D() srIx2ValAry
WS
ixE

S
I

2018/10/22 (v.3.01.03E)

E -> ixE search using sr_E2Ix()#N/A
ts_errE

WS nameixEVal -> ixE search using sr_Val2Ix()#N/A
ts_errV(ixE, Clm#) -> Value#N/A

ixE | Cim invalidixE -> Value(Clm=1..7) Double Array#N/AixE invalid

SRIMfit Users Manual

12SRIMfit Function List (2a) Combination functions< Notation for Parameters >WS1,WS2 S WSname
Eu D Beam Energy [MeV/u]
Et D Beam Energy [MeV]
dEu D Beam Energy Loss [MeV/u]
dEt D Beam Energy Loss [MeV]
Tum,Tmm D Thickness [μm] | [mm]
Pa D Gas Pressure [Pa]dgC D Gas Temperature [degC]

Func.List(2a)< reason why _eq_() function returns '#N/A' error >case-1)
Eu10 > Emax
out of E table in WS1
case-2)
Eu11 < 0
Eu20, Th2 becomes indefinite
case-3)
Et11 > Et20
case-5)dEt1 > Et20
case-8)out of Rng( E ) table in WS1
case-9)out of Rng( E ) table in WS2
case-11)dE peak search error
case-12)dEu2max < dEu1
case-14)dE2 ixE search error

Category

Return type Func.nameparams.

type

Func. Description
Return value Error conditions

Param. Description

Comments

Combination Func. (2a) equivalent E <-> Rng
V,D srEnew
WS
Eu10
Th1

As function

parameter
returnbeforeBeam E [MeV/u] AFTER passing through Th[μm] of the target#NUM! Eu10<=0#N/A-Th >Rmax=0
Eu10=0 | Th1>=Rng(Eu10)=Eu10 Th1=0=srEold(Eu11,Th1) Th1<0
same as srEold()

●

S
D
D

WSname for Eu10 & Th1
E [MeV/u] before passing Th1
Target Thickness [μm]As calculation
assumption
look-up key
through( Equivalent Equations )srEnew(WS,Eu10,Th1) {R10= srE2Rng(WS,Eu10)
if((R11= R10 - Th1)<=0) return( 0 )E11u= srRng2E(WS,R11)
return( E11u )
}

after

Eold Thick Enew
MeV/u μm MeV/u
WS1 Eu10
Th1
Eu11
prm. prm.
prm.
ret.

V,D srEold
WS
Eu11
Th1

beforeS
D
D

through

WSname for Eu11 & Th1
E [MeV/u] after passing Th1
Target Thickness [μm]after

Eold Thick Enew
MeV/u μm MeV/u
WS1 Eu10
Th1
Eu11
prm. ret.
prm.
prm.

2018/10/22 (v.3.01.03E)●

Beam E [MeV/u] BEFORE passing through Th[μm] of the target#NUM! Eu11<=0 | Th1<0#N/A
E1>=Emax=Eu11 Th1=0=srRng2E(Th1) Th1=0 & E11=0

srEold(WS,Eu11,Th1) {R11= srE2Rng(WS,Eu11)
R10= R11 + Th1
Eu10= srRng2E(WS,R10)
return( Eu10 )}SRIMfit Users Manual13

As function

As calculation
assumption
look-up key

parameter
returnFunc.List(2a)Category

Return type Func.nameparams.

type●

V,D srRng_eq_Eold
WS1
S
WS2
S
Eu10
D
beforeFunc. Description
Return value Error conditions

Param. Description

WSname for Eu10
WSname for return Eold
E [MeV/u] before passing throughRange equivalent Eold [MeV/u]#NUM! Eu10<=0#N/A
case-1), -9)

gives

srRng_eq_Eold(WS1,WS2,Eu10) {R10= srE2Rng(WS1,Eu10)
R20=R10
Eu20= srRng2E(WS2,R20)
return( Eu20 )}Eold Range
MeV/u μm
WS1 Eu10 Rng1
prm. prm.
WS2 Eu20 Rng2
prm. ret. =Rng1

V,D srEnew_eq_Th
WS1
S
WS2
S
Eu10
D
Th1
D
beforeComments

through

WSname for Eu10 & Th1
WSname for return Thick
E [MeV/u] before passing Th1
Target Thickness [μm]afterE totalEold Thick Enew Enewt
MeV/u μm MeV/u MeV
WS1 Eu10
Th1
Eu11 Et11
prm. prm.
prm.
WS2 Eu20
Th2
Eu21 Et21
prm. =Eu10 ret. =Eu11

V,D srEnewt_eq_Th
WS1
S
WS2
S
Eu10
D
Th1
D

WSname for Eu10 & Th1
WSname for return Thick
E [MeV/u] before passing Th1
Target Thickness [μm]

beforethroughafter

E totalWS1 Eu10
prm. prm.
WS2 Eu20
prm. =Eu10

Th1
prm.
Th2
ret.

Eu11

Et11

Eu21

Et21
=Et11

2018/10/22 (v.3.01.03E)

Enew [MeV/u] equivalent thickness [μm]
#NUM! Eu10<=0 | Th1<0#N/A
Th1>=Rng(Eu10) case-2) Eu20 becomes indefinite#N/A
case-1), -3), -8), -9)=0Th1=0
as Eu20=Eu10

srEnew_eq_Th(WS1,WS2,Eu10,Th1) {Eu11= srEnew(WS1,Eu10,Th1)
if(Eu11 <= 0) return( #N/A )Eu20= Eu10
R20= srE2Rng(WS2,Eu20)
Eu21= Eu11
R21= srE2Rng(WS2,Eu21)
Th2= R20 - R21
return( Th2 )}Enewt [MeV] equivalent thickness [μm]
#NUM! Eu10<=0 | Th1<0#N/A
Th1>=Rng(Eu10) case-2) Eu20 becomes indefinite#N/A
case-1), -3), -8), -9)=0Th1=0
as Eu20=Eu10

srEnewt_eq_Th(WS1,WS2,Eu10,Th1) {A1= srInfoIonA(WS1)A2= srInfoIonA(WS2)
Eu11= srEnew(WS1,Eu10,Th1)
Et11= Eu11*A1
Eu20= Eu10
if(Et11 > Eu20*A2) return( #N/A )R20= srE2Rng(WS2,Eu20)
Et21= Et11
Eu21= Et21/A2
R21= srE2Rng(WS2,Eu21)
Th2= R20 - R21
return( Th2 )}SRIMfit Users Manual14

As function

As calculation
assumption
look-up key

parameter
returnFunc.List(2a)Category

Return type Func.nameparams.

type

V,D srEnew_eq_Eold
WS1
S
WS2
S
Eu10
D
Th1
D
beforethroughFunc. Description
Return value Error conditions

Param. Description●

WSname for Eu10 & Th1
WSname for return Eold
E [MeV/u] before passing Th1
Target Thickness [μm]afterE totalEold Thick Enew Enewt
MeV/u μm MeV/u MeV
WS1 Eu10
Th1
Eu11 Et11
prm. prm.
prm.
WS2 Eu20
Th2
Eu21 Et21
prm. ret.
=Th1 =Eu11

V,D srEnewt_eq_Eold●
WS1
S WSname for Eu10 & Th1
WS2
S WSname for return EoldEu10
D E [MeV/u] before passing Th1
Th1
D Target Thickness [μm]
beforethroughafter

E totalWS1 Eu10
prm. prm.
WS2 Eu20
prm. ret.

Th1
prm.
Th2
=Th1

Eu11

Et11

Eu21

Et21
=Et11

2018/10/22 (v.3.01.03E)

Comments

Enew [MeV/u] equivalent Eold [MeV/u]#NUM! Eu10<=0 | Th1<0#N/A
Th1>=Rng(Eu10) case-2) Eu20 becomes indefinite#N/A
case-1), -8), -9)=Eu11 Th1=0
as Eu20=Eu21=Eu11=Eu10

srEnew_eq_Eold(WS1,WS2,Eu10,Th1) {Eu11= srEnew(WS1,Eu10,Th1)
if(Eu11 <= 0) return( #N/A )Th2= Th1
Eu21= Eu11
if(Eu21==0) Eu20= srRng2E(WS2,Th2)
else
Eu20= srEold(WS2,Eu21,Th2)
return( Eu20 )}Enewt [MeV/u] equivalent Eold [MeV/u]#NUM! Eu10<=0 | Th1<0#N/A
Th1>=Rng(Eu10) case-2) Eu20 becomes indefinite#N/A
case-1), -8), -9)=Eu11 Th1=0
as Eu20=Eu21=Eu11=Eu10

srEnewt_eq_Eold(WS1,WS2,Eu10,Th1) {A1= srInfoIonA(WS1)A2= srInfoIonA(WS2)
Eu11= srEnew(WS1,Eu10,Th1)
Et11= Eu11*A1
Th2= Th1
Et21= Et11
if(Et21==0) Eu20= srRng2E(WS2,Th2)
else
Eu20= srEold(WS2,Eu21,Th2)
return( Eu20 )}SRIMfit Users Manual15

As function

As calculation
assumption
look-up key

parameter
returnFunc.List(2a)Category

Return type Func.nameparams.

type

V,D srDEu_eq_Th

beforeis equivalent to srEnew_eq_Th()
WSname for Eu10 & Th1
WSname for return Thick
E [MeV/u] before passing Th1
Target Thickness [μm]

S
S
D
D

WS1
WS2
Eu10
Th1

throughFunc. Description
Return value Error conditions

Param. Description

after

E total E loss

WS1
WS2
Eu10
Th1

●
S
S
D
D

WSname for Eu10 & Th1
WSname for return Thick
E [MeV/u] before passing Th1
Target Thickness [μm]

beforethroughafter

E total E loss

E lossWS1 Eu10
prm. prm.
WS2 Eu20
prm. =Eu10

Th1
prm.
Th2
ret.

Eu11

Et11 dEu1

dEt1

Eu21

Et21 dEu2

dEt2
=dEt1

2018/10/22 (v.3.01.03E)

dEu [MeV/u] equivalent Thickness [μm]
#NUM! Eu10<=0 | Th1<0#N/A
Th1>=Rng(Eu10) case-2) Eu20 becomes indefinite#N/A
case-1), -3), -8), -9)=0Th1=0
as Eu20=Eu10

srDEu_eq_Th(WS1,WS2,Eu10,Th1) {Th2= srEnew_eq_Th(WS1,WS2,Eu10,Th1)
return( Th2 )}∵ Eu20=Eu10∴ dEu1=(Eu10-Eu11)=dEu2=(Eu10-Eu21)∴ Eu21=Eu11∴ equivalent to ｓｒEnew_eq_Th()

E lossEold Thick Enew Enewt dEu
dEt
MeV/u μm MeV/u MeV MeV/u MeV
WS1 Eu10
Th1
Eu11 Et11 dEu1 dEt1
prm. prm.
prm.
WS2 Eu20
Th2
Eu21 Et21 dEu2 dEt2
prm. =Eu10 ret. =Eu11=dEu1

V,D srDEt_eq_Th

Comments

dEt [MeV] equivalent Thickness [μm]
#NUM! Eu10<=0 | Th1<0#N/A
Th1>=Rng(Eu10) case-2) Eu20 becomes indefinite#N/A
case-1), -5), -8), -9)=Eu11 Th1=0
as Eu20=Eu10

srDEt_eq_Th(WS1,WS2,Eu10,Th1) {A1= srInfoIonA(WS1)A2= srInfoIonA(WS2)
Eu11= srEnew(WS1,Eu10,Th1)
dEt1= (Eu10-Eu11)*A1
Eu20= Eu10
R20= srE2Rng(WS2,Eu20)
dEt2= dEt1
dEu2= dEt2/A2
Eu21= Eu20 - dEu2
R21= srE2Rng(WS2,Eu21)
Th2= R20 - R21
return( Th2 )}SRIMfit Users Manual16

As function

parameter
returnAs calculation
assumption
look-up key

Func.List(2a)Category

Return type Func.nameparams.

type

Param. Description

V,D srDEu_eq_Eold
WS1
S
WS2
S
Eu10
D
Th1
D
Ehl

I

beforethroughFunc. Description
Return value Error conditions

dEu [MeV/u] equivalent Eold [MeV/u]#NUM! Eu10<=0 | Th1<0
Th1>=Rng(Eu10) is acceptable#N/A
case-1), -8), -11), -12), -14)note）return value(Eu20) has error of a few [%]because this is a linear interpolation between E vs. dE
not between E vs. Range

WSname for Eu10 & Th1
WSname for return Eold
E [MeV/u] before passing Th1
Target Thickness [μm]={+1|-1} = E-search from
{Ehigh|Elow} sideafter

E total E loss

Comments

E lossEold Thick Enew Enewt dEu
dEt
MeV/u μm MeV/u MeV MeV/u MeV
WS1 Eu10
Th1
Eu11 Et11 dEu1 dEt1
prm. prm.
prm.
WS2 Eu20
Th2
Eu21 Et21 dEu2 dEt2
prm. ret.
=Th1
=dEu1

V,D srDEt_eq_Eold
WS1
S
WS2
S
Eu10
D
Th1
D
Ehl

I

beforethroughdEt [MeV/u] equivalent Eold [MeV/u]#NUM! Eu10<=0 | Th1<0
Th1>=Rng(Eu10) is acceptable#N/A
case-1), -8), -11), -12), -14)note）return value(Eu20) has error of a few [%]because this is a linear interpolation between E vs. dE
not between E vs. Range

WSname for Eu10 & Th1
WSname for return Eold
E [MeV/u] before passing Th1
Target Thickness [μm]={+1|-1} = E-search from
{Ehigh|Elow} sideafter

E total E loss

E lossEold Thick Enew Enewt dEu
dEt
MeV/u μm MeV/u MeV MeV/u MeV
WS1 Eu10
Th1
Eu11 Et11 dEu1 dEt1
prm. prm.
prm.
WS2 Eu20
Th2
Eu21 Et21 dEu2 dEt2
prm. ret.
=Th1
=dEt1
srDEu_eq_Eold(WS1,WS2,Eu10,Th1) {Eu11= srEnew(WS1,Eu10,Th1)
dEu1= Eu10-Eu11
Th2= Th1
Eu20stop= srRng2E(WS2,Th2)

srDEt_eq_Eold(WS1,WS2,Eu10,Th1) {A1= srInfoIonA(WS1)A2= srInfoIonA(WS2)
Eu11= srEnew(WS1,Eu10,Th1)
dEt1= (Eu10-Eu11)*A1
Th2= Th1
Eu20stop= srRng2E(WS2,Th2)~ sr_dEfpk(-1) : find dEu2 peak from Emax side ~~ -> then get dEu2pk & EdEu2pk ~if( dEu2pk > Eu20stop) {dEu2max= dEu2pk; EdEu2max= EdEu2pk}else{ dEu2max= EdEu2max= Eu20stop }dEt2max= dEu2max*A2
if(dEt2max < dEt1) return( N/A ) : No Answer~ sr_dEfpk(-1) : find dEu2 peak from Emax side ~~ -> then get dEu2pk & EdEu2pk ~if( dEu2pk > Eu20stop) {dEu2max= dEu2pk; EdEu2max= EdEu2pk}else{ dEu2max= EdEu2max= Eu20stop }if(dEu2max < dEu1) return( N/A ) : No Answer
if(dEu2max = dEu1) : Only One Answer
return( Eu20= EdEu2max )dEu2= dEu1

if(dEt2max = dEt1) : Only One Answer
return( Eu20= EdEu2max )dEt2= dEt1
dEu2= dEt2 / A2
~ sr_dE2ixE() : find dEu2 for all Eu20 ~~ calculating Eu20 -> dEu2= Eu20 - Enew(Eu20,Th2) ~~ sr_dE2ip() : interpolation at found dEu2 ~~ using the calculated E vs dE=E-Enew() table ~Eu20 = interpolated value at found dEu2
return( Et20 = Eu20*A2 )~ sr_dE2ixE() : find dEu2 for all Eu20 ~~ calculating Eu20 -> dEu2= Eu20 - Enew(Eu20,Th2) ~~ sr_dE2ip() : interpolation at found dEu2 ~~ using the calculated E vs dE=E-Enew() table ~Eu20 = interpolated value at found dEu2
return( Eu20 )}}2018/10/22 (v.3.01.03E)

SRIMfit Users Manual

17

Func.List(2b)SRIMfit Function List (2b) Combination functions for Gas Target< Notation for Parameters >Tmm D Thickness in [mm] unit
Pa D Gas Pressure [Pa]dgC D Gas Temperature [℃ degC]
other param.s are same as _eq_() func.
As function

parameter
returnAs calculation
assumption
look-up key< reason why _eq_Gas() function returns '#N/A' error >#NUM!
WS<>GasWS is not for Gas Target
other reasons are same as _eq_() func.

Concerning Gas-Target combination functions
・ Gas thickness is in the unit of [ mm ]・ Gas pressure [Pa] and temperature [℃] need to specified.
Others are same as solid-target functions.

Category

Return type Func.nameparams.

type

Func. Description
Return value Error conditions

Param. Description

Comments

Combination Func. (2b) equivalent E <-> Rng●

V,D srEnewGas
WS
Eu10
Tmm1
Pa1
dgC1
beforeS
D
D
D
D

WSnameGas for Eu10～dgC1
E [MeV/u] before passing Th1
Gas Target Thickness [mm]Gas Trg Pressure [Pa]Gas Trg Temperature [℃]through

Eold Thick
MeV/u mm
WS1 Eu10 Tmm1
prm. prm.
prm.

before

S
D
D
D
D

after

Pa
Pa1
prm.

℃
dgC1
prm.

2018/10/22 (v.3.01.03E)

srEnewGas(WS,Eu10,Tmm1,Pa1,dgC1) {Th1= Tmm1 * 1000 * srThkStd(WS,Pa,dgC)
R10= srE2Rng(WS,Eu10)
if((R11= R10 - Th1)<=0) return( 0 )E11u= srRng2E(WS,R11)
return( E11u )}●Beam E [MeV/u] BEFORE passing through Th[mm] of the Gas target

WSnameGas for Eu10～dgC1#NUM!
WS<>GasWS is not for Gas Target
E [MeV/u] after passing Th1#NUM! Eu11<=0 | Th1<0
Gas Target Thickness [mm]#N/A
E1>=Emax
Gas Trg Pressure [Pa]
=Eu11
Th1=0
Gas Trg Temperature [℃]=srRng2E(Th1*srThkStd(Pa1,dgC1)) Th1=0 & E11=0

through

Eold Thick
MeV/u mm
WS1 Eu10
Th1
prm. ret.
prm.

#NUM!
WS<>GasWS is not for Gas Target#NUM! Eu10<=0#N/A-Th >Rmax=0
Eu10=0 | Th1>=Rng(Eu10)
=Eu10
Th1=0
=srEold(Eu11,Th1) Th1<0
same as srEold()

Enew
MeV/u
Eu11
ret.

V,D srEoldGas
WS
Eu11
Tmm1
Pa1
dgC1

Beam E [MeV/u] AFTER passing through Th[mm] of the Gas target

after

Pa
Pa1
prm.

℃
dgC1
prm.

Enew
MeV/u
Eu11
prm.

srEoldGas(WS,Eu10,Tmm1,Pa1,dgC1) {Th1= Tmm1 * 1000 * srThkStd(WS,Pa,dgC)
R11= srE2Rng(WS,Eu11)
R10= R11 + Th1
Eu10= srRng2E(WS,R10)
return( Eu10 )}SRIMfit Users Manual18

As function

parameter
returnAs calculation
assumption
look-up key

Func.List(2b)Category

Return type Func.nameparams.

type

Param. Description

Func. Description
Return value Error conditions

Comments

V,D srRng_eq_EoldGas() is not implemented. Please use srRng_eq_Eold().
V,D srEnew_eq_ThGasWS1
S WSnameGas for Eu10～dgC1
WS2
S WSnameGas for Pa2～dgC2
Eu10
D E [MeV/u] after passing Th1
Tmm1
D Gas Trg1 Thickness [mm]Pa1
D Gas Trg1 Pressure [Pa]dgC1
D Gas Trg1 Temperature [℃]Pa2
D Gas Trg2 Pressure [Pa]dgC2
D Gas Trg2 Temperature [℃]V,D srEnewt_eq_ThGasWS1
S WSnameGas for Eu10～dgC1
WS2
S WSnameGas for Pa2～dgC2
Eu10
D E [MeV/u] after passing Th1
Tmm1
D Gas Trg1 Thickness [mm]Pa1
D Gas Trg1 Pressure [Pa]dgC1
D Gas Trg1 Temperature [℃]Pa2
D Gas Trg2 Pressure [Pa]dgC2
D Gas Trg2 Temperature [℃]srEnew_eq_ThGas(WS1,WS2,Eu10,Tmm1,
Pa1,dgC1,Pa2,dgC2) {Th1= Tmm1 * 1000 * srThkStd(WS1,Pa1,dgC1)
Eu11= srEnew(WS1,Eu10,Th1)
if(Eu11 <= 0) return( #N/A )Eu20= Eu10
R20= srE2Rng(WS2,Eu20)
Eu21= Eu11
R21= srE2Rng(WS2,Eu21)
Th2= R20 - R21
Tmm2= Th2 / (1000 * srThkStd(WS2,Pa2,dgC2)）
return( Tmm2 )}2018/10/22 (v.3.01.03E)

Enew [MeV/u] equivalent thickness [mm]#NUM!
WS1,WS2<>Gas WS1,2 are not for Gas Target#NUM! Eu10<=0 | Th1<0#N/A
Th1>=Rng(Eu10) case-2) Eu20 becomes indefinite#N/A
case-1), -3), -8), -9)=0Th1=0
as Eu20=Eu10
beforethrough

Eold Thick
MeV/u mm
WS1 Eu10
Th1
prm. prm.
prm.
WS2 Eu20
Th2
prm. =Eu10
ret.

after

Pa
Pa1
prm.
Pa2
prm.

℃
dgC1
prm.
dgC2
prm.

E totalEnew Enewt
MeV/u MeV
Eu11
Et11
Eu21
=Eu11

Et21

Enewt [MeV] equivalent thickness [mm]#NUM!
WS1,WS2<>Gas WS1,2 are not for Gas Target#NUM! Eu10<=0 | Th1<0#N/A
Th1>=Rng(Eu10) case-2) Eu20 becomes indefinite#N/A
case-1), -3), -8), -9)=0Th1=0
as Eu20=Eu10
beforethrough

WS1 Eu10
prm. prm.
WS2 Eu20
prm. =Eu10

Th1
prm.
Th2
ret.

Pa1
prm.
Pa2
prm.

dgC1
prm.
dgC2
prm.

after

E total

Eu11

Et11

Eu21

Et21
=Et11

srEnewt_eq_ThGas(WS1,WS2,Eu10,Tmm1,
Pa1,dgC1,Pa2,dgC2) {A1= srInfoIonA(WS1)A2= srInfoIonA(WS2)
Th1= Tmm1 * 1000 * srThkStd(WS1,Pa1,dgC1)
Eu11= srEnew(WS1,Eu10,Th1)
Et11= Eu11*A1
Eu20= Eu10
if(Et11 > Eu20*A2) return( #N/A )R20= srE2Rng(WS2,Eu20)
Et21= Et11
Eu21= Et21/A2
R21= srE2Rng(WS2,Eu21)
Th2= R20 - R21
Tmm2= Th2 / (1000 * srThkStd(WS2,Pa2,dgC2)）
return( Tmm2 )}SRIMfit Users Manual19

As function

parameter
returnAs calculation
assumption
look-up key

Func.List(2b)Category

Return type Func.nameparams.

type

Param. Description

V,D srEnew_eq_EoldGas
WS1
S WSnameGas for Eu10～dgC1
WS2
S WSnameGas for Pa2～dgC2
Eu10
D E [MeV/u] after passing Th1
Tmm1
D Gas Trg1 Thickness [mm]Pa1
D Gas Trg1 Pressure [Pa]dgC1
D Gas Trg1 Temperature [℃]Pa2
D Gas Trg2 Pressure [Pa]dgC2
D Gas Trg2 Temperature [℃]V,D srEnewt_eq_EoldGas
WS1
S WSnameGas for Eu10～dgC1
WS2
S WSnameGas for Pa2～dgC2
Eu10
D E [MeV/u] after passing Th1
Tmm1
D Gas Trg1 Thickness [mm]Pa1
D Gas Trg1 Pressure [Pa]dgC1
D Gas Trg1 Temperature [℃]Pa2
D Gas Trg2 Pressure [Pa]dgC2
D Gas Trg2 Temperature [℃]srEnew_eq_EoldGas(WS1,WS2,Eu10,Tmm1,
Pa1,dgC1,Pa2,dgC2) {Th1= Tmm1 * 1000 * srThkStd(WS1,Pa1,dgC1)
Eu11= srEnew(WS1,Eu10,Th1)
if(Eu11 <= 0) return( #N/A )Th2= Tmm1* 1000 * srThkStd(WS2,Pa2,dgC2)
Eu21= Eu11
if(Eu21==0) Eu20= srRng2E(WS2,Th2)
else
Eu20= srEold(WS2,Eu21,Th2)
return( Eu20 )}2018/10/22 (v.3.01.03E)

Func. Description
Return value Error conditions

Comments

Enew [MeV/u] equivalent Eold [MeV/u]#NUM!
WS1,WS2<>Gas WS1,2 are not for Gas Target#NUM! Eu10<=0 | Th1<0#N/A
Th1>=Rng(Eu10) case-2) Eu20 becomes indefinite#N/A
case-1), -8), -9)
=Eu11
Th1=0
as Eu20=Eu21=Eu11=Eu10
beforethrough

Eold Thick
MeV/u mm
WS1 Eu10
Th1
prm. prm.
prm.
WS2 Eu20
Th2
prm. ret.
=Th1

after

Pa
Pa1
prm.
Pa2
prm.

℃
dgC1
prm.
dgC2
prm.

E totalEnew Enewt
MeV/u MeV
Eu11
Et11
Eu21
=Eu11

Et21

Enewt [MeV/u] equivalent Eold [MeV/u]#NUM!
WS1,WS2<>Gas WS1,2 are not for Gas Target#NUM! Eu10<=0 | Th1<0#N/A
Th1>=Rng(Eu10) case-2) Eu20 becomes indefinite#N/A
case-1), -8), -9)
=Eu11
Th1=0
as Eu20=Eu21=Eu11=Eu10

WS1
prm.
WS2
prm.

beforethrough

Eu10
prm.
Eu20
ret.

Th1
prm.
Th2
=Th1

Pa1
prm.
Pa2
prm.

dgC1
prm.
dgC2
prm.

after

E total

Eu11

Et11

Eu21

Et21
=Et11

srEnewt_eq_EoldGas(WS1,WS2,Eu10,Tmm1,
Pa1,dgC1,Pa2,dgC2) {A1= srInfoIonA(WS1)A2= srInfoIonA(WS2)
Th1= Tmm1 * 1000 * srThkStd(WS1,Pa1,dgC1)
Eu11= srEnew(WS1,Eu10,Th1)
Et11= Eu11*A1
Th2= Tmm1* 1000 * srThkStd(WS2,Pa2,dgC2)
Et21= Et11
if(Et21==0) Eu20= srRng2E(WS2,Th2)
else
Eu20= srEold(WS2,Eu21,Th2)
return( Eu20 )}SRIMfit Users Manual20

As function

parameter
returnAs calculation
assumption
look-up key

Func.List(2b)Category

Return type Func.nameparams.

type

Param. Description

Func. Description
Return value Error conditions

Comments

V,D srDEu_eq_ThGas is equivalent to srEnew_eq_ThGas() dEu [MeV/u] equivalent Thickness [mm]WS1
S WSnameGas for Eu10～dgC1#NUM!
WS1,WS2<>Gas WS1,2 are not for Gas Target
WS2
S WSnameGas for Pa2～dgC2#NUM! Eu10<=0 | Th1<0
Eu10
D E [MeV/u] after passing Th1#N/A
Th1>=Rng(Eu10) case-2) Eu20 becomes indefinite
Tmm1
D Gas Trg1 Thickness [mm]#N/Acase-1), -3), -8), -9)
Pa1
D Gas Trg1 Pressure [Pa]=0
Th1=0
as Eu20=Eu10
dgC1
D Gas Trg1 Temperature [℃]before throughafter
E total E loss
E lossPa2
D Gas Trg2 Pressure [Pa]Eold Thick
Enew Enewt dEu
dEt
dgC2
D Gas Trg2 Temperature [℃]
MeV/u mmPa℃
MeV/u MeV MeV/u MeV
WS1 Eu10
Th1
Pa1
dgC1 Eu11
Et11
dEu1
dEt1
prm. prm.
prm.
prm.
prm.
WS2 Eu20
Th2
Pa2
dgC2 Eu21
Et21
dEu2
dEt2
prm. =Eu10
ret.
prm.
prm. =Eu11=dEu1
V,D srDEt_eq_ThGasdEt [MeV] equivalent Thickness [mm]WS1
S WSnameGas for Eu10～dgC1#NUM!
WS1,WS2<>Gas WS1,2 are not for Gas Target
WS2
S WSnameGas for Pa2～dgC2#NUM! Eu10<=0 | Th1<0
Eu10
D E [MeV/u] after passing Th1#N/A
Th1>=Rng(Eu10) case-2) Eu20 becomes indefinite
Tmm1
D Gas Trg1 Thickness [mm]#N/Acase-1), -5), -8), -9)
Pa1
D Gas Trg1 Pressure [Pa]
=Eu11
Th1=0
as Eu20=Eu10
dgC1
D Gas Trg1 Temperature [℃]before throughafter
E total E loss
E lossPa2
D Gas Trg2 Pressure [Pa]
WS1
Eu10
Th1
Pa1
dgC1
Eu11
Et11
dEu1
dEt1
dgC2
D Gas Trg2 Temperature [℃]prm. prm.
prm.
prm.
prm.
WS2 Eu20
Th2
Pa2
dgC2 Eu21
Et21
dEu2
dEt2
prm. =Eu10
ret.
prm.
prm.
=dEt1

srDEu_eq_ThGas(WS1,WS2,Eu10,Tmm1,
Pa1,dgC1,Pa2,dgC2) {Th2= srEnew_eq_ThGas(WS1,WS2,Eu10,Tmm1,
Pa1,dgC1,Pa2,dgC2) {return( Th2 )}∵ Eu20=Eu10∴ dEu1=(Eu10-Eu11)=dEu2=(Eu10-Eu21)∴ Eu21=Eu11∴ equivalent to ｓｒEnew_eq_Th()

2018/10/22 (v.3.01.03E)

srDEt_eq_ThGas(WS1,WS2,Eu10,Tmm1,
Pa1,dgC1,Pa2,dgC2) {A1= srInfoIonA(WS1)A2= srInfoIonA(WS2)
Th1= Tmm1 * 1000 * srThkStd(WS1,Pa1,dgC1)
Eu11= srEnew(WS1,Eu10,Th1)
dEt1= (Eu10-Eu11)*A1
Eu20= Eu10
R20= srE2Rng(WS2,Eu20)
dEt2= dEt1
dEu2= dEt2/A2
Eu21= Eu20 - dEu2
R21= srE2Rng(WS2,Eu21)
Th2= R20 - R21
Tmm2= Th2 / (1000 * srThkStd(WS2,Pa2,dgC2)）
return( Tmm2 )}SRIMfit Users Manual21

As function

parameter
returnAs calculation
assumption
look-up key

Func.List(2b)Category

Return type Func.nameparams.

type

Param. Description

V,D srDEu_eq_EoldGas
WS1
S WSnameGas for Eu10～dgC1
WS2
S WSnameGas for Pa2～dgC2
Eu10
D E [MeV/u] after passing Th1
Tmm1
D Gas Trg1 Thickness [mm]
Ehl

I

Pa1
dgC1
Pa2
dgC2

D
D
D
D

={+1|-1} = E-search from
{Ehigh|Elow} side
Gas Trg1 Pressure [Pa]Gas Trg1 Temperature [℃]
Gas Trg2 Pressure [Pa]Gas Trg2 Temperature [℃]V,D srDEt_eq_EoldGas
WS1
S WSnameGas for Eu10～dgC1
WS2
S WSnameGas for Pa2～dgC2
Eu10
D E [MeV/u] after passing Th1
Tmm1
D Gas Trg1 Thickness [mm]
Ehl

I

Pa1
dgC1
Pa2
dgC2

D
D
D
D

={+1|-1} = E-search from
{Ehigh|Elow} side
Gas Trg1 Pressure [Pa]Gas Trg1 Temperature [℃]
Gas Trg2 Pressure [Pa]Gas Trg2 Temperature [℃]

srDEu_eq_EoldGas(WS1,WS2,Eu10,Tmm1,
Pa1,dgC1,Pa2,dgC2) {Th1= Tmm1 * 1000 * srThkStd(WS1,Pa1,dgC1)
Eu11= srEnew(WS1,Eu10,Th1)
dEu1= Eu10-Eu11

Func. Description
Return value Error conditions

Comments

dEu [MeV/u] equivalent Eold [MeV/u]#NUM!
WS1,WS2<>Gas WS1,2 are not for Gas Target#NUM! Eu10<=0 | Th1<0
Th1>=Rng(Eu10) is acceptable#N/A
case-1), -8), -11), -12), -14)note）return value(Eu20) has error of a few [%]because this is a linear interpolation between E vs. dE
not between E vs. Range
beforethrough

Eold Thick
MeV/u mm
WS1 Eu10
Th1
prm. prm.
prm.
WS2 Eu20
Th2
prm. ret.
=Th1

after

Pa
Pa1
prm.
Pa2
prm.

℃
dgC1
prm.
dgC2
prm.

E totalE loss

dEt
MeV
dEt1

Eu21

dEt2

Et21

note）return value(Eu20) has error of a few [%]before throughE totalloss
E lossbecausethis is a linear interpolationafter
betweenE vs.EdE
Eold
Thick
Enew
Enewt
dEu
dEt
not between E vs. Range
MeV/u mmPa℃
MeV/u MeV MeV/u MeV
WS1 Eu10
Th1
Pa1
dgC1 Eu11
Et11
dEu1
dEt1
prm. prm.
prm.
prm.
prm.
WS2 Eu20
Th2
Pa2
dgC2 Eu21
Et21
dEu2
dEt2
prm. ret.
=Th1
prm.
prm.
=dEt1

srDEt_eq_EoldGas(WS1,WS2,Eu10,Tmm1,
Pa1,dgC1,Pa2,dgC2) {A1= srInfoIonA(WS1)A2= srInfoIonA(WS2)
Th1= Tmm1 * 1000 * srThkStd(WS1,Pa1,dgC1)
Eu11= srEnew(WS1,Eu10,Th1)

Eu20stop= srRng2E(WS2,Th2)~ sr_dEfpk(-1) : find dEu2 peak from Emax side ~~ -> then get dEu2pk & EdEu2pk ~if( dEu2pk > Eu20stop) {dEu2max= dEu2pk; EdEu2max= EdEu2pk}else{ dEu2max= EdEu2max= Eu20stop }if(dEu2max < dEu1) return( N/A ) : No Answer
if(dEu2max = dEu1) : Only One Answer
return( Eu20= EdEu2max )dEu2= dEu1

dEt1= (Eu10-Eu11)*A1
Th2= Tmm1* 1000 * srThkStd(WS2,Pa2,dgC2)
Eu20stop= srRng2E(WS2,Th2)~ sr_dEfpk(-1) : find dEu2 peak from Emax side ~~ -> then get dEu2pk & EdEu2pk ~if( dEu2pk > Eu20stop) {dEu2max= dEu2pk; EdEu2max= EdEu2pk}else{ dEu2max= EdEu2max= Eu20stop }dEt2max= dEu2max*A2
if(dEt2max < dEt1) return( N/A ) : No Answer~ sr_dE2ixE() : find dEu2 for all Eu20 ~if(dEt2max = dEt1) : Only One Answer~ calculating Eu20 -> dEu2= Eu20 - Enew(Eu20,Th2) ~~ sr_dE2ip() : interpolation at found dEu2 ~~ using the calculated E vs dE=E-Enew() table ~Eu20 = interpolated value at found dEu2
return( Eu20 )return( Eu20= EdEu2max )dEt2= dEt1
dEu2= dEt2 / A2
~ sr_dE2ixE() : find dEu2 for all Eu20 ~~ calculating Eu20 -> dEu2= Eu20 - Enew(Eu20,Th2) ~~ sr_dE2ip() : interpolation at found dEu2 ~~ using the calculated E vs dE=E-Enew() table ~Eu20 = interpolated value at found dEu2
return( Et20 = Eu20*A2 )2018/10/22 (v.3.01.03E)

dEu2
=dEu1

dEt [MeV/u] equivalent Eold [MeV/u]#NUM!
WS1,WS2<>Gas WS1,2 are not for Gas Target#NUM! Eu10<=0 | Th1<0
Th1>=Rng(Eu10) is acceptable#N/A
case-1), -8), -11), -12), -14)

Th2= Tmm1* 1000 * srThkStd(WS2,Pa2,dgC2)}

E lossEnew Enewt dEu
MeV/u MeV MeV/u
Eu11
Et11
dEu1

}
SRIMfitUsers Manual22Prepare MySRIMwb

How to prepare MySRIMwb➢ “MySRIMwb.xlsx” data-base file should be prepared manually as your own purpose.
• The installer includes a sample data-base file.
• Other samples are available in SRIMfit download page.
• Or you can make your own data-base file as following instruction.

➢ How to prepare your own MySRIMwb
Step1) Make a stopping/range table (say “SRIMoutput.txt”) using SRIM-2013 code.
Step2) Convert the table file to MySRIMwb formatted work sheet using “srOut2WsE.xlsm” utility.
Step3) Pick and choose from the work sheets and arrange your own MySRIMwb.

➢ Instructions for MySRIMwbe.g.) “SRIMws_040Ar.xlsx”

•
•
•
•

Please do NOT change the row & column number in a work sheet.
Yellow Cells : fill in values copied from SRIM-2013 output file.
Some of the Boxed Cells contains formula.
Other cells are available for writing any memo note.

• How many sheets are needed in the MySRIMwb.xlsx book file ?
(Number of WS needed) = (Num. of Beams) x (Num. of Target) for your purpose.
• Does the WSname has some restriction ?
No, but it is better to use the following notation so that it would be easy to understand.
e.g.) “srim40Ar_Kapton” = “srim” + “Beam” + “_” + “Target”• Each WSname should be identical in the book file.
There is no restriction for the number of sheet in the book. (See Excel system restriction)
Order of sheets is not important as the SRIMfit functions refer the sheet as WSname.

2018/10/22 (v.3.01.03E)

SRIMfit Users Manual23

Prepare MySRIMwb[ Step1 ] SRIM-2013 calculation

Run the SRIM-2013 code andclick “Stopping / Rage Tables”• Ion Mass “A [amu]” is better to use an “integer number” for the isotope.
• Ion Energy Range [keV] is recommended as ; eg.) A=84
Lowest : 10 eV/u * 84 = 0.84 keV , Highest : 1 GeV/u * 84 = 84,000,000 keV
Small Lowest value is important for a precise calculation near beam stopping.
Highest value should be enough larger than the Bragg Peak energy.
Energy steps are automatically determined by SRIM-2013 code.

• Target Description ; Compound target material is possible.
If the target is a Gas material,
check “Gas Tgt.” and specify an appropriate density
at a certain temperature and pressure.
• Stopping power unit MUST BE “MeV/(mg/cm2)”.
• Click “Calculate Table” then a text file named as“Target Description” box is created in the¥SRIM Outputs folder.

2018/10/22 (v.3.01.03E)

SRIMfit Users Manual24Prepare MySRIMwb[ Step2-a ] convert “SRIMoutput.txt” to SRIMwb format[1] Open “srOut2WsE.xlsm” and show “conv.Txt” sheet.
“srOut2WsE.xlsm”

Note) Please do not change the contents of “_wsForm_” sheet, because themacro refers it as a prototype format for the new WS.

[2] Push “Start Txt conversion” button and Select the previously made “SRIMoutput.txt” file.
Some sample files for the “SRIMoutput.txt”
are included in this folder.

[3] After the conversion finished, a new sheet will be appeared.
“srOut2WsE.xlsm”

2018/10/22 (v.3.01.03E)

SRIMfit Users Manual25

Prepare MySRIMwb[4] Edit the new sheet.
“srOut2WsE.xlsm”

④

③

⑤

②
④

②

①
① change the name of the work sheet.
② check the “row#” of Emin and Emax.
③ fill in the cells of Target name short- and long-name.
④ If it is Gas target, fill in appropriate values for Ptbl and Ttbl. They are the Pressure [Pa] andTemperature [℃], respectively, when you specified the Density of the Gas for SRIM-2013 calculation.
⑤ fill in corded information.

⑥⑦⑥、⑦ check the curves in two graphs are continuous.
If there are some bends, please check and compare the energy-dE/dX-range-straggling tablebetween this sheet and SRIMoutput.txt.

2018/10/22 (v.3.01.03E)

SRIMfit Users Manual26

Prepare MySRIMwb[ Step2 -b] convert “SRIMout.xlsx” (CSV file) to SRIMwb format
If you have an Excel book (like “SRIMout_*.xlsx” ) which contains
many “SRIMoutput.txt” files, the following utility is convenient.
“SRIMout_040Ar.xlsm”
Some sample files for the “SRIMout.xslx”
are included in this folder.

Other samples can be downloaded from
SRIMfit Home Page.
cf.) How to read a “SRIMoutput.txt” file
into “SRIMout_*.xslx” , use File menu and[Open: Text Import Wizard: Delimited : Space].

[1] Open “srOut2WsE.xlsm” and show “conv.Csv” sheet.
“srOut2WsE.xlsm”[2] Push “Start CSV conversion” button and Select the “SRIMout * .xlsx” file.
All sheets included in the “SRIMout *.xlsx” will be converted.
As it takes time, please wait for a while.

[3] After the conversion finished, new sheets will be appeared.
[4] Edit the new sheets.
This procedure is same as mentioned before.

2018/10/22 (v.3.01.03E)

SRIMfit Users Manual27

Prepare MySRIMwb[ Step3 ] arrange and check MySRIMwb.xlsxe.g.) SRIMwb_040Ar. xlsx
①a copy & rename①b download from HP

srOut2WsE. xlsm
New sheet

newSRIMwb. xlsx

MySRIMwb. xlsx
MS-Office
System AddIn
FolderNew sheet④ Renamemacro② Sheet copy

③ Arrange & check
contents⑤ File copy as
privileged user

3_Install_check. xlsm
macro_Install folder[1] Work flow for arranging MySRIMwb
First, prepare a temporary SRIMwb book named, for example, “newSRIMwb.xlsx”.
Here, a different file name from “MySRIMwb.xlsx” is needed as the Excel can not doubly open
files with same file name. You can make it by ①a coping “MySRIMwb.xlsx” from the system AddIn
folder, or by ①b downloading from SRIMfit Home Page.
② copy new sheet created in Step2) from “srOut2WsE.xlsm” to the temporary book.
Because a macro code included in the “srOut2WsE.xlsm” is not needed.
③ Check & arrange the content of the temporary book by using “3_Install_check.xlsm”.
④ Rename the temporary book as “MySRIMwb.xslx”⑤ and copy it into the system AddIn folder as a privileged user mode.

[2] Arrange and check the temporary book ③
You can arrange the temporary SRIMwb book named “newSRIMwb.xlsx”.
You can pick and choose needed sheets, and eliminate others.
A minimum number of sheets will speed up for starting Excel program.
In order to check the contents of the temporary book,a macro included book of “3_Install_check.xlsm” included in the “_Install folder” is available.

2018/10/22 (v.3.01.03E)

SRIMfit Users Manual28Prepare MySRIMwb[2] Arrange and check the temporary book ③ (cont.)“3_Install_check.xlsm”

(1)

(2)

Open a macro included book of “3_Install_check.xlsm” and show “eg11Macro Info” sheet.
push “change MySRIMwb” button (1) , and select new SRIMwb of “newSRIMwb.xlsx”.
Then the macro information listed in this sheet will change to the new one.
“3_Install_check.xlsm”(3)

In the next sheet of “eg12MySRIMwb check”,(3) change WSname cell then you can checkthe contents of each sheet.

You can change back to the default “MySRIMwb.xlsx” when you push (2) button.
or you restart Excel system.

2018/10/22 (v.3.01.03E)

SRIMfit Users Manual29Prepare MySRIMwb[3] Rename ④ and copy ⑤
newSRIMwb. xlsx

MySRIMwb. xlsx

New sheet④ Rename

MS-Office
System AddIn
Folder⑤ File copy as
privileged user

_Install folder④ Rename the temporary book of “newSRIMwb.xlsx” as “MySRIMwb.xslx”⑤ and copy it into the system AddIn folder as a privileged user mode.
For the detail, please see “Installation manual”

That’s it.
I would be grateful if this SRIMfit may help you.
Sincerely Yours,
Industrial Application Research Team,RIKEN Nishina Center for Accelerator-Based Science, Japan

2018/10/22 (v.3.01.03E)

SRIMfit Users Manual30