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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Limiting Non-Linear Fit Function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

esacay

Canada
1 Posts

Posted - 10/29/2013 :  8:48:01 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin 9.0.0. B45
Windows 7

I am trying to fit a collection of data points using the NLFit dialog. The overall function that I need to use is a sum of 3 separate functions [F(x) = A(x)+B(x)+C(x)]. How do I specify that one of my separate functions is only included to a certain point? ie.

B(x) = N*exp[(x-x0)/B)], for x<x0
B(x) = 0, for x>= x0


ES

Hideo Fujii

USA
1582 Posts

Posted - 10/30/2013 :  09:51:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi esacay,

You can use the conditional operator which has the following syntax:
<CONDITION>?<VALUE_ON_TRUE>:<VALUE_ON_FALSE>
http://wiki.originlab.com/~originla/ltwiki/index.php?title=LabTalk:Operators#Conditional_Operator_.28.3F:.29

So, in your case:
B(x)=x<x0?N*exp((x-x0)/B0)):0;
Note: I have changed the parameter B to B0 as it conflicts with the function name.

--Hideo Fujii
OriginLab


Edited by - Hideo Fujii on 10/30/2013 09:54:34 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000