Author |
Topic |
|
cpsun
Taiwan
Posts |
Posted - 11/08/2005 : 05:43:34 AM
|
Origin Version (Select Help-->About Origin): 7.5 Operating System:XP Hi! I face one question which two different reults will be given when fitting the same data in the same range by the equation Y=A/x^(3/2)+r+B*x+D*x^2. The different results will be obtained when the "Use Origin C" checkbox is checked" or not. I don't know why will cause the difference as "Use Origin C" checkbox is checked", but If I remove the term of A/x^3/2, two results will be the same. Please help me to answer the question. Thanks.
Edited by - cpsun on 11/08/2005 05:47:06 AM |
|
easwar
USA
1964 Posts |
Posted - 11/08/2005 : 07:36:50 AM
|
Hi,
When using Origin C (when the check box is checked), fractions such as 3/2 are treated as integer division, so 3/2 yields 1 and not 1.5 thus causing the difference.
When check box is turned off, the equation is interpreted by LabTalk script and in LabTalk only double variable type for numbers is supported. So in this case 3/2 = 1.5
So if you rewrite the equation as: Y=A/x^(3.0/2)+r+B*x+D*x^2 it will be the same. Just need to have at least one number in the fraction to be double.
Easwar OriginLab
|
|
|
cpsun
Taiwan
Posts |
Posted - 11/08/2005 : 10:52:04 AM
|
Thank for answering the question. The problem had solved, but I still have some problems. First. As you say "fractions such as 3/2 are treated as integer division, so 3/2 yields 1 and not 1.5" , how is about 0.5 when using Origin C, is it equal to 1 ?
Moreover, I add another equation F*s^2/x^(3/2)*exp(s/x^1/2)/(exp(s/x^1/2)-1)^2 into the original one. Initially I use T^2 (temperatrue^2) as variable x in the equation y=A/x^(3/2)+r+B*x+D*x^2+F*s^2/x^(3/2)*exp(s/x^1/2)/(exp(s/x^1/2)-1)^2 and I can get a best fit of data. However, I want to fit the data by T as variable. For this purpose. I change the equation like Y=A/x'^(3)+r+B*x'^2+D*x'^4+F*s^2/x'^(3)*exp(s/x')/(exp(s/x')-1)^2 and the datasets into the variables,x, but I can not get the same result as eariler one. How does cause the difference between two independent variable,x? Thanks.
|
|
|
easwar
USA
1964 Posts |
Posted - 11/09/2005 : 09:34:00 AM
|
Hi,
Again, 3/2 yields 1 and not 0.5 in Origin C because this is standard C convention - 3/2 means integer division and the result is only integer and so it becomes 1. That is why you need to write 3.0/2 or 3/2.0 or 3.0/2.0 so that at least one number is double and then the compiler understands that the result should be double as well.
As for further problems with your fitting function, it is not clear to me what you are trying to do. Best is to send your fitting function to tech support and ask for more help. You can refer to this forum thread in your e-mail.
Easwar OriginLab
|
|
|
minimax
348 Posts |
Posted - 11/14/2005 : 01:40:35 AM
|
Hi cpsun,
Fisrt of all ,an equation, for example y=a+b*x, expresses a relationship between y and x.
Hence, with regard to your another problem, the first equation expresses the relation between y and T^2, whereas the second equation expresses the relation between y and T. Obviously, the two relations are generally different, so difference results occur.
quote:
Thank for answering the question. The problem had solved, but I still have some problems. First. As you say "fractions such as 3/2 are treated as integer division, so 3/2 yields 1 and not 1.5" , how is about 0.5 when using Origin C, is it equal to 1 ?
Moreover, I add another equation F*s^2/x^(3/2)*exp(s/x^1/2)/(exp(s/x^1/2)-1)^2 into the original one. Initially I use T^2 (temperatrue^2) as variable x in the equation y=A/x^(3/2)+r+B*x+D*x^2+F*s^2/x^(3/2)*exp(s/x^1/2)/(exp(s/x^1/2)-1)^2 and I can get a best fit of data. However, I want to fit the data by T as variable. For this purpose. I change the equation like Y=A/x'^(3)+r+B*x'^2+D*x'^4+F*s^2/x'^(3)*exp(s/x')/(exp(s/x')-1)^2 and the datasets into the variables,x, but I can not get the same result as eariler one. How does cause the difference between two independent variable,x? Thanks.
Max OriginLab GZoffice
Edited by - minimax on 11/14/2005 01:45:14 AM |
|
|
|
Topic |
|
|
|