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
 Need help fitting some biochemistry data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

yawg

4 Posts

Posted - 02/02/2009 :  6:50:46 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin):
Operating System:

Hello all, I'm new to origin and need a little help graphing some data I collected in lab.

Basically I have a complex equation that contains a variable that I want to "float" (eventually have origin solve for the best fit for me). I have the X and Y values, and want the software to graph it for me with the best fit for the unknown variable. How do I do this?

I don't know if it matters but my equation is

Y = e*x*B+0.5*(120000-35000)*[(Kd+x*B+B)+((Kd+x*B+B)^2-(4*x*B^2)^.5)]

where I know Y, e, x, and B. I want to determine the best fit for Kd. (which is one variable)

Thanks for your help!

Deanna

China
Posts

Posted - 02/03/2009 :  01:44:00 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Actually, you only need to define your own function and then use it to fit the data.

Here is a tutorial on how to define a fitting function:
http://www.originlab.com/www/helponline/Origin8/en/mergedProjects/Tutorial/Tutorial/User_Defined_Fitting_Function_using_OC.html

Deanna
OriginLab Technical Services
Go to Top of Page

yawg

4 Posts

Posted - 02/04/2009 :  5:21:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Deanna, that helped a lot! I am following the tutorial and unfortunately after entering my equation and verifying the correctness of the function, I get a compilation error. I don't understand what is wrong with the equation I am using, and am not sure if this issue is a syntax error or not (I have a lot of parentheses).

My equation is:

y = e2*x*B+(0.5*(e1-e2)*[(K+x*B+B)+sqrt(((K+x*B+B)^2)-((4*x*B)^2)))])

I've been fiddling with the parentheses a lot to make sure they are correct, and one time I received an "Error: mismatch of parentheses", but now have that resolved. The errors I am now getting are:
"Error, invalid term"
"Error, general compile error"
"Error, error(s) found in compiling function _nlsfKdreverse"

...where my function name is Kdreverse.

Any help? Thanks much!



Go to Top of Page

cpyang

USA
1406 Posts

Posted - 02/04/2009 :  6:04:02 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You cannot use [ ] like that in C code. [ ] is reserved to indicate array elements.

To make your code easier to read and check, you can use intermediate variables, maybe something like this?



	double t1 = K+x*B+B;
	double v1 = t1 + sqrt(t1^2 - (4*x*B)^2);	
	y = e2*x*B + 0.5*(e1-e2)* v1;



CP
Go to Top of Page

yawg

4 Posts

Posted - 02/04/2009 :  10:30:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks cpyang, but I replaced the brackets with parenthesis and still didn't work. Still get the same errors. :/

Next step will be to simplify the equation like you said, but I don't think that'll help. Thanks though.
Go to Top of Page

yawg

4 Posts

Posted - 02/05/2009 :  3:59:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
WOW!

Ok cpyang I took your advice and it worked!
Now I just need to figure out how to best optimize my fit.

Thanks for the help everyone!

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