You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > TMtxOptimization Class > TMtxOptimization Properties > TMtxOptimization.VariableParameters Property
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
TMtxOptimization.VariableParameters Property

Set/read the variables in minimized function.

Syntax
C#
Visual Basic
public TVec VariableParameters;

Access the VariableParameters vector to set/read the variables in minimized function. To define number of variables and their initial values, set the VariableParameters vector Length and Values properties. Read the VariableParameters Values property to get the function minimum position.

using Dew.Math; using Dew.Math.Units; using Dew.Math.Editors; double Banana(TVec Pars, TVec Consts, object[] objs) { return 100*Math387.IntPower(Pars[1]-Math387.IntPower(Pars[0],2),2) + Math387.IntPower(1-Pars[0],1); } void Example(TMtxOptim opt1) { // function with two variables // initial values for variables => Pars[0] := 2, Pars[1] := -1; opt1.VariableParameters.SetIt(false,new double[] {2,-1}); opt1.RealFunction = Banana; opt1.OptimizationMethod = optMarquardt; // numeric approximation opt1.GradProcedure = null; opt1.GradHessProcedure = null; opt1.Recalculate(); // now VariableParameters holds minimum position MtxVecEdit.ViewValues(opt1.VariableParameters,"Minimum position"); end;
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!