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 for Programming
 Forum for Origin C
 Help: Build up the summation fitting 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
Vinh Posted - 07/28/2016 : 06:51:28 AM
Origin Ver. and Service Release (Select Help-->About Origin):
Operating System:
I can't build up this function as a fit function. Any basic help in the right direction would be appreciated. The equation is below
F(t)=B_0+∑_(i=1-n)(B_i∙e^((-t)/τ_i ))
7   L A T E S T    R E P L I E S    (Newest First)
kraamesh57 Posted - 08/07/2020 : 2:04:37 PM
Dear YimingChen
Thank you for your valuable suggestions and effort. I could use the *.py module you have sent and fit the data successfully. I am hoping that this module would be useful to others who are interested to carry out fit with an expression which includes a summation.
Regards
Ramesh
YimingChen Posted - 07/22/2020 : 4:40:04 PM
With Python's optimization package, we managed to fit your data. See attached.



James
kraamesh57 Posted - 07/22/2020 : 12:41:02 PM
Please use gi's as constants and I have given those values in the origin file.
and please assume Del = E/k_B to be consistent with the previous expression.
Regards
Ramesh
kraamesh57 Posted - 07/22/2020 : 12:28:03 PM
Dear YimingChen
Thanks for the message and making a python code for the attached expression. I have sent an origin file to the following mail id tech@originlab.com (Email heading: Attn YimingChen from Ramesh Kumar) which has two different data set that can be modelled using the attached expression. There is a slight modification from my earlier expression. The new expression contains another integer parameter (gi). I have given you a possible starting parameters. I am not using the latest version of the origin hence it would be better if your code can be implemented older version also (Origin8.6)
Thanks
Ramesh
YimingChen Posted - 07/21/2020 : 3:06:46 PM
Hi Ramesh,

We did manage to build your fitting function using Python in Origin. Basically ni's in the fitting function can be passed as a vector into the fitting algorithm and generate the fitting result. Would you mind sending your data to <tech@originlab.com> and we can test further? Also I coded the script in our recently released Origin2021 beta2 version. Would you like to test in beta2 as well? Please let us know.

James
kraamesh57 Posted - 07/21/2020 : 07:56:23 AM
Hi Yuki Wu,
I am looking to fit an expression which involves summation. The expression is attached to this message. I am not able to find a solution even after reading many threads.
In the above post, the fitting parameter B_i and tau_i lie inside the summation but you have treated B_i and tau_i as a function. I could not understand this part why B_i is treated as a function. Since my expression contains 4 exponentials per term I am finding it difficult to write the expression. Any help to solve my problem will be greatly appreciated.
My problem
1. I need to do a fitting with summation
2. Fitting parameters ('i' number of parameters) are kept inside the summation
Please guide me on how to write the lab talk function or Origin C code.
Thanks in advance
Regards
Ramesh
yuki_wu Posted - 08/07/2016 : 11:05:40 PM
Hi,

You can define the fitting function with an embedded For loop in the function definition box.

For example,
1.Define your fitting functions in the Function edit box:

y=func3(x, B_0, n)


2.Define the functions in the LabTalk Functions Definition and Initializations box

function B_i(double t) 
{
//define your function here
}

function τ_i(double t)
{
//define your function here
}

function func3(double t , double B_0, int n)      //Summation
{
   double aa=B_0;
   for(ii=1; ii<=n; ii++)
   {
       aa = B_i*exp((-t)/ τ_i) + aa;
   }
   Return aa
}


Hope it helps.

Yuki
OriginLab

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