Skip to content

galihru/mnpbem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

163 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

MNPBEM: Multi-Language Plasmonics Simulation Ecosystem

License: GPL-3.0 Release PyPI npm NuGet Crates.io

MNPBEM provides reproducible optical-response workflows for metallic nanoparticles, implemented across multiple programming languages. The core physical model combines the Drude dielectric function with the Rayleigh quasi-static approximation for spherical particles.

Scope

This repository contains two aligned tracks:

  1. MNPBEM family (modular scientific workflow packages)
  2. MnpPlasmon family (lightweight cross-language plasmonics calculator)

Physical Model

Drude dielectric function

For a dispersive metal:

$$ \varepsilon(\omega) = \varepsilon_\infty - \frac{\omega_p^2}{\omega(\omega + i\gamma)} $$

Where:

  • $\varepsilon_\infty$: high-frequency dielectric constant
  • $\omega_p$: plasma frequency (eV)
  • $\gamma$: damping rate (eV)
  • $\omega$: angular frequency (eV)

Rayleigh polarizability for a sphere

For $a \ll \lambda$:

$$ \alpha(\omega) = 4\pi a^3 \frac{\varepsilon_p(\omega) - \varepsilon_m}{\varepsilon_p(\omega) + 2\varepsilon_m} $$

Optical cross-sections

$$ \sigma_{ext} = \frac{4\pi}{k},\mathrm{Im}\left[\alpha(\omega)\right] $$

$$ \sigma_{sca} = \frac{k^4}{6\pi},\left|\alpha(\omega)\right|^2 $$

$$ \sigma_{abs} = \sigma_{ext} - \sigma_{sca} $$

with $k = \frac{2\pi n_m}{\lambda}$.

Built-in material parameters

Material $\omega_p$ (eV) $\gamma$ (eV) $\varepsilon_\infty$
Au 3.106 0.0132 8.90
Ag 3.810 0.0048 3.91
Al 14.83 0.0980 1.24

Minimal Usage

Python

from mnp_plasmon import sphere_response

r = sphere_response(wavelength_nm=550.0, radius_nm=25.0, material="Au")
print(r.c_ext, r.c_sca, r.c_abs)

Julia

using MnpPlasmon

r = sphere_response(550.0, 25.0, "Au")
println(r.c_ext, " ", r.c_sca, " ", r.c_abs)

C

#include "mnp_plasmon.h"

sphere_response_t r = mnp_simulate_sphere_response("Au", 550.0, 25.0, 1.0);

JavaScript (npm)

npm install @galihru/mnp
import { sphereResponse } from "@galihru/mnp";

const r = sphereResponse({ wavelengthNm: 550, radiusNm: 25, material: "Au" });
console.log(r.cExt, r.cSca, r.cAbs);

GitHub Packages And "Used by"

To make packages visible under the GitHub profile package tab, publish to npm.pkg.github.com with public package visibility. If a package was published as private first, set it to public in package settings.

The repository "Used by" count is automatic and appears when public repositories depend on this project/packages. It cannot be forced manually.

Community Health

  • Code of Conduct: .github/CODE_OF_CONDUCT.md
  • Contributing Guide: .github/CONTRIBUTING.md
  • Security Policy: .github/SECURITY.md
  • Issue Templates: .github/ISSUE_TEMPLATE/
  • Pull Request Template: .github/pull_request_template.md
  • Dependabot Config: .github/dependabot.yml

Development

This repository can regenerate cross-language example plots automatically from module source code. The generated PNG files keep the same filenames on every update so the repository stays compact.

Python

Package: mnpbem-material + mnpbem-mie
Registry: PyPI

python example

JavaScript

Package: @galihru/mnp
Registry: npm

javascript example

C#

Package: MnpPlasmon
Registry: NuGet

csharp example

Rust

Package: mnp-plasmon
Registry: Crates.io

rust example

R

Package: mnpPlasmonR
Registry: CRAN-ready

r example

Julia

Package: MnpPlasmon
Registry: General Registry

julia example

Ruby

Package: mnp_plasmon
Registry: RubyGems + GitHub Packages

ruby example

C

Package: mnp-plasmon
Registry: vcpkg / source

c example

C++

Package: mnp-plasmon
Registry: vcpkg / source

cpp example

Author

Galih Ridho Utomo
g4lihru@students.unnes.ac.id
GitHub profile

License

GPL-3.0-only. See LICENSE.

About

a modular implementation of scientific workflows inspired by the MNPBEM ecosystem.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors