Debian Codegraph @

hugo/content/ref/sample/particle/composition/core-shell.md

raw
1 +++
2 title = "Core and shell"
3 weight = 10
4 +++
5
6 ## Core-and-shell particle
7
8 To construct a particle made of a core and a shell, use
9
10 ```python
11 composite_particle = ba.CoreAndShell(core, shell)
12 ```
13
14 where `core` and `shell` typically are simple particles generated by the
15 [Particle](../) constructor.
16
17 Adjust the internal positions of the core and shell with a prior call:
18
19 ```python
20 core.translate(core_position)
21 shell.translate(shell_position)
22 ```
23
24 The `composite_particle` can also be translated as a whole.
25
26 Note that core must be fully contained in shell. The scattering is computed as
27 the coherent sum of the scattering from shell and core where the scattering
28 power of the latter has been modified by subtracting the scattering power of
29 the shell material.
30
31 ##### History
32
33 Prior to BornAgain 1.19.80, the constructor `ParticleCoreShell` had the
34 opposite argument order, namely `(shell, core)`.
35
36 ##### Example
37
38 See [Core-and-shell example](../ex/core-shell-particle). Validated through an
39 alternative implementation that uses particle composition,
40 {{% ref-ex "scatter2d/CoreShellNanoparticles2.py" %}}.