private double FunctionValueHalfTime(INonlinearModel model, int rowVid, ValuesByIndex values, bool newValues) { foreach (Variable c in data.Variables) { if (c.ConstName == "T1/2") { c.ConstValue = values[model.GetIndexFromKey(c.ConstName)]; break; } } double R = data.Variables[0].ConstValue; double w = data.Variables[1].ConstValue; double Kon = data.Variables[2].ConstValue; double Koff = data.Variables[3].ConstValue; double Df = data.Variables[4].ConstValue; double Ceq = data.Variables[5].ConstValue; double Feq = 1 - Ceq; double Tht = data.Variables[6].ConstValue; data.FitYVals = new double[data.XVals.Length]; Laplace lap = new Laplace(); lap.InitStehfest(14); return(Math.Abs((R)*lap.InverseTransform(R, w, Feq, Ceq, Kon, Koff, Df, Tht) - 0.5 * R)); }
private double FunctionValueHalfTime(INonlinearModel model, int rowVid, ValuesByIndex values, bool newValues) { e.Parameters["t"] = values[model.GetIndexFromKey("t")]; double val = 0; double.TryParse(e.Evaluate().ToString(), out val); return(Math.Abs(half - val)); }
private double FunctionValue(INonlinearModel model, int rowVid, ValuesByIndex values, bool newValues) { foreach (Variable c in data.Variables) { c.ConstValue = values[model.GetIndexFromKey(c.ConstName)]; } double dev = FindDeviation(data); return(dev); }