@galihru/mnp-mie 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +155 -13
  2. package/package.json +14 -2
package/README.md CHANGED
@@ -1,18 +1,55 @@
1
1
  # @galihru/mnp-mie
2
2
 
3
- Rayleigh-limit scattering formulas for small spherical particles.
3
+ Rayleigh quasi-static scattering formulas for spherical metallic nanoparticles in a homogeneous embedding medium.
4
+ Computes complex polarizability and electromagnetic cross sections (extinction, scattering, absorption) within the dipole approximation, valid when the particle radius satisfies *a* ≪ λ.
4
5
 
5
- Implemented formulations:
6
+ ---
6
7
 
7
- $$
8
- \alpha = 4\pi a^3\frac{\varepsilon_p-\varepsilon_m}{\varepsilon_p+2\varepsilon_m}
9
- $$
8
+ ## Physical Background
10
9
 
11
- $$
12
- C_{\mathrm{ext}} = k\,\mathrm{Im}(\alpha),\quad
13
- C_{\mathrm{sca}} = \frac{|k|^4}{6\pi}|\alpha|^2,\quad
14
- C_{\mathrm{abs}} = C_{\mathrm{ext}}-C_{\mathrm{sca}}
15
- $$
10
+ In the Rayleigh (quasi-static) limit, the electromagnetic response of a small sphere is fully characterised by the induced electric dipole moment, parameterised through the complex polarizability α. This approach is the foundation for single-particle spectroscopy, surface-enhanced sensing, and photothermal applications.
11
+
12
+ ---
13
+
14
+ ## Implemented Formulations
15
+
16
+ ### 1. Quasi-static Polarizability
17
+
18
+ For a sphere of radius *a* with permittivity εₚ embedded in a medium with permittivity εₘ:
19
+
20
+ ![α = 4πa³(εp−εm)/(εp+2εm)](https://latex.codecogs.com/svg.latex?\alpha=4\pi%20a^3\frac{\varepsilon_p-\varepsilon_m}{\varepsilon_p+2\varepsilon_m})
21
+
22
+ The Fröhlich resonance condition (localized surface plasmon resonance) occurs when:
23
+
24
+ ![Re(εp + 2εm) = 0](https://latex.codecogs.com/svg.latex?\mathrm{Re}(\varepsilon_p+2\varepsilon_m)=0)
25
+
26
+ ---
27
+
28
+ ### 2. Wave Number in the Embedding Medium
29
+
30
+ ![k = (2π/λ)√εm](https://latex.codecogs.com/svg.latex?k=\frac{2\pi}{\lambda}\sqrt{\varepsilon_m})
31
+
32
+ where λ is the free-space wavelength in nanometres.
33
+
34
+ ---
35
+
36
+ ### 3. Electromagnetic Cross Sections
37
+
38
+ **Extinction cross section** (energy removed from the incident beam):
39
+
40
+ ![Cext = k Im(α)](https://latex.codecogs.com/svg.latex?C_{\mathrm{ext}}=k\,\mathrm{Im}(\alpha))
41
+
42
+ **Scattering cross section** (radiatively re-emitted energy):
43
+
44
+ ![Csca = |k|⁴/(6π)|α|²](https://latex.codecogs.com/svg.latex?C_{\mathrm{sca}}=\frac{|k|^4}{6\pi}|\alpha|^2)
45
+
46
+ **Absorption cross section** (non-radiative, Ohmic dissipation):
47
+
48
+ ![Cabs = Cext − Csca](https://latex.codecogs.com/svg.latex?C_{\mathrm{abs}}=C_{\mathrm{ext}}-C_{\mathrm{sca}})
49
+
50
+ All cross sections are expressed in nm².
51
+
52
+ ---
16
53
 
17
54
  ## Install
18
55
 
@@ -20,12 +57,117 @@ $$
20
57
  npm install @galihru/mnp-mie
21
58
  ```
22
59
 
23
- ## Usage
60
+ ---
61
+
62
+ ## API Reference
63
+
64
+ ### `rayleighPolarizability(radiusNm, epsParticle, epsMedium)`
65
+
66
+ Returns the complex polarizability α.
67
+
68
+ ```js
69
+ import { complex, rayleighPolarizability } from "@galihru/mnp-mie";
70
+
71
+ const epsParticle = complex(-7.45, 1.23); // e.g. Au at 548 nm
72
+ const epsMedium = complex(1.769, 0.0); // water
73
+
74
+ const alpha = rayleighPolarizability(50, epsParticle, epsMedium);
75
+ // → { re: ..., im: ... } [nm³]
76
+ ```
77
+
78
+ ---
79
+
80
+ ### `rayleighCrossSections(wavelengthNm, radiusNm, epsParticle, epsMedium)`
81
+
82
+ Returns extinction, scattering, and absorption cross sections.
24
83
 
25
84
  ```js
26
85
  import { complex, rayleighCrossSections } from "@galihru/mnp-mie";
27
86
 
87
+ const epsParticle = complex(-7.45, 1.23);
88
+ const epsMedium = complex(1.769, 0.0);
89
+
90
+ const cs = rayleighCrossSections(548.1, 50, epsParticle, epsMedium);
91
+ // → { cExt: ..., cSca: ..., cAbs: ... } [nm²]
92
+
93
+ // Array input (wavelength scan)
94
+ const spectra = rayleighCrossSections(
95
+ [400, 450, 500, 548, 600, 700],
96
+ 50,
97
+ [eps400, eps450, ...],
98
+ [em400, em450, ...]
99
+ );
100
+ ```
101
+
102
+ ---
103
+
104
+ ### `complex(re, im)`
105
+
106
+ Constructs a complex number.
107
+
108
+ ```js
109
+ import { complex } from "@galihru/mnp-mie";
110
+
111
+ const z = complex(-5.2, 2.1); // → { re: -5.2, im: 2.1 }
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Author
117
+
118
+ **GALIH RIDHO UTOMO** · g4lihru@students.unnes.ac.id
119
+ University of Semarang State (UNNES)
120
+ License: GPL-2.0-only
121
+
122
+
123
+ ## Implemented Formulations
124
+
125
+ ### Polarizability
126
+
127
+ ![α = 4πa³(εp−εm)/(εp+2εm)](https://latex.codecogs.com/svg.latex?\alpha=4\pi%20a^3\frac{\varepsilon_p-\varepsilon_m}{\varepsilon_p+2\varepsilon_m})
128
+
129
+ ### Wave Number in Medium
130
+
131
+ ![k = (2π/λ)√εm](https://latex.codecogs.com/svg.latex?k=\frac{2\pi}{\lambda}\sqrt{\varepsilon_m})
132
+
133
+ ### Cross Sections
134
+
135
+ Extinction:
136
+
137
+ ![C_ext = k Im(α)](https://latex.codecogs.com/svg.latex?C_{\mathrm{ext}}=k\,\mathrm{Im}(\alpha))
138
+
139
+ Scattering:
140
+
141
+ ![C_sca = |k|⁴/(6π)|α|²](https://latex.codecogs.com/svg.latex?C_{\mathrm{sca}}=\frac{|k|^4}{6\pi}|\alpha|^2)
142
+
143
+ Absorption:
144
+
145
+ ![C_abs = C_ext − C_sca](https://latex.codecogs.com/svg.latex?C_{\mathrm{abs}}=C_{\mathrm{ext}}-C_{\mathrm{sca}})
146
+
147
+ ## Install
148
+
149
+ ```bash
150
+ npm install @galihru/mnp-mie
151
+ ```
152
+
153
+ ## API
154
+
155
+ ```js
156
+ import { complex, rayleighPolarizability, rayleighCrossSections } from "@galihru/mnp-mie";
157
+
28
158
  const epsParticle = complex(-5.2, 2.1);
29
- const epsMedium = complex(1.77, 0.0);
30
- console.log(rayleighCrossSections(548.1, 50, epsParticle, epsMedium));
159
+ const epsMedium = complex(1.77, 0.0);
160
+
161
+ // Polarizability (radius in nm)
162
+ const alpha = rayleighPolarizability(50, epsParticle, epsMedium);
163
+
164
+ // Cross sections (wavelength in nm, radius in nm)
165
+ const cs = rayleighCrossSections(548.1, 50, epsParticle, epsMedium);
166
+ console.log(cs); // { ext: ..., sca: ..., abs: ... }
31
167
  ```
168
+
169
+ ## Author
170
+
171
+ **GALIH RIDHO UTOMO** — g4lihru@students.unnes.ac.id
172
+ License: GPL-2.0-only
173
+
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@galihru/mnp-mie",
3
- "version": "0.1.0",
4
- "description": "Rayleigh-limit scattering formulations for spherical particles.",
3
+ "version": "0.1.2",
4
+ "description": "Rayleigh quasi-static scattering: polarizability and electromagnetic cross sections for spherical nanoparticles.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
7
7
  "exports": {
@@ -11,6 +11,18 @@
11
11
  "src",
12
12
  "README.md"
13
13
  ],
14
+ "keywords": [
15
+ "mie-scattering",
16
+ "rayleigh",
17
+ "nanoparticle",
18
+ "cross-section",
19
+ "extinction",
20
+ "polarizability",
21
+ "plasmonics",
22
+ "nanophotonics",
23
+ "scattering",
24
+ "absorption"
25
+ ],
14
26
  "author": "GALIH RIDHO UTOMO <g4lihru@students.unnes.ac.id>",
15
27
  "license": "GPL-2.0-only",
16
28
  "repository": {