www.sdlsuite.com Forum Index www.sdlsuite.com
Discussion of technical aspects of the SDL Component Suite
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CalcPolyFit of TCurveFit does not work

 
Post new topic   Reply to topic    www.sdlsuite.com Forum Index -> MathPack
View previous topic :: View next topic  
Author Message
ytake



Joined: 22 Oct 2013
Posts: 5

PostPosted: Thu Jul 05, 2018 7:17 am    Post subject: CalcPolyFit of TCurveFit does not work Reply with quote

Dear Sir,

When I execute "calcPolyfit" of TCurveFit, there is "Your program exceeds one of the limits of the free Light Edition or ...." error comes up.

According to SDL Suite help, there is no limitation for TCurveFit or I use only 3rd order of poly fitting with 6 members of data.

On Addition, I have successfully used function "CalcPolyfit" before. However it is not possible now.


My source code is following. Please advise what is wrong.


vvvvvvvvvvvvvvvvv

uses
SDL_math2, SDL_sdlBase;

var
mtx2 : Array [ 0 .. 3 ] of Array [ 1 .. 6 ] of Double;


procedure TForm2.FormCreate(Sender: TObject);
var
i, j : Word;
odr : Byte;
// kA : Array [ 0 .. MAXPOLYFITORDER ] of Double;
kA : TDoubleArray;
fitQual : Double;
status : Boolean;
begin

mtx2[0][1] := 10;
mtx2[1][1] := 2.1969;
mtx2[2][1] := 2.4351;
mtx2[3][1] := 2.5498;
mtx2[0][2] := 15;
mtx2[1][2] := 1.4170;
mtx2[2][2] := 1.5740;
mtx2[3][2] := 1.6790;
mtx2[0][3] := 20;
mtx2[1][3] := 0.9359;
mtx2[2][3] := 1.0374;
mtx2[3][3] := 1.0863;
mtx2[0][4] := 30;
mtx2[1][4] := 0.4980;
mtx2[2][4] := 0.5520;
mtx2[3][4] := 0.5780;
mtx2[0][5] := 40;
mtx2[1][5] := 0.2650;
mtx2[2][5] := 0.2937;
mtx2[3][5] := 0.3075;
mtx2[0][6] := 50;
mtx2[1][6] := 0.1129;
mtx2[2][6] := 0.1251;
mtx2[3][6] := 0.1310;

curvefit1.Init();

for j := 1 to 7 do
curvefit1.EnterStatValue( mtx2[0][j], mtx2[1][j]);

odr := 3 ;
SetLength( kA, odr + 1 );
curvefit1.CalcPolyFit( odr, kA, fitQual, status );

end;
^^^^^^^^^^^^^


Attention: the declaration of Array kA, when CalcPolyFit is working is that
kA : Array [ 0 .. MAXPOLYFITORDER ] of Double;
however this declaration is wrong.

in fact, type "TDoubleArray" is also Array of Double, as well,



My environment is Delphi XE6 with Light Edition of SDL suite.


Please advice me.
Back to top
View user's profile Send private message
ytake



Joined: 22 Oct 2013
Posts: 5

PostPosted: Fri Jul 06, 2018 8:01 am    Post subject: Polynomial fitting Reply with quote

Well, if I exceed any limitation, what limitation do I exceed?

Its possibilities are number of polynomial order and number of data points.

However, polynomial order is 3. This is lower than MAXPOLYFITORDER.
And number of data points are only 6.


Any other possibilities?


Please advise me.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.sdlsuite.com Forum Index -> MathPack All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group