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
 All Forums
 Origin Forum
 Origin Forum
 problems with function definition file...

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
wbturnbull Posted - 08/14/2002 : 12:00:18 PM
I have a couple of problems with a function definition file that I have written (based on a file that I was given that works fine...).

(1) I get warning messages that it is not generating values when I try to run it in Origin after assigning all of the variables and giving it reasonable starting values. However, if I define the variables in the script window (Xt=%H_Xt; etc...) and copy and paste the script in en bloc and execute it ,it does generate reasonable values.

(2) It also apparently plots lines for two functions that I define (numerator(x) and denominator(x)) along with lines for two of the datasets generated in the calculation (k and DQ).

(3) Also, when I was trying to set up the variables in the script window I kept finding that direct definitions along the lines of: InjVM=%H_InjV/1E6; worked only sometimes - other times it seemed to ignore the command... However, InjVM=%H_InjV; InjVM/=1E6; was a bit more reliable.

The full fdf is pasted below, any suggestions about what is wrong would be gratefully received as I only have one example of an fdf file to work from.

[GENERAL INFORMATION]
Function Name=AB5
Brief Description=AB5
Function Source=N/A
Function Type=User-Defined
Function Form=Y-Script
Number Of Parameters=6
Number Of Independent Variables=4
Number Of Dependent Variables=1


[FITTING PARAMETERS]
Naming Method=User-Defined
Names=K1,H1,K2,H2,Xsyr,V0
Meanings=K1 (/M),H1 (cal/mol),K2 (/M),H2 (cal/mol),[X] in syringe (mM),cell volume (L)
Initial Values=--(V),--(V),--(V),--(V) ,--(F),0.0014109(F)
Lower Bounds=--(X,OFF)
Upper Bounds=--(X,OFF)
Number Of Significant Digits=6,6,6,6,6,6


[FORMULA]
MtB5=Mt;
MtB5/=5000;#assumes Mt is [B-subunit] in mM, MtB5 is [B5-pentamer] in mol/l.
XtM=Xt;
XtM/=1000;#total ligand in mol/l.
InjVM=injV;
InjVM/=1000000;#injection volume in L.
XsyrM=Xsyr;
XsyrM/=1000;#assumes [X] in syringe input in mM - converts to mol/l.
f=K1;
g=K2;
numerator(x)=f*x+(f*g+f^2)*2*x^2+(f*g^2+f^2*g)*3*x^3+f*g^3*4*x^4+g^5*x^5;
denominator(x)=1+f*5*x+(f*g+f^2)*5*x^2+(f*g^2+f^2*g)*5*x^3+f*g^3*5*x^4+g^5*x^5;
create k -n 1000;
for (i=1;MtB5[i]>0;i+=1)
{
a=0;#initial value for low boundary.
c=XtM[i];#initial value for high boundary.
d=XtM[i];#c is a starting value that is varied, d is always XtM[i].
e=MtB5[i];
loop(j,1,40)
{
b=((c-a)/2+a);
k[i]=b;#writes xmid to element i of "k" dataset.
Ya=a-d+e*5*numerator(a)/denominator(a);
Yb=b-d+e*5*numerator(b)/denominator(b);
if (Yb==0||(c-a)<=d*0.0001) {break;};#0.0001 works well
if (Yb*Ya<0) {c=b;}
else {a=b;};
};
};#dataset "k" contains values for [free ligand] obtained from a bisection search.
Q=MtB5*5*V0*(f*k*H1+f*g*(H1+H2)*k^2+f^2*2*H1*k^2+f*g^2*(H1+2*H2)*k^3+f^2*g*(2*H1+H2)*k^3+f*g^3*(H1+3*H2)*k^4+g^5*5*H2*k^5)/denominator(k);
create DQ -n 1000;
for (i=1; injVM[i]>0; i+=1)
{
DQ[i]=Q[i+1]+injVM*(Q[i+1]+Q[i])/(2*V0)-Q[i];
};
NDH=DQ/(injVM*XsyrM);

[CONSTRAINTS]
/*Enter general linear constraints here*/


[CONSTANTS]


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


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


[INDEPENDENT VARIABLES]
injV=
Xt=
Mt=
XMt=

[DEPENDENT VARIABLES]
NDH=


[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=No
Generate Peaks During Fitting=No
Generate Peaks with Baseline=No
Paste Parameters to Plot After Fitting=Yes
Paste Parameters to Script Window After Fitting=Yes
Generate Residue After Fitting=No
Keep Parameters=Yes
1   L A T E S T    R E P L I E S    (Newest First)
wbturnbull Posted - 08/15/2002 : 09:47:48 AM
I have now sorted out problem (2) by using the polynomial function provided with Origin, and making "k" and "DQ" temporary datasets. However the fitting will still not start... after entering some starting parameters and pressing the one iteration button I notice that in the bottom left corner of the screen there is a message that rapidly cycles through some numbers finally giving i=2 and then I get the message "Flamda is 0.001 at iteration 1" with the usual message about the script not generating values and that I should check my syntax etc. Flamda was the subject of a previous discussion on this site, but no solutions to the guy's problem were pasted.

Is the format of my function definition file OK?

Bruce

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000