The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 error: calling members of unattached wrapper class
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

crabman

USA
2 Posts

Posted - 03/03/2022 :  5:02:31 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello, Im a scientist and not much of a programmer, I have received a program from a fellow scientist, who wrote it using an earlier version of origin (~2007)

I keep getting an error popup (error: calling members of unattached wrapper class) when I finish compiling and try to fit a graph. Any and all help would be very very appreciated.

Here is the code I'm trying to get to work:


[GENERAL INFORMATION]
Function Name=ProgCurve051507
Brief Description=
Function Source=N/A
Function Type=User-Defined
Function Form=Equations
Number Of Parameters=6
Number Of Independent Variables=1
Number Of Dependent Variables=1
Analytical Derivatives for User-Defined=Off


[FITTING PARAMETERS]
Naming Method=User-Defined
Names=So, Km, sp, Et, Fo, Fi
Meanings=?
Initial Values=F(F),130e-6(F),132307(F),F(F),F(F),F(F)
Lower Bounds=--(X, Off),1E-7(X, On),130983(X, On),1.934E-8(X, On),--(X, Off),--(X, Off)
Upper Bounds=--(X, Off),1E-3(I, Off),133630(I, On),2.137E-8(I, On),--(X, Off),--(X, Off)
Number Of Significant Digits=0,5,0,0,0,0


[FORMULA]

static Worksheet wks("Data1091");
static Dataset dsX(wks,0);

static vector vY;
vY.SetSize(dsX.GetSize());
// static vector vS,
// vS.SetSize(dsX.GetSize());

int nSize = dsX.GetSize();
static double Soo, Ett , Kmm, spp, Foo, Fii, kc;

if( Soo !=So || Ett!=Et || Kmm!=Km || spp!=sp || Foo!=Fo || Fii!=Fi )
{
// double xi,xii; // xi: x(i-1); xii: x(i);
double si=So, sii=So; // si: s(i-1); sii: s(i);
vY[0] = Fo;
kc= sp*Km;
for(int ii = 1; ii < nSize; ii++)
{
sii = si - ( (kc*Et*si/(Km+si)) * (dsX[ii]-dsX[ii-1]) );
vY[ii] = vY[ii-1] + ( (kc*Et*si/(Km+si)) * ((Fi-Fo)/So) * (dsX[ii]-dsX[ii-1]) );
si = sii;
}
Soo = So;
Ett = Et;
Kmm = Km;
spp = sp;
Foo = Fo;
Fii = Fi;
}


for(int ii = 0; dsX[ii]<x && ii<nSize-1; ii++);
y = vY[ii];


[CONSTRAINTS]



[CONSTANTS]


[Parameters Initialization]
/*Code to be executed to initialize parameters.*/


[INITIALIZATIONS]
/*Code to be executed before fitting, a good place for complicated initialization.*/


[AFTER FITTING]
/*Code to be executed after fitting, a good place for generating results.*/


[ON PARAM CHANGE]
/*Code to be executed when parameters change.*/


[INDEPENDENT VARIABLES]
x=


[DEPENDENT VARIABLES]
y=


[CONTROLS]
General Linear Constraints=Off
Initialization Scripts=Off
Scripts After Fitting=Off
Number Of Duplicates=N/A
Duplicate Offset=N/A
Duplicate Unit=N/A
Generate Curves After Fitting=Yes
Curve Point Spacing=Same X as Fitting Data
Generate Peaks After Fitting=Yes
Generate Peaks During Fitting=Yes
Generate Peaks with Baseline=Yes
Paste Parameters to Plot After Fitting=Yes
Paste Parameters to Notes Window After Fitting=Yes
Generate Residuals After Fitting=No
Keep Parameters=No
Enable Parameters Initialization=0
Compile On Param Change Script=0


[COMPILE FUNCTION]
Compile=1
Compile Parameters Initialization=0
On Param Change Scripts Enabled=0


[ORIGIN C FUNCTION HEADER]



[ORIGIN C PARAMETER INITIALIZATION HEADER]






Nathaniel Dorda

yuki_wu

896 Posts

Posted - 03/03/2022 :  10:44:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Nathaniel,

You can send us the *.fdf file via creating a ticket so that we can help to check what went wrong:
https://www.originlab.com/restricted/support/newticket.aspx?c=3

Regards, Yuki
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000