Predefined Nonlinear Curves
Defining a nonlinear curve and calculating the partial derivatives can get quite complicated. For this reason, Numerics.NET provides a series of predefined nonlinear curves. Each class implements the ValueAt, SlopeAt, and FillPartialDerivatives methods.
The table below lists the predefined non-linear curve types, organized by their primary applications:
Category | Class | Description |
|---|---|---|
Oscillatory & Periodic | A 4-parameter periodic sine curve. | |
A 5-parameter damped sinusoidal curve for oscillatory decay. | ||
Peak / Line-Shape Models | A 4-parameter Gaussian 'bell' curve for symmetric peaks. | |
A 4-parameter Lorentzian peak curve. | ||
A 4-parameter log-normal distribution for skewed peaks. | ||
A 5-parameter curve for modeling skewed peaks in chromatography. | ||
A 5-parameter mixed Gaussian-Lorentzian curve for spectroscopy. | ||
Logistic & Dose–Response (Sigmoids) | The 4-parameter logistic function for dose-response curves. | |
The 5-parameter logistic function with asymmetry factor. | ||
A 3-parameter curve for cooperative binding. | ||
A 6-parameter curve for processes that rise then fall. | ||
Growth / Survival (CDF-like Sigmoids) | A 4-parameter asymmetric growth curve. | |
A 5-parameter flexible growth curve. | ||
A 4-parameter normal CDF curve for step-like transitions. | ||
A 4-parameter cumulative Weibull distribution for reliability analysis. | ||
Saturation & Kinetics | A 2-parameter curve for enzyme kinetics and saturation. | |
Monotonic Scaling & Decay Laws | A sum of exponential terms. | |
A 3-parameter power-law curve for scaling phenomena. | ||
A quotient of two polynomials. |
These classes reside in the Numerics.NET.Curves.Nonlinear namespace. A more detailed description of each curve type is given below. In the formulas, a parameter ai represents the parameter with index i in the curve's Parameters collection. For some curves, the individual parameters have a specific meaning, and the class implementing the curve has properties with descriptive names for these parameters. These properties are also listed where available.
Sine Curve
A sine curve represents a periodic function.
The equation is:
A sine curve is implemented by the SineCurve class and takes four parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | y0 | The mean value of the curve. The curve oscillates around this value. | |
1 | x0 | The starting point of the oscillation. | |
2 | T | The period of the curve. | |
3 | A | The amplitude of the curve. |
Damped Sine Curve
A damped sine wave curve combines oscillatory behavior with exponential decay.
The equation is:
A damped sine wave curve is implemented by the DampedSineCurve class and takes five parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | A | Initial amplitude (amplitude at x = 0). | |
1 | k | Damping coefficient (rate of exponential decay). | |
2 | T | Period (determines oscillation rate). | |
3 | Phase offset (horizontal shift of the oscillation). | ||
4 | C | Baseline offset (equilibrium position). |
Gaussian Curve
A Gaussian curve is one type of curve that is used to represent functions with a peak shape:
The equation is:
A Gaussian curve is implemented by the GaussianCurve class and takes four parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | y0 | The offset (value as x goes to infinity). | |
1 | The location of the peak. | ||
2 | w | The width of the peak halfway between the baseline and the top of the peak. | |
3 | A | The area between the curve and a horizontal line at y = Offset. |
In addition, the GaussianCurve class has an Amplitude property that returns the difference between the function value at the peak and the baseline (Offset).
Lorentz Curve
A Lorentz curve is used to represent functions with a peak shape. The peak is sharper than the Gaussian curve.
The equation is:
A Lorentz curve is implemented by the LorentzCurve class and takes four parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | y0 | The offset (value as x goes to infinity). | |
1 | The location of the peak. | ||
2 | w | The width of the peak halfway between the baseline and the top of the peak. | |
3 | A | The area between the curve and a horizontal line at y = Offset. |
In addition, the LorentzCurve class has an Amplitude property that returns the difference between the function value at the peak and the baseline (Offset).
Log-Normal Curve
A log-normal curve represents a right-skewed distribution commonly used in many fields. It is the probability density function of a log-normal distribution.
The equation is:
A log-normal curve is implemented by the LogNormalCurve class and takes four parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | A | Amplitude or scaling factor. | |
1 | Location parameter (median, mean of the logarithm). | ||
2 | Scale parameter (standard deviation of the logarithm). | ||
3 | C | Offset offset. |
Exponentially Modified Gaussian Curve
An Exponentially Modified Gaussian curve models skewed peaks commonly seen in chromatography.
The equation is:
An Exponentially Modified Gaussian curve is implemented by the ExponentiallyModifiedGaussianCurve class and takes five parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | A | Peak amplitude (total area under the curve). | |
1 | Location parameter (relates to peak center). | ||
2 | Width parameter (Gaussian standard deviation). | ||
3 | Exponential relaxation time (controls tailing). | ||
4 | C | Offset offset. |
Pseudo-Voigt Curve
A Pseudo-Voigt curve is a linear combination of Gaussian and Lorentzian profiles used in spectroscopy.
The equation is:
where G is a normalized Gaussian and L is a normalized Lorentzian. A Pseudo-Voigt curve is implemented by the PseudoVoigtCurve class and takes five parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | A | Peak amplitude (total area under the peak). | |
1 | Peak center (position of maximum). | ||
2 | w | Peak width (full width at half maximum). | |
3 | Mixing parameter (0 = pure Gaussian, 1 = pure Lorentzian). | ||
4 | C | Offset offset. |
Four Parameter Logistic Curve
A logistic curve is commonly used to represent growth processes and dose-response relationships.
The equation is:
A logistic curve is implemented by the FourParameterLogisticCurve class and has four parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | A1 | The upper asymptote (value as x approaches zero). | |
1 | A2 | The lower asymptote (value as x approaches infinity). | |
2 | x0 | The inflection point (halfway point in the transition from InitialValue to FinalValue). | |
3 | p | The Hill slope (steepness parameter) of the curve. |
Five Parameter Logistic Curve
The four-parameter logistic curve is symmetrical in that the change from the initial value and the change towards the final value occur at roughly the same rate. When the data is not symmetrical in this way, the fitted curve may not be a good fit. The five-parameter logistic curve adds an asymmetry parameter that remedies this situation.
The equation is:
The 5 parameter logistic curve is implemented by the FiveParameterLogisticCurve class and has five parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | A1 | The upper asymptote (value as x approaches zero). | |
1 | A2 | The lower asymptote (value as x approaches infinity). | |
2 | x0 | The inflection point (halfway point in the transition from InitialValue to FinalValue). | |
3 | p | The Hill slope (steepness parameter). | |
4 | s | The asymmetry factor (s = 1 reduces to 4PL). |
Hill Curve
A Hill curve models cooperative binding and sigmoidal dose-response relationships.
The equation is:
A Hill curve is implemented by the HillEquationCurve class and takes three parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | Vmax | Maximum response (asymptotic value as x → ∞). | |
1 | K | Half-maximal concentration (x value at which y = Vmax/2). | |
2 | n | Hill coefficient (cooperativity parameter). |
Double Sigmoid Curve
A double sigmoid curve models processes that rise and then fall, creating a bell-shaped response.
The equation is:
A double sigmoid curve is implemented by the DoubleSigmoidCurve class and takes six parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | A | Maximum amplitude (peak height above baseline). | |
1 | k1 | Hill slope of the rising phase. | |
2 | x1 | Midpoint of the rising phase. | |
3 | k2 | Hill slope of the falling phase. | |
4 | x2 | Midpoint of the falling phase. | |
5 | C | Offset offset. |
Gompertz Curve
A Gompertz curve models asymmetric growth processes.
The equation is:
A Gompertz curve is implemented by the GompertzCurve class and takes four parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | A | Asymptotic amplitude (maximum value minus baseline). | |
1 | b | Displacement along the x-axis. | |
2 | c | Growth rate (controls the steepness). | |
3 | C | Offset offset (lower asymptote). |
Richards Curve
A Richards curve provides flexible modeling of growth processes with adjustable asymmetry.
The equation is:
A Richards curve is implemented by the RichardsCurve class and takes five parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | A | Upper asymptote (maximum value minus baseline). | |
1 | Shape parameter (controls asymmetry). | ||
2 | k | Growth rate parameter. | |
3 | x0 | Inflection point location. | |
4 | C | Offset offset (lower asymptote). |
Normal CDF Curve
A normal CDF curve models smooth step-like transitions. It is the cumulative distribution function of the normal distribution.
The equation is:
A normal CDF curve is implemented by the NormalCdfCurve class and takes four parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | A | Amplitude (half the total change from minimum to maximum). | |
1 | Center or inflection point (location of the transition). | ||
2 | Width parameter (controls the steepness of the transition). | ||
3 | C | Offset offset (vertical shift). |
Weibull CDF Curve
A Weibull CDF curve models reliability and survival data. It is the cumulative distribution function of the Weibull distribution.
The equation is:
A Weibull CDF curve is implemented by the WeibullCdfCurve class and takes four parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | A | Amplitude (total change from baseline to asymptote). | |
1 | Scale parameter (characteristic life or 63.2nd percentile). | ||
2 | k | Shape parameter (determines failure rate behavior). | |
3 | C | Offset offset. |
Michaelis-Menten Curve
A Michaelis-Menten curve models enzyme kinetics and saturation processes.
The equation is:
A Michaelis-Menten curve is implemented by the MichaelisMentenCurve class and takes two parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | Vmax | Maximum reaction rate (asymptotic value as x → ∞). | |
1 | Km | Michaelis constant (substrate concentration at half-maximum rate). |
Exponential Curves
An exponential curve is a curve that involves one or more exponential functions eax. There is immense variety in the exact definition of different exponential curves. The ExponentialCurve class represents a curve that is the sum of one or more exponential terms:
The equation is:
The constructor takes one integer parameter that specifies the number of terms in the curve. The curve has 2n parameters, where n is the number of terms.
Power Curve
A power curve models scaling relationships and self-similar phenomena.
The equation is:
A power curve is implemented by the PowerCurve class and takes three parameters:
Index | Parameter | Property | Description |
|---|---|---|---|
0 | A | Amplitude or scaling coefficient. | |
1 | Power-law exponent (often positive for decay). | ||
2 | C | Offset | Offset offset. |
Rational Curves
A rational curve is a curve that is the quotient of two polynomials. Multiplying both polynomials by a constant gives the same curve. To resolve this ambiguity, the constant term of the polynomial in the denominator is set to 1. A rational curve therefore has n+d+1 parameters, where n is the degree of the polynomial in the numerator, and d is the degree of the polynomial in the denominator:
The equation is:
The RationalCurve class implements this type of curve. The constructor takes two integer parameters: the degree of the polynomial in the numerator, and the degree of the polynomial in the denominator.