News:

:) You cannot see "members only" boards if you are not a member, so please join the forum!

Main Menu

Modelling beam convolution ?

Started by macosta, November 19, 2024, 06:13:15 PM

Previous topic - Next topic

macosta

Hi all,

I am interested in modelling beam convolution to illustrate that the electron beam cannot resolve nm-scale heterogeneities because they are smaller than the interaction volume - this seems like a "duh" thing to do, but I'd like to do it anyways.

John's suggestion is to model X-ray and BSE generation on a Penepma geometry that mimics the features of interest, so I'm going to give that a shot, but I thought that maybe someone has already done this? or maybe there's a different software that would be more suited?

Thanks in advance!
-Marisa
Marisa D. Acosta

Nicholas Ritchie

It would be a lot quicker / easier using the Monte Carlo in DTSA-II
"Do what you can, with what you have, where you are"
  - Teddy Roosevelt

macosta

Thank you for the suggestion, Nicholas!  Unfortunately, I find myself needing to create a geometry that isn't in the database already.  Any tips on how to create a geometry file from scratch? I am lost in the sauce of the Penepma .geo documentation at the moment...
Marisa D. Acosta

Probeman

Quote from: macosta on November 22, 2024, 04:48:31 PMThank you for the suggestion, Nicholas!  Unfortunately, I find myself needing to create a geometry that isn't in the database already.  Any tips on how to create a geometry file from scratch? I am lost in the sauce of the Penepma .geo documentation at the moment...

I think what Nicholas is suggesting is that you try DTSA2 for modeling your sub micron interaction volumes.  I think his software is easier for specifying Monte Carlo geometries.
The only stupid question is the one not asked!

macosta

#4
Hi John,

Thanks for the clarification!

But I guess the problem that I am having is that I want to model 3 slightly different material compositions in 5 domains, and I'm not sure how to do that via the user interfaces in either your software or DTSA2 - am I missing something in the manuals or on the forum?

I made a .geo file with the subzones I'm interested in (see screenshots, where I made the cylinder and zones fat enough to be easily rendered, they are actually 100 nm - 50 nm - 100 nm in the code below).  Now, in whatever software I use, I need to be able to assign each module (there are 5) a material (of which there are 3) and then do the MC simulations.  Any advice on the best way of going about that?  I guess it's the same thing as an interface model, but my interface is heterogeneous (alternatively, modelling many small closely-spaced interfaces) ...


You cannot view this attachment.You cannot view this attachment.

You cannot view this attachment.


XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  Cylindrical sample with 5 angled planar modules
0000000000000000000000000000000000000000000000000000000000000000000000
SURFACE (  1)  Cylinder
INDICES=( 1, 1, 0, 0,-1)
X-SCALE=( 6.000000000000000E+00,  0)
Y-SCALE=( 6.000000000000000E+00,  0)
0000000000000000000000000000000000000000000000000000000000000000
SURFACE (  2)  Plane Z=0
INDICES=( 0, 0, 0, 1, 0)
Z-SHIFT=( 1.000000000000000E-10,  0)
0000000000000000000000000000000000000000000000000000000000000000
SURFACE (  3)  Plane Z=10
INDICES=( 0, 0, 0, 1,-1)
Z-SHIFT=(-1.000000000000000E+01,  0)
0000000000000000000000000000000000000000000000000000000000000000
SURFACE (  4)  Angled plane 1
INDICES=( 0, 0, 0, 0, 0)
    AX=( 1.000000000000000E+00,  0)
    AY=( 0.000000000000000E+00,  0)
    AZ=( 1.000000000000000E+00,  0)
1111111111111111111111111111111111111111111111111111111111111111
X-SHIFT=( 1.000000000000000E-05,  0)
0000000000000000000000000000000000000000000000000000000000000000
SURFACE (  5)  Angled plane 2
INDICES=( 0, 0, 0, 0, 0)
    AX=( 1.000000000000000E+00,  0)
    AY=( 0.000000000000000E+00,  0)
    AZ=( 1.000000000000000E+00,  0)
1111111111111111111111111111111111111111111111111111111111111111
X-SHIFT=( 0.000000000000000E+00,  0)
0000000000000000000000000000000000000000000000000000000000000000
SURFACE (  6)  Angled plane 3
INDICES=( 0, 0, 0, 0, 0)
    AX=( 1.000000000000000E+00,  0)
    AY=( 0.000000000000000E+00,  0)
    AZ=( 1.000000000000000E+00,  0)
1111111111111111111111111111111111111111111111111111111111111111
X-SHIFT=(-5.000000000000000E-06,  0)
0000000000000000000000000000000000000000000000000000000000000000
SURFACE (  7)  Angled plane 4
INDICES=( 0, 0, 0, 0, 0)
    AX=( 1.000000000000000E+00,  0)
    AY=( 0.000000000000000E+00,  0)
    AZ=( 1.000000000000000E+00,  0)
1111111111111111111111111111111111111111111111111111111111111111
X-SHIFT=(-1.500000000000000E-05,  0)
0000000000000000000000000000000000000000000000000000000000000000
MODULE  (  1)  pure Zr 1 (left)
MATERIAL(  1)
SURFACE (  2), SIDE POINTER=(-1)
SURFACE (  3), SIDE POINTER=( 1)
SURFACE (  1), SIDE POINTER=(-1)
SURFACE (  4), SIDE POINTER=( 1)
0000000000000000000000000000000000000000000000000000000000000000
MODULE  (  2)  zone 1 medium impurity
MATERIAL(  2)
SURFACE (  4), SIDE POINTER=(-1)
SURFACE (  5), SIDE POINTER=( 1)
SURFACE (  1), SIDE POINTER=(-1)
SURFACE (  2), SIDE POINTER=(-1)
SURFACE (  3), SIDE POINTER=( 1)
0000000000000000000000000000000000000000000000000000000000000000
MODULE  (  3)  zone 2 high impurity
MATERIAL(  3)
SURFACE (  5), SIDE POINTER=(-1)
SURFACE (  6), SIDE POINTER=( 1)
SURFACE (  1), SIDE POINTER=(-1)
SURFACE (  2), SIDE POINTER=(-1)
SURFACE (  3), SIDE POINTER=( 1)
0000000000000000000000000000000000000000000000000000000000000000
MODULE  (  4)  zone 3 medium impurity
MATERIAL(  2)
SURFACE (  6), SIDE POINTER=(-1)
SURFACE (  7), SIDE POINTER=( 1)
SURFACE (  1), SIDE POINTER=(-1)
SURFACE (  2), SIDE POINTER=(-1)
SURFACE (  3), SIDE POINTER=( 1)
0000000000000000000000000000000000000000000000000000000000000000
MODULE  (  5)  pure Zr 2
MATERIAL(  1)
SURFACE (  7), SIDE POINTER=(-1)
SURFACE (  1), SIDE POINTER=(-1)
SURFACE (  2), SIDE POINTER=(-1)
SURFACE (  3), SIDE POINTER=( 1)
0000000000000000000000000000000000000000000000000000000000000000
END      0000000000000000000000000000000000000000000000000000000000000000

Marisa D. Acosta

Probeman

#5
Once you get the geometry file (.geo) specified correctly, if you have more than 2 materials you won't be able to use the PENEPMA GUI in the Standard application because it's only designed for the most common situations of one or two materials. But one can take a PENEPMA input file and modify using a text editor as described in this post here:

https://smf.probesoftware.com/index.php?topic=57.msg478#msg478

You'll have to run the modified PENEPMA input file from a command prompt, but that's easy enough:

cd "C:\Userdata\Penepma12\Penepma"
Penepma < "YourInputFile.in"

This might be easier to do in DTSA2 but I haven't tried. I'm sure Nicholas or Ben Buse will chime in on your efforts.

The more critical problem is that, if I understand correctly, you want to be able to determine how the BSE and x-ray emissions will appear as the electron interaction volume convolves these sub micron features. I've only utilized PENEPMA to observe the BSE or x-ray spectrum produced and have not attempted to visualize how these productions will appear in an imaging system.

Are you thinking of moving the beam position in (sub?) micron steps in PENEPMA, and then plotting the spectrum intensities generated to produce a simulated image?

PS Better to use the Gallery feature for in-line images:

https://smf.probesoftware.com/index.php?topic=2.msg4040#msg4040
The only stupid question is the one not asked!

Nicholas Ritchie

I can help you to script DTSA-II to produce the geometry you want.  Please provide a schematic diagram labeling all the relevant dimensions and materials.
"Do what you can, with what you have, where you are"
  - Teddy Roosevelt

macosta

Thanks for the details!  I think the .geo file I created is essentially what I want it to be.

However, Nicholas, I think actually your software would be maybe a bit more suited to what I am wanting to do , especially since it looks like it outputs the depths from which various signals are generated? I will send you a personal message with more details about my application.

John, yes, I was going to vary the beam distance from the interface and  the angle of the interface, then try to plot signal intensity as a function of distance.  I am keen to pull out the differences between BSE/X-ray generation as a function of which part of the interaction volume the features are intersecting...
Marisa D. Acosta

macosta

#8
Hi Nicholas,

I sent you a personal email, but thought I'd follow up here as well in case your response could be instructive for future users:)

After starting with a homogeneous bulk crystal to be sure that I understand the interface, I've moved up to modelling a thin vertical, rectangular particle/domain of composition 1 hosted in bulk homogeneous matrix of composition 2 .  I have two questions:

1.  I only get the fractional emission depths and volumes output for the homogeneous material, it does not show up for the more complex case where I've got a narrow rectangular particle. Is it somewhere else?  These values are really at the heart of what I'm after, so I am keen to hear your response.

2. I am also keen on knowing where in the interaction volume the backscattered electrons are from. Is this possible to pull out?

3. What is "sample rotation" in the specify geometry part defining?  I see that the angle of incidence is on the next dialogue block, so is this the rotation of the inclusion with respect to horizontal?

TIA!
Marisa D. Acosta

Nicholas Ritchie

Here is the script I sent via e-mail

import dtsa2.mcSimulate3 as mc3


def squiffBlock(origin, width, angle):
    """squiffBlock(origin, width, angle)
    Builds a vertical block of the specified width tilted to the specified angle"""
    mps = nm.MultiPlaneShape()
    ca, sa = jl.Math.cos(angle), jl.Math.sin(angle)
    mps.addPlane([0.0,0.0,-1.0],origin) # top
    mps.addPlane([-ca,0.0,-sa], origin) # left
    mps.addPlane([ca,0.0,sa], epu.Math2.plus(origin, [width, 0.0, 0.0])) # right
    mps.addPlane([0.0,0.0,1.0], epu.Math2.plus(origin, [0.0, 0.0, 2.0e-5])) # bottom
    return mps



def buildAcostaZircon(monte, chamber, origin, buildParams):
    # Layer materials
    subs = material("ZrSiO4",density=4.65)
    mat1 = material("0.999750*ZrSiO4 + 0.000250*Y",density=4.65)
    mat2 = material("0.999500*ZrSiO4 + 0.000500*Y",density=4.65)
    mat3 = material("0.999750*ZrSiO4 + 0.000250*Y",density=4.65)
    # Layer orientations
    angle = jl.Math.PI/4.0
    # Layer thicknesses
    lt1, lt2, lt3 = 125.0e-9, 50.0e-9, 100.0e-9
    monte.addSubRegion(chamber, subs, squiffBlock(epu.Math2.plus(origin, [-1.0e-5, 0.0, 0.0]), 1.0e-5, angle))
    monte.addSubRegion(chamber, mat1, squiffBlock(epu.Math2.plus(origin, [0.0, 0.0, 0.0]), lt1, angle))
    monte.addSubRegion(chamber, mat2, squiffBlock(epu.Math2.plus(origin, [lt1, 0.0, 0.0 ]), lt2, angle))
    monte.addSubRegion(chamber, mat3, squiffBlock(epu.Math2.plus(origin, [lt1+lt2, 0.0, 0.0 ]), lt3, angle))
    monte.addSubRegion(chamber, subs, squiffBlock(epu.Math2.plus(origin, [lt1+lt2+lt3, 0.0, 0.0 ]), 1.0e-5, angle))

def runAcostaZircon(det, e0=20.0, withPoisson=True, nTraj=mc3.defaultNumTraj, dose=mc3.defaultDose, sf=mc3.defaultCharFluor, bf=mc3.defaultBremFluor, xtraParams=mc3.defaultXtraParams):
    """runAcostaZircon(det, e0=20.0, withPoisson=True, nTraj=defaultNumTraj, dose=defaultDose, sf=defaultCharFluor, bf=defaultBremFluor, xtraParams={}):"""
    tmp = u"Acosta's Zoned Zircon at %0.1f keV%s%s x=%g um" % ( e0, (" + CSF" if sf else ""), (" + BSF" if bf else ""), 1.0e6*xtraParams["PosX"] )
    return mc3.base(det, e0, withPoisson, nTraj, dose, sf, bf, tmp, buildAcostaZircon, { }, xtraParams)

xrts = mc3.suggestTransitions("ZrSiOY")

for x in (-1.0e-6, -0.8e-6, -0.6e-6, -0.4e-6, -0.2e-6, 0.0, 0.2e-6, 0.4e-6, 0.6e-6, 0.8e-6, 1.0e-6 ):
    if terminated:
        break
    xtraParams = {}
    xtraParams.update(mc3.configureXRayAccumulators(xrts, charAccum=True, charFluorAccum=False, bremFluorAccum=False, printRes=False))
    xtraParams.update(mc3.configureEmissionImages(xrts,1.0e-6,1024))
    xtraParams.update(mc3.configureTrajectoryImage(2.0e-6,1024))
    #xtraParams.update(mc3.configureOutput("~\\Documents\\FY2025\\Acosta Zircon MC\\Output %g um" % (x*1.0e6)))
    xtraParams.update(mc3.configureBeam(x, 0.0, -1.0e-5, 1.0e-9))
    runAcostaZircon(d1, 15.0, nTraj = 1000, xtraParams=xtraParams)

You can run it by loading it into the "Script" tab.  It will run the simulation for various offsets from the feature and output trajectory images, emission images and a text file containing generated and emitted X-ray intensities.

It is possible to determine the backscatter depth. I'll get back to you on this.
"Do what you can, with what you have, where you are"
  - Teddy Roosevelt

Nicholas Ritchie

To get a backscatter depth histogram, just add

   xtraParams.update(mc3.configureBSEDDepth(0.0, 2.0e-6))

just above the
   runAcostaZircon(d1, 15.0, nTraj = 1000, xtraParams=xtraParams)

line.
"Do what you can, with what you have, where you are"
  - Teddy Roosevelt

Ben Buse

This is an interesting paper looking at inverse calculation - to determine composition where convolution
https://academic.oup.com/mam/article/30/4/729/7724951?searchresult=1
Does anyone know if the method / software /code is available to run what they did in the paper