Author |
Topic  |
|
ErdemG
Germany
7 Posts |
Posted - 07/10/2018 : 10:43:16 AM
|
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
|
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 |
 |
|
ErdemG
Germany
7 Posts |
|
Hideo Fujii
USA
1582 Posts |
Posted - 07/10/2018 : 12:34:55 PM
|
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 |
 |
|
ErdemG
Germany
7 Posts |
Posted - 07/10/2018 : 1:05:42 PM
|
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 |
 |
|
Hideo Fujii
USA
1582 Posts |
Posted - 07/10/2018 : 2:13:39 PM
|
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 |
 |
|
ErdemG
Germany
7 Posts |
Posted - 07/10/2018 : 4:06:26 PM
|
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? |
 |
|
Hideo Fujii
USA
1582 Posts |
Posted - 07/11/2018 : 11:58:09 AM
|
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 |
 |
|
|
Topic  |
|