using System; using System.Collections.Generic; using System.Linq; using System.Text; using V = Science.Mathematics.VectorCalculus; namespace VectorCalculus5Ed.Chapter6.Section3 { public class Example03 { public Example03() { } private string result; public string Result { get{return result;} } public void Compute() { Science.Mathematics.Function.ToLastType f = new Science.Mathematics.Function.ToLastType(func); double[] from = { 0.0, 0.0 }; double[] to = { 1.0, 1.0 }; V.IntegrationMultiD obj = new V.IntegrationMultiD(f, from, to); obj.NumberOfCall = 1000000; obj.Compute(); double deno = obj.BestEstimation; Science.Mathematics.Function.ToLastType f1 = new Science.Mathematics.Function.ToLastType(func1); obj.Function = f1; obj.Compute(); double no = obj.BestEstimation; double ans = no / deno; result += ans.ToString() + "\r\n"; } private double func(double[] x) { return Math.Exp(x[0] + x[1]); } private double func1(double[] x) { return x[0]*Math.Exp(x[0] + x[1]); } } } /* 0.58197667792403 */