Nonlinear least-squares fitting using lsqnonlin with linear inequality

Dear community,
I am using lsqnonlin to fit my data using the following model:
f = (A*ones(1,size(X,2))).* (B1.*exp( -(u1.*p + u2) * ones(1,size(X,2)).*X) + B2.* exp( -(u1.*p + u3)*ones(1,size(X,2)).*X ) + (1-B1-B2).* exp( -(u1.*p + u4)*ones(1,size(X,2)).*X ));
where p ([11x1] matrix) and X ([11x9] matrix) are known.
A is a local parameter (hence [11x1]), whereas u1, u2, u3, u4, B1 and B2 are global parameters (scalar values).
The lower and upper bounds are as below:
Para = [u1, u2, u3, u4, B1, B2, A'];
lb = [0, 0, 0, 0, 0, 0, zeros(1,11)];
up = [Inf,Inf,Inf,Inf,1, 1, Inf*zeros(1,11)];
The problem arises because I need an additional linear inequality:
B1 + B2 <= 1
I know that lsqnonlin won't handle linear inequalities, but I am wondering if there is a trick to fit my data using lsqnonlin.
Alternatively, if anyone can recommend another fitting method, I would highly appreciate.
Thanks, Han

Answers (0)

Asked:

on 12 Apr 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!