NMath User's Guide

TOC | Previous | Next | Index

34.1 Creating TwoVariableIntegrators (.NET, C#, CSharp, VB, Visual Basic, F#)

A TwoVariableIntegrator has two instances of IIntegrator: one for the x dimension, and one for the y dimension. This code constructs a TwoVariableIntegrator with the default univariate integrators:

Code Example – C# integration

var integrator = new TwoVariableIntegrator();

Code Example – VB integration

Dim Integrator As New TwoVariableIntegrator()

Instances of GaussKronrodIntegrator are used by default. Alternatively, you can provide non-default univariate integrators:

Code Example – C# integration

var gauss1 = new GaussKronrodIntegrator();
var gauss2 = new GaussKronrodIntegrator();
gauss2.Tolerance = 1e-6;
var integrator = new TwoVariableIntegrator( gauss1, gauss2 );

Code Example – VB integration

Dim Gauss1 As New GaussKronrodIntegrator()
Dim Gauss2 As New GaussKronrodIntegrator()
Gauss2.Tolerance = "1e-6"
Dim Integrator As New TwoVariableIntegrator(Gauss1, Gauss2)

Class TwoVariableIntegrator also provides properties DxIntegrator and DyIntegrator for getting and setting the x and y univariate integrators on a TwoVariableIntegrator instance post-construction.


Top

Top