using System; using System.Collections.Generic; using System.Linq; using System.Text; using V = Science.Mathematics.VectorCalculus; namespace VectorCalculus5Ed.Chapter8.Section1 { public class Example01 { public Example01() { } private string result; public string Result { get{return result;} } public void Compute() { Science.Mathematics.Function.ToLastType ff = new Science.Mathematics.Function.ToLastType(func); V.Surface s = new V.Surface(ff); s.Parameter1StartValue = 0.0; s.Parameter1EndValue = 2.0*Math.PI; s.Parameter2StartValue = 0.0; s.Parameter2EndValue = 1.0; Science.Mathematics.Function.ToLastType gg = new Science.Mathematics.Function.ToLastType(gunc); V.Path p = new V.Path(gg); p.ParameterFrom = 0.0; p.ParameterTo = 2.0 * Math.PI; Science.Mathematics.Function.ToLastType P = new Science.Mathematics.Function.ToLastType(pf); Science.Mathematics.Function.ToLastType Q = new Science.Mathematics.Function.ToLastType(qf); V.GreenTheorem obj = new V.GreenTheorem(p, P, Q, s); obj.Compute(); result += obj.LeftHandSideBestEstimation.ToString() + "\r\n"; result += obj.RightHandSideBestEstimation.ToString() + "\r\n"; result += obj.RightHandSideStandardDeviation.ToString() + "\r\n"; } private double[] func(double[] u) { double[] x = new double[3]; x[0] = u[1]*Math.Cos(u[0]); x[1] = u[1]*Math.Sin(u[0]); x[2] = 0.0; return x; } private double[] gunc(double t) { double[] x = new double[3]; x[0] = Math.Cos(t); x[1] = Math.Sin(t); x[2] = 0.0; return x; } private double pf(double[] x) { return x[0]; } private double qf(double[] x) { return x[0]*x[1]; } } } /* 7.45884910702034E-13 -4.46552260086984E-07 2.00334866057059E-05 */