MnpPlasmon 0.1.0

dotnet add package MnpPlasmon --version 0.1.0
                    
NuGet\Install-Package MnpPlasmon -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MnpPlasmon" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MnpPlasmon" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="MnpPlasmon" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MnpPlasmon --version 0.1.0
                    
#r "nuget: MnpPlasmon, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MnpPlasmon@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MnpPlasmon&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=MnpPlasmon&version=0.1.0
                    
Install as a Cake Tool

MNP Plasmon - C# NuGet Package

Modern .NET library for calculating optical response of metallic nanoparticles using Drude model and Rayleigh approximation.

Features

  • .NET 6.0+ implementation with System.Numerics.Complex
  • Drude model for metallic dielectric function
  • Rayleigh polarizability calculations
  • Optical cross-sections: extinction, scattering, absorption
  • Material database: Au, Ag, Al with realistic parameters
  • High-level API for complete sphere response simulation
  • Comprehensive unit tests with xUnit
  • Nullable reference types enabled for better type safety
  • XML documentation for IntelliSense

Installation

Install via NuGet Package Manager:

dotnet add package MnpPlasmon

Or in Visual Studio Package Manager Console:

Install-Package MnpPlasmon

Build from Source

dotnet build
dotnet test
dotnet run --project Demo

Usage

using MnpPlasmon;

// Simulate Au nanoparticle response
var response = MnpPlasmon.SimulateSphereResponse(
    "Au",           // material
    550.0,          // wavelength (nm)
    20.0,           // radius (nm)
    1.33            // medium refractive index (water)
);

MnpPlasmon.PrintResponse(response);

Console.WriteLine($"Extinction: {response.CExt:E6} nm²");
Console.WriteLine($"Scattering: {response.CSca:E6} nm²");
Console.WriteLine($"Absorption: {response.CAbs:E6} nm²");

API Reference

Material Functions

IReadOnlyList<Material> MaterialList()
bool MaterialExists(string name)
Material GetMaterial(string name)

Dielectric Functions

Complex DrudeEpsilon(string material, double wavelengthNm)
Complex ConstantEpsilon(double nSquared)

Rayleigh Theory

Complex RayleighPolarizability(
    double radiusNm,
    Complex epsParticle,
    Complex epsMedium
)

CrossSections RayleighCrossSections(
    double wavelengthNm,
    double radiusNm,
    Complex epsParticle,
    Complex epsMedium
)

High-level API

SphereResponse SimulateSphereResponse(
    string material,
    double wavelengthNm,
    double radiusNm,
    double mediumRefractiveIndex
)

Utilities

void PrintResponse(SphereResponse response)

Data Types

All types use C# records for immutability:

record Material(
    string Name,
    double OmegaP,
    double Gamma,
    double EpsInf
);

record SphereResponse(
    double WavelengthNm,
    double RadiusNm,
    double MediumRefractiveIndex,
    Complex EpsParticle,
    Complex Polarizability,
    double CExt,
    double CSca,
    double CAbs
);

record CrossSections(
    double CExt,
    double CSca,
    double CAbs
);

Requirements

  • .NET 6.0 or higher
  • No external dependencies for core library

License

GPL-3.0-only - See LICENSE file for details

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 110 3/12/2026