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
 Origin ignores Constraints
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ErdemG

Germany
7 Posts

Posted - 07/10/2018 :  10:43:16 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
No matter what constraints i put in my nonlinear fit (like y(5)=0.2) Origin doesn't change the fit or just tells me that it couldn't be fit. I can't possibly make it work. It's like the constraint option is just a commentar box that has no impact on anything. Anyone an idea how I can fix it?

Edited by - ErdemG on 07/10/2018 10:49:34 AM

Hideo Fujii

USA
1582 Posts

Posted - 07/10/2018 :  11:13:46 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi ErdemG,

In my understanding, the constraint in Nonlinear Curve Fitter is of the parameters - this is
the general way of handling of constraints not only in Origin.

If you meant Y=0.2 at X=5, you have to formulate a new revised function form which pass
(5, 0.2), if possible. Another "practical" workaround may be to add a data point at (5, 0.2),
and fit with weighting scheme where (5, 0.2) has an extremely higher weight than other points.

Hope I didn't misunderstand what you meant.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 07/10/2018 11:22:43 AM
Go to Top of Page

ErdemG

Germany
7 Posts

Posted - 07/10/2018 :  11:44:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

First off, thanks for the quick reply.
I used the constraint in Nonlinear Curve Fitter, yes. It worked once for a random value I tried but afterwards, it didn't anymore


What I tried to do is making the curve higher so the points outside of the current curve are closer to it.
https://media.discordapp.net/attachments/270265213746544640/466265521797464064/unknown.png
So is the constraint option useless for this or what would I have to do to fit my curve the way I want? I'm not very experienced with Origin yet, so I'm not sure how the weighting works

UPDATE: https://media.discordapp.net/attachments/270265213746544640/466273850028589056/unknown.png?width=697&height=474
It keeps telling me to check my parameter names and the syntax. Is there something wrong with the way I used the code?

Edited by - ErdemG on 07/10/2018 12:06:32 PM
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 07/10/2018 :  12:34:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi ErdemG,

The constraints in the NLFit tool must be linear, but your constraint formula,
2*(5-x0)*A/(B+A^2+(5-x0)^2)=0.4
is't linear. See the details at:
https://www.originlab.com/doc/Origin-Help/FitPara-General-Linear-Constraint

Best,

--Hideo Fujii
OriginLab

P.S. Seems that as your "constraint" is of equity, you may be able to reduce the number of parameters,
say you can replace B in terms of x0 and A.

Edited by - Hideo Fujii on 07/10/2018 12:53:07 PM
Go to Top of Page

ErdemG

Germany
7 Posts

Posted - 07/10/2018 :  1:05:42 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hideo Fujii,

I see. Thanks, that explains why it isn't working atleast. I guess weighting points is the only possible solution then.
Another question I have is, if it's possible to use constraints like A=maximal value of the curve?
becuase another condition I'd have to build in is A=yMAX*x at yMAX
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 07/10/2018 :  2:13:39 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi ErdemG,

Could you please try the following constraint?
A=max(%C)
Here, %C is the given Y dataset to be applied the Max function. In a simple trial, it seems
working (in my Origin 2018b).

--Hideo Fujii
OriginLab

P.S. Oh, sorry, this is the max of the dataset, not of the curve, though it might be acceptable
if your data points are fulfilling most of the peak area of the curve.

Edited by - Hideo Fujii on 07/10/2018 2:25:03 PM
Go to Top of Page

ErdemG

Germany
7 Posts

Posted - 07/10/2018 :  4:06:26 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hideo Fujii,

Unfortunitely the experimental data points I have deviate from the expected curve quite a bit so I can't use that. Is there another way to use a constraint involving the maximum of the fitting curve?
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 07/11/2018 :  11:58:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi ErdemG,

I'm a bit confused, but if A=yMAX*x , then A is not a parameter, but a part of the function.
So, you should be able to construct the function (e.g., as an Origin C code) accordingly, I guess.

I misunderstood something?

--Hideo Fujii
OriginLab
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