TYoshimura.DoubleDouble.AdvancedIntegrate 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package TYoshimura.DoubleDouble.AdvancedIntegrate --version 1.0.2                
NuGet\Install-Package TYoshimura.DoubleDouble.AdvancedIntegrate -Version 1.0.2                
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="TYoshimura.DoubleDouble.AdvancedIntegrate" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TYoshimura.DoubleDouble.AdvancedIntegrate --version 1.0.2                
#r "nuget: TYoshimura.DoubleDouble.AdvancedIntegrate, 1.0.2"                
#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.
// Install TYoshimura.DoubleDouble.AdvancedIntegrate as a Cake Addin
#addin nuget:?package=TYoshimura.DoubleDouble.AdvancedIntegrate&version=1.0.2

// Install TYoshimura.DoubleDouble.AdvancedIntegrate as a Cake Tool
#tool nuget:?package=TYoshimura.DoubleDouble.AdvancedIntegrate&version=1.0.2                

DoubleDoubleAdvancedIntegrate

Double-Double Advanced Numerical Integration Implements

Requirement

.NET 8.0
DoubleDouble
DoubleDoubleComplex
DoubleDoubleIntegrate

Install

Download DLL
Download Nuget

Usage

Line Integral

// Line integral on the line with integrand f(x, y) = x + 2 y
(ddouble value, ddouble error, long eval_points) = LineIntegral.AdaptiveIntegrate(
    (x, y) => x + 2 * y,
    Line2D.Line((0, 1), (2, 3)),
    Interval.Unit, eps: 0, maxdepth: 16
);
// Line integral on the (t, t^2) with integrand f(x, y) = x + 2 y
(ddouble value, ddouble error, long eval_points) = LineIntegral.AdaptiveIntegrate(
    (x, y) => x + 2 * y,
    new Line2D(t => (t, t * t), t => (1, 2 * t)),
    (0, 1), eps: 0, maxdepth: 16
);
// Line integral on the unit circle with integrand f(x, y) = x^2 + y^2
(ddouble value, ddouble error, long eval_points) = LineIntegral.AdaptiveIntegrate(
    (x, y) => x * x + y * y,
    Line2D.Circle,
    Interval.OmniAzimuth, eps: 0, maxdepth: 16
);
// Ellipse circumference
(ddouble value, ddouble error, long eval_points) = LineIntegral.AdaptiveIntegrate(
    (x, y) => 1,
    Line2D.Circle * (1.5, 2),
    Interval.OmniAzimuth, eps: 0, maxdepth: 16
);
// Line integral on the helix with integrand f(x, y, z) = z^2
(ddouble value, ddouble error, long eval_points) = LineIntegral.AdaptiveIntegrate(
    (x, y, z) => z * z,
    Line3D.Helix,
    Interval.OmniAzimuth, eps: 0, maxdepth: 16
);
// Line integral on the unit circle (z = 1) with integrand f(x, y, z) = x^2 + y^2 + z
(ddouble value, ddouble error, long eval_points) = LineIntegral.AdaptiveIntegrate(
    (x, y, z) => x * x + y * y + z,
    Line3D.Circle + (0, 0, 1),
    Interval.OmniAzimuth, eps: 0, maxdepth: 16
);

Surface Integral

// Surface integral on the [0, 2]x[0, 1] with integrand f(x, y) = (x - y)^2
(ddouble value, ddouble error, long eval_points) = SurfaceIntegral.AdaptiveIntegrate(
    (x, y) => ddouble.Square(x - y),
    Surface2D.Ortho,
    (0, 2), (0, 1), eps: 0, maxdepth: 4
);
// Surface integral on the triangle with integrand f(x, y) = 2 x + y
(ddouble value, ddouble error, long eval_points) = SurfaceIntegral.AdaptiveIntegrate(
    (x, y) => 2 * x + y,
    Surface2D.Triangle((0, 0), (1, 0), (0, 1)),
    Interval.Unit, Interval.Unit, eps: 0, maxdepth: 4
);
// 2-dimensional Gaussian integration in polar coordinates
(ddouble value, ddouble error, long eval_points) = SurfaceIntegral.AdaptiveIntegrate(
    (x, y) => ddouble.Exp(-(x * x + y * y)),
    Surface2D.InfinityCircle,
    Interval.Unit, Interval.OmniAzimuth, eps: 0, maxdepth: 4
);
// Surface integral on the unit sphere with integrand f(x, y, z) = x^2 + y + z^3
(ddouble value, ddouble error, long eval_points) = SurfaceIntegral.AdaptiveIntegrate(
    (x, y, z) => x * x + y + z * z * z,
    Surface3D.Sphere,
    Interval.OmniAltura, Interval.OmniAzimuth, eps: 0, maxdepth: 4
);
// Surface integral on the unit sphere and (x > 0) with integrand f(x, y, z) = x^2 + y + z^3
(ddouble value, ddouble error, long eval_points) = SurfaceIntegral.AdaptiveIntegrate(
    (x, y, z) => x * x + y + z * z * z,
    Surface3D.Rotate(Surface3D.Sphere, (0, 0, 1), (1, 0, 0)),
    (0, ddouble.PI / 2), Interval.OmniAzimuth, eps: 0, maxdepth: 4
);

Volume Integral

// Volume integral on the ellipsoid with integrand f(x, y, z) = x^2 + y
(ddouble value, ddouble error, long eval_points) = VolumeIntegral.AdaptiveIntegrate(
    (x, y, z) => x * x + y,
    Volume3D.Sphere * (2, 3, 5),
    Interval.Unit, Interval.OmniAltura, Interval.OmniAzimuth,
    eps: 0, maxdepth: 2
);

Complex Integral

note: If the integral path contains poles, the accuracy of the calculation results cannot be guaranteed.

(Complex value, ddouble error, long eval_points) = ComplexIntegral.AdaptiveIntegrate(
    z => 1 / z,
    Line2D.Circle,
    Interval.OmniAzimuth, eps: 0, maxdepth: 16
);

Vector Integral

(ddouble value, ddouble error, long eval_points) = LineVectorIntegral.AdaptiveIntegrate(
    (x, y, z) => (x * x * y * z, 3 * x * y, y * y),
    Line3D.Helix,
    (0, ddouble.PI / 2), eps: 0, maxdepth: 16
);
(ddouble value, ddouble error, long eval_points) = SurfaceVectorIntegral.AdaptiveIntegrate(
    (x, y, z) => (-x, -y, -z),
    Surface3D.Cylinder,
    (0, ddouble.PI / 2), (0d, 1d), eps: 0, maxdepth: 16
);

Licence

MIT

Author

T.Yoshimura

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.1.0 94 11/2/2024
1.0.2 124 8/11/2024
1.0.1 114 8/11/2024
1.0.0 112 8/10/2024

Add: vector integral