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
 NLfit - building the function

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
dominik.mierzwa 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
4   L A T E S T    R E P L I E S    (Newest First)
YimingChen 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
udhaya 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
dominik.mierzwa 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
snowli 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

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