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 for Programming
 LabTalk Forum
 NonLinear Curve fitting
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cosy

Germany
Posts

Posted - 11/29/2006 :  12:16:45 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (OriginPro 7):
Operating System:XP
Hi, I want to use the advanced fitting tool to fit my data to the following model (which is not predefined in the tool, and so I have to define it):
Y = P1 for X=0,
Y = Constant for X>0.
Its something like a delta function. Now how do I represent the delta function in my programs? or How do I represent this function in the fitting tool?
Regards,
Deepak Samuel

Mike Buess

USA
3037 Posts

Posted - 11/29/2006 :  12:41:08 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Deepak,

It's easiest to use the ternary operator...

y = x==0 ? 1 : 0; // delta fn: if x=0 then y=1 else y=0
y = x==0 ? P1 : CC; // your fn: if x=0 then y=P1 else y=CC (constant)

Mike Buess
Origin WebRing Member
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