Author |
Topic  |
|
dominik.mierzwa
Poland
119 Posts |
Posted - 05/24/2023 : 08:14:12 AM
|
Origin Ver. and Service Release (Select Help-->About Origin): 2023b Operating System: W10
Hi, I have tried to build my own NLfit function but unsuccessfully. I have a function: m=me+(m0-me)*exp(-k*t)
where m=y t=x m0=max(y) - constant me=min(y) - constant k - parameter (initially 0.001)
The exemplary data are given below. Could you help me? https://my.originlab.com/ftp/forum_and_kbase/Images/230524-example.opju
Kind regards, Dominik |
|
snowli
USA
1411 Posts |
Posted - 05/24/2023 : 10:31:20 AM
|
Hello,
Since u want m0 and me to be max and min of y data, u will have to set them as parameter instead of constantso that u can use initial formula feature of Origin. https://blog.originlab.com/use-initial-formula-to-better-guess-fitting-parameter-values-from-data
U can set them to be fixed so it's same as constant.
Here are key steps on each page when using Tools: Fitting Function Builder.
Function Type to be LabTalk Expression
independent variables: t dependent variables: m Parameters: m0,me,k
m0, me check "Fixed" checkboxes Function Body: me+(m0-me)*exp(-k*t)
On next page, set as follows

Click Finish to finish the creation.
Now fit should work.
Thanks, Snow |
 |
|
dominik.mierzwa
Poland
119 Posts |
Posted - 05/25/2023 : 02:51:32 AM
|
quote: Originally posted by snowli
Hello,
Since u want m0 and me to be max and min of y data, u will have to set them as parameter instead of constantso that u can use initial formula feature of Origin. https://blog.originlab.com/use-initial-formula-to-better-guess-fitting-parameter-values-from-data
U can set them to be fixed so it's same as constant.
Here are key steps on each page when using Tools: Fitting Function Builder.
Function Type to be LabTalk Expression
independent variables: t dependent variables: m Parameters: m0,me,k
m0, me check "Fixed" checkboxes Function Body: me+(m0-me)*exp(-k*t)
On next page, set as follows

Click Finish to finish the creation.
Now fit should work.
Thanks, Snow
Hi,
It can't be so easy.... I have tried multiple options including script before and referencing to the col(B) but it does not work. Instead I should roll the manu and chose YMIN or YMAX...
Thank you very much, works perfectly!
Kind regards, Dominik |
 |
|
udhaya
India
2 Posts |
Posted - 06/14/2023 : 05:17:40 AM
|
i try to build the function of power law the equation a*[log(1/(2*3.14*f*t))]^-n +(b) with the parameters a=1,f=1,b=0,t=10^6 and n=1,2,3 it shows the values of the 0.85 nearer, in the other case with the same parameter olny the n varry to float(decimal) it not shows any out.
udhayakumars |
 |
|
YimingChen
1640 Posts |
Posted - 06/15/2023 : 09:23:11 AM
|
This is because log(1/(2*3.14*f*t)) yields a negative value, and raising a negative value to the power of 0.1156 returns NaN (Not a Number).
James |
 |
|
|
Topic  |
|
|
|