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
 Need help fitting some biochemistry data

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
yawg Posted - 02/02/2009 : 6:50:46 PM
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!
5   L A T E S T    R E P L I E S    (Newest First)
yawg Posted - 02/05/2009 : 3:59:53 PM
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!

yawg Posted - 02/04/2009 : 10:30:45 PM
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.
cpyang Posted - 02/04/2009 : 6:04:02 PM
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
yawg Posted - 02/04/2009 : 5:21:03 PM
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!



Deanna Posted - 02/03/2009 : 01:44:00 AM
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

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