Hi,
I am trying to do a curve fitting, but I can't figure out how to use my own formula's for the fitting.
I need to provide 2 ways of curve fitting:
- using a exponentional function (see image below)
- using a polynome y=ax³+bx²+cx+d where i define the factors a to d
Once, the curve is plotted, I also need to some mathematical operations on it, e.g. calculating the tangent at a certain angle.
Is it possible to do such custom functions ?
custom curve fitting with exponential or polynome
-
- Newbie
- Posts: 23
- Joined: Tue Feb 10, 2009 12:00 am
Re: custom curve fitting with exponential or polynome
Hi,
Have you tried using the custom function as in the example at "All features\Welcome !\Functions\Extended\Custom y=f(x)" in the features demo program included with the binary installation?
Have you tried using the custom function as in the example at "All features\Welcome !\Functions\Extended\Custom y=f(x)" in the features demo program included with the binary installation?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 23
- Joined: Tue Feb 10, 2009 12:00 am
Re: custom curve fitting with exponential or polynome
I think the y=f(x) is just a function to plot y-values as a function of x.
I have a chart which for example has 10 points.
I need to do a curve fitting with a polynome or a exponential function (2 methods for fitting).
I have a chart which for example has 10 points.
I need to do a curve fitting with a polynome or a exponential function (2 methods for fitting).
-
- Newbie
- Posts: 23
- Joined: Tue Feb 10, 2009 12:00 am
Re: custom curve fitting with exponential or polynome
Any ideas ?
thank you
thank you
Re: custom curve fitting with exponential or polynome
Hi,
The Curve fitting function calculates the polynomial factors that best matches the source data. I'd suggest you to take a look at the example in the features demo program at "All features\Welcome !\Functions\Extended\Cure fitting"
I think it would fit your polynome requirement.
Regarding the exponential function, I still think it should be done with the custom function. Here you have an example that looks similar to the one in your picture:
The Curve fitting function calculates the polynomial factors that best matches the source data. I'd suggest you to take a look at the example in the features demo program at "All features\Welcome !\Functions\Extended\Cure fitting"
I think it would fit your polynome requirement.
Regarding the exponential function, I still think it should be done with the custom function. Here you have an example that looks similar to the one in your picture:
Code: Select all
var Line1: TLineSeries;
CustomFun1: TCustomTeeFunction;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
Chart1.Legend.Visible:=false;
CustomFun1:=TCustomTeeFunction.Create(Self);
CustomFun1.StartX:=1.3;
CustomFun1.Period:=0.001;
CustomFun1.NumPoints:=125;
CustomFun1.OnCalculate:=Calculate;
Line1:=Chart1.AddSeries(TLineSeries)as TLineSeries;
Line1.FunctionType:=CustomFun1;
Chart1.Axes.Left.SetMinMax(0, 12);
Chart1.Axes.Bottom.SetMinMax(1.28, 1.44);
end;
procedure TForm1.Calculate(Sender:TCustomTeeFunction; const x:Double; var y:Double);
begin
y:=0.0000004 * Exp(11.939*x);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |