@galihru/mnp-material 0.1.0 → 0.1.1

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 +55 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,12 +1,40 @@
1
1
  # @galihru/mnp-material
2
2
 
3
3
  Scientific dielectric-response models for plasmonic simulations.
4
+ JavaScript port of the [mnpbem-material](https://pypi.org/project/mnpbem-material/) Python module.
4
5
 
5
- Implemented formulation (Drude model):
6
+ ## Features
6
7
 
7
- $$
8
- \varepsilon(\omega)=\varepsilon_\infty-\frac{\omega_p^2}{\omega(\omega+i\gamma)}
9
- $$
8
+ - Constant dielectric model for homogeneous media
9
+ - Drude free-electron model for metals (Au, Ag, Al)
10
+ - Tabulated `(E, n, k)` optical constants with wavelength interpolation
11
+ - Complex arithmetic utilities
12
+
13
+ ## Implemented Formulations
14
+
15
+ ### Constant Dielectric
16
+
17
+ ![ε(λ) = ε₀](https://latex.codecogs.com/svg.latex?\varepsilon(\lambda)=\varepsilon_0)
18
+
19
+ Wave number in medium:
20
+
21
+ ![k(λ) = (2π/λ)√ε](https://latex.codecogs.com/svg.latex?k(\lambda)=\frac{2\pi}{\lambda}\sqrt{\varepsilon})
22
+
23
+ ### Drude Model
24
+
25
+ For free-electron metals (Au, Ag, Al):
26
+
27
+ ![ε(ω) = ε∞ - ωp²/(ω(ω+iγ))](https://latex.codecogs.com/svg.latex?\varepsilon(\omega)=\varepsilon_\infty-\frac{\omega_p^2}{\omega(\omega+i\gamma)})
28
+
29
+ Energy–wavelength conversion:
30
+
31
+ ![ω_eV = 1239.84 / λ_nm](https://latex.codecogs.com/svg.latex?\omega_{\mathrm{eV}}=\frac{1239.84}{\lambda_{\mathrm{nm}}})
32
+
33
+ ### Tabulated Material
34
+
35
+ Given tabulated optical constants `(E, n, k)`:
36
+
37
+ ![ε = (n + ik)²](https://latex.codecogs.com/svg.latex?\varepsilon=(n+ik)^2)
10
38
 
11
39
  ## Install
12
40
 
@@ -14,11 +42,31 @@ $$
14
42
  npm install @galihru/mnp-material
15
43
  ```
16
44
 
17
- ## Usage
45
+ ## API
18
46
 
19
47
  ```js
20
- import { drudeEpsilon } from "@galihru/mnp-material";
48
+ import {
49
+ constantEpsilon,
50
+ drudeEpsilon,
51
+ makeDrudeMaterial,
52
+ wavenumberInMedium,
53
+ complex, add, sub, mul, div, sqrtComplex,
54
+ EV_TO_NM, HARTREE_EV
55
+ } from "@galihru/mnp-material";
21
56
 
57
+ // Drude model for gold at 548.1 nm
22
58
  const epsAu = drudeEpsilon("Au", 548.1);
23
- console.log(epsAu);
59
+ console.log(epsAu); // { re: ..., im: ... }
60
+
61
+ // Constant dielectric (water, n ≈ 1.33)
62
+ const epsWater = constantEpsilon(1.33 ** 2, 548.1);
63
+
64
+ // Wave number in medium
65
+ const k = wavenumberInMedium(epsWater, 548.1);
24
66
  ```
67
+
68
+ ## Author
69
+
70
+ **GALIH RIDHO UTOMO** — g4lihru@students.unnes.ac.id
71
+ License: GPL-2.0-only
72
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galihru/mnp-material",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Material dielectric models for plasmonic electrodynamics.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",