how to set additional constraints on parameters in lsqcurvefit

7 views (last 30 days)
I have a successful lsqcurvefit optimization working from using the example of Monod kinetics optimization. I have set upper and lower bounds that work just fine, however I am trying to add an additional constraint. For example I have:
A<->B+H with ka being the forward rate and kb the reverse rate.
I know the value:
K=10^-7.5=ka/kb
Even though I know the ratio of these two numbers (ka/kb), there are numerous numbers that they individually could be. I need to optimize them to fit my data, so is there any way to add in the constraint so that their ratio is always the same? Thanks!

Answers (2)

Torsten
Torsten on 11 Nov 2015
Sure. Use only one parameter (e.g. kb) instead of two (ka and kb) and write kb*10^(-7.5) everywhere for ka in your code.
Best wishes
Torsten

Star Strider
Star Strider on 11 Nov 2015
I’m happy that ‘Monod kinetics and curve fitting’ is working for you!
I know of no way of constraining them specifically with lsqcurvefit. There are other minisation functions you could use that might permit that, but probably the easiest is to define
kb = ka*10^7.5;
wherever kb appears in your code, rather than defining it independently.
  2 Comments
emm252
emm252 on 11 Nov 2015
would a different optimization methods maybe like fmincon allow such a constraint?
Star Strider
Star Strider on 11 Nov 2015
Probably, though I haven’t looked. This is the easiest method, and will work with lsqcurvefit, so you only have to make one change in your code.
If you want to use one of the other solvers, see Optimizing a Simulation or Ordinary Differential Equation. I have no personal experience with the other solvers and differential equations, only lsqcurvefit. I will help as I can.

Sign in to comment.

Categories

Find more on Systems of Nonlinear Equations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!