@galihru/mnp 0.1.2 → 0.1.3
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.
- package/README.md +121 -157
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,158 +1,122 @@
|
|
|
1
|
-
# @galihru/mnp
|
|
2
|
-
|
|
3
|
-
Integrated computational package for the electromagnetic response
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
2.
|
|
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
|
-
| `crossSection` |
|
|
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
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
# @galihru/mnp
|
|
2
|
+
|
|
3
|
+
Integrated computational package for the single-nanoparticle electromagnetic response in the Rayleigh quasi-static limit. Composes dielectric-function evaluation with polarizability and optical cross-section computation into a unified, self-consistent simulation API.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Physical Scope
|
|
8
|
+
|
|
9
|
+
This package solves the **single-nanoparticle optical response problem**: given a metallic sphere of radius *a* � ? embedded in a dielectric host medium, compute as functions of illumination wavelength:
|
|
10
|
+
|
|
11
|
+
1. Complex permittivity via the **Drude free-electron model**:
|
|
12
|
+
=\varepsilon_\infty-\frac{\omega_p^2}{\omega(\omega+i\gamma)})
|
|
13
|
+
|
|
14
|
+
2. Complex polarizability via the **Clausius�Mossotti relation**:
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
3. Electromagnetic **cross sections** from the optical theorem:
|
|
18
|
+
,\quad%20C_{\mathrm{sca}}=\frac{|k|^4}{6\pi}|\alpha|^2,\quad%20C_{\mathrm{abs}}=C_{\mathrm{ext}}-C_{\mathrm{sca}})
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Composed Packages
|
|
23
|
+
|
|
24
|
+
| Package | Description |
|
|
25
|
+
|---|---|
|
|
26
|
+
| [`@galihru/mnp-material`](https://www.npmjs.com/package/@galihru/mnp-material) | Drude dielectric model for Au, Ag, Al; constant e; complex wave number |
|
|
27
|
+
| [`@galihru/mnp-mie`](https://www.npmjs.com/package/@galihru/mnp-mie) | Rayleigh polarizability; extinction, scattering, and absorption cross sections |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install @galihru/mnp
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## API Reference
|
|
40
|
+
|
|
41
|
+
### `simulateSphereResponse(options)` � High-level
|
|
42
|
+
|
|
43
|
+
Computes the complete optical response of a metallic nanosphere in a single call.
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
import { simulateSphereResponse } from "@galihru/mnp";
|
|
47
|
+
|
|
48
|
+
const result = simulateSphereResponse({
|
|
49
|
+
material: "Au", // "Au" | "Ag" | "Al"
|
|
50
|
+
wavelengthNm: 548.1, // nm � scalar or Array for spectral scan
|
|
51
|
+
radiusNm: 50, // nm
|
|
52
|
+
mediumRefractiveIndex: 1.33 // dimensionless refractive index of host medium
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Return value:**
|
|
57
|
+
|
|
58
|
+
| Field | Unit | Description |
|
|
59
|
+
|---|---|---|
|
|
60
|
+
| `inputs` | � | Echo of all input parameters |
|
|
61
|
+
| `epsParticle` | `{re, im}` | Complex permittivity of the metal particle |
|
|
62
|
+
| `epsMedium` | `{re, im}` | Permittivity of the embedding medium |
|
|
63
|
+
| `alpha` | `{re, im}` nm� | Quasi-static complex polarizability |
|
|
64
|
+
| `crossSection.cExt` | nm� | Extinction cross section |
|
|
65
|
+
| `crossSection.cSca` | nm� | Scattering cross section |
|
|
66
|
+
| `crossSection.cAbs` | nm� | Absorption cross section |
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
### Low-level Re-exports
|
|
71
|
+
|
|
72
|
+
All functions from sub-packages are re-exported directly:
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
import {
|
|
76
|
+
// Dielectric models
|
|
77
|
+
drudeEpsilon, makeDrudeMaterial, constantEpsilon, wavenumberInMedium,
|
|
78
|
+
// Scattering
|
|
79
|
+
rayleighPolarizability, rayleighCrossSections,
|
|
80
|
+
// Complex arithmetic
|
|
81
|
+
complex, add, sub, mul, div, sqrtComplex, fromReal,
|
|
82
|
+
// Constants
|
|
83
|
+
EV_TO_NM, HARTREE_EV
|
|
84
|
+
} from "@galihru/mnp";
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Example � Spectral Scan
|
|
90
|
+
|
|
91
|
+
```js
|
|
92
|
+
import { drudeEpsilon, constantEpsilon, rayleighCrossSections } from "@galihru/mnp";
|
|
93
|
+
|
|
94
|
+
const wavelengths = [400, 450, 500, 548, 600, 700];
|
|
95
|
+
|
|
96
|
+
// Au permittivity across wavelengths
|
|
97
|
+
const epsAu = drudeEpsilon("Au", wavelengths);
|
|
98
|
+
|
|
99
|
+
// Host medium: water (n = 1.33, e = n�)
|
|
100
|
+
const epsH2O = wavelengths.map(w => constantEpsilon(1.769, w));
|
|
101
|
+
|
|
102
|
+
// Cross sections for a 50 nm radius Au sphere
|
|
103
|
+
const spectra = rayleighCrossSections(wavelengths, 50, epsAu, epsH2O);
|
|
104
|
+
|
|
105
|
+
spectra.forEach((cs, i) =>
|
|
106
|
+
console.log(`${wavelengths[i]} nm Cext=${cs.cExt.toFixed(1)} nm� Cabs=${cs.cAbs.toFixed(1)} nm�`)
|
|
107
|
+
);
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Keywords
|
|
113
|
+
|
|
114
|
+
nanoparticle � plasmonics � nanophotonics � mie-scattering � drude-model � lspr � localized-surface-plasmon � cross-section � electrodynamics � simulation
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Author
|
|
119
|
+
|
|
120
|
+
**GALIH RIDHO UTOMO** � g4lihru@students.unnes.ac.id
|
|
121
|
+
Universitas Negeri Semarang (UNNES)
|
|
108
122
|
License: GPL-2.0-only
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
## Packages Included
|
|
112
|
-
|
|
113
|
-
| Package | Description |
|
|
114
|
-
|---|---|
|
|
115
|
-
| [`@galihru/mnp-material`](https://www.npmjs.com/package/@galihru/mnp-material) | Dielectric models (Drude, constant, tabulated) |
|
|
116
|
-
| [`@galihru/mnp-mie`](https://www.npmjs.com/package/@galihru/mnp-mie) | Rayleigh scattering cross sections |
|
|
117
|
-
|
|
118
|
-
## Install
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
npm install @galihru/mnp
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
## Usage
|
|
125
|
-
|
|
126
|
-
### High-level API
|
|
127
|
-
|
|
128
|
-
```js
|
|
129
|
-
import { simulateSphereResponse } from "@galihru/mnp";
|
|
130
|
-
|
|
131
|
-
const result = simulateSphereResponse({
|
|
132
|
-
material: "Au",
|
|
133
|
-
wavelengthNm: 548.1,
|
|
134
|
-
radiusNm: 50,
|
|
135
|
-
mediumRefractiveIndex: 1.33
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
console.log(result.crossSection); // { ext, sca, abs }
|
|
139
|
-
console.log(result.epsParticle); // { re, im }
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Low-level API
|
|
143
|
-
|
|
144
|
-
All exports from sub-packages are re-exported:
|
|
145
|
-
|
|
146
|
-
```js
|
|
147
|
-
import {
|
|
148
|
-
drudeEpsilon, constantEpsilon, wavenumberInMedium,
|
|
149
|
-
rayleighCrossSections, rayleighPolarizability,
|
|
150
|
-
complex
|
|
151
|
-
} from "@galihru/mnp";
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## Author
|
|
155
|
-
|
|
156
|
-
**GALIH RIDHO UTOMO** — g4lihru@students.unnes.ac.id
|
|
157
|
-
License: GPL-2.0-only
|
|
158
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galihru/mnp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Integrated electromagnetic response of metallic nanoparticles: Drude dielectric model combined with Rayleigh quasi-static scattering.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"author": "GALIH RIDHO UTOMO <g4lihru@students.unnes.ac.id>",
|
|
28
28
|
"license": "GPL-2.0-only",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@galihru/mnp-material": "0.1.
|
|
31
|
-
"@galihru/mnp-mie": "0.1.
|
|
30
|
+
"@galihru/mnp-material": "0.1.3",
|
|
31
|
+
"@galihru/mnp-mie": "0.1.3"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|