Table of Contents

Class NumericalSolver

Namespace
Hi.Geom.Solvers
Assembly
HiGeom.dll

A numerical solver for systems of equations using the Jacobian matrix.

public class NumericalSolver
Inheritance
NumericalSolver
Inherited Members
Extension Methods

Constructors

NumericalSolver(SetParasDelegate, int, GetRepondsDelegate, int, double, double, int)

Initializes a new instance of the NumericalSolver class.

public NumericalSolver(NumericalSolver.SetParasDelegate setParasFunc, int paraNum, NumericalSolver.GetRepondsDelegate getResponsesFunc, int targetNum, double partialInterval, double tolerance, int iterationLimit = 12)

Parameters

setParasFunc NumericalSolver.SetParasDelegate

Function to set parameter values

paraNum int

Number of parameters in the system

getResponsesFunc NumericalSolver.GetRepondsDelegate

Function to get response values

targetNum int

Number of target values (equations) in the system

partialInterval double

Interval for calculating partial derivatives

tolerance double

Tolerance for convergence

iterationLimit int

Maximum number of iterations allowed

Properties

GetResponsesFunc

Gets the function used to get response values.

public NumericalSolver.GetRepondsDelegate GetResponsesFunc { get; }

Property Value

NumericalSolver.GetRepondsDelegate

HalfPartialInterval

Gets half of the partial interval value for optimization.

public double HalfPartialInterval { get; }

Property Value

double

IterationLimit

Gets or sets the maximum number of iterations allowed.

public int IterationLimit { get; set; }

Property Value

int

ParaNum

Gets or sets the number of parameters in the system.

public int ParaNum { get; set; }

Property Value

int

Paras

Sets the parameter values in the system being solved.

public double[] Paras { set; }

Property Value

double[]

PartialInterval

Gets or sets the interval used for calculating partial derivatives.

public double PartialInterval { get; set; }

Property Value

double

Responses

Gets the response values from the system being solved.

public double[] Responses { get; }

Property Value

double[]

SetParasFunc

Gets the function used to set parameter values.

public NumericalSolver.SetParasDelegate SetParasFunc { get; }

Property Value

NumericalSolver.SetParasDelegate

TargetNum

Gets or sets the number of target values (equations) in the system.

public int TargetNum { get; set; }

Property Value

int

Tolerance

Gets or sets the tolerance for convergence.

public double Tolerance { get; set; }

Property Value

double

Methods

ErrorFunc(double[], double[])

Calculates the error (difference) between the system responses and target values.

public double[] ErrorFunc(double[] paras, double[] targets)

Parameters

paras double[]

The parameter values to use

targets double[]

The target values to compare against

Returns

double[]

An array of error values

Solve(double[], double[], out double, out double[,])

Solves the system of equations using numerical methods.

public SolvingResultStatus Solve(double[] paras, double[] targets, out double minBias, out double[,] jacob)

Parameters

paras double[]

The initial parameter values, will be modified during solving

targets double[]

The target values to solve for

minBias double

Output parameter that will contain the minimum bias (error) found

jacob double[,]

Output parameter that will contain the final Jacobian matrix

Returns

SolvingResultStatus

The status of the solving process

Remarks

Note that the paras array will be modified during solving.