help-octave
[Top][All Lists]

## help needed with nonlinear inequality constraints (optimset "inequc") fo

 From: Philippe Dobbelaere Subject: help needed with nonlinear inequality constraints (optimset "inequc") for nonlin_residmin in optim package Date: Fri, 16 Feb 2018 12:49:23 +0100 User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

```I am using nonlin_residmin (optim 1.5.2) with fixed upper and lower
bounds on the parameters. Now I want to introduce non-linear inequality
constraints.

I was assuming

# working if I do not use inequc below
settings = optimset(settings, 'lbound', lb' , 'ubound', ub');

settings = optimset (settings, "inequc", address@hidden);

with

function H = nonlinear_ineq_constraints(x)
h0 = 1 - get_ic0(x)^2 - get_jc0(x)^2 - get_kc0(x)^2; # >= 0
h1 = 1 - get_ic1(x)^2 - get_jc1(x)^2 - get_kc1(x)^2; # >= 0
h2 = 1 - get_ic2(x)^2 - get_jc2(x)^2 - get_kc2(x)^2; # >= 0
H = [h0;h1;h2];
endfunction

would do it, but I keep getting

error: number of columns must match
error: called from
__nonlin_residmin__> at line -1 column -1
__nonlin_residmin__> at line -1 column -1
__nonlin_residmin__> at line -1 column -1
__lm_svd__ at line 181 column 6
__nonlin_residmin__ at line 1133 column 21
nonlin_residmin at line 98 column 21
solve1.m at line 419 column 29
error: evaluating argument list element number 2
error: called from
__nonlin_residmin__> at line -1 column -1
__nonlin_residmin__> at line -1 column -1
__nonlin_residmin__> at line -1 column -1
__lm_svd__ at line 181 column 6
__nonlin_residmin__ at line 1133 column 21
nonlin_residmin at line 98 column 21
solve1.m at line 419 column 29
error: evaluating argument list element number 4
error: called from
__nonlin_residmin__> at line -1 column -1
__nonlin_residmin__> at line -1 column -1
__nonlin_residmin__> at line -1 column -1
__lm_svd__ at line 181 column 6
__nonlin_residmin__ at line 1133 column 21
nonlin_residmin at line 98 column 21
solve1.m at line 419 column 29
error: evaluating argument list element number 3
error: called from
__nonlin_residmin__> at line -1 column -1
__lm_svd__ at line 181 column 6
__nonlin_residmin__ at line 1133 column 21
nonlin_residmin at line 98 column 21
solve1.m at line 419 column 29

the error is thrown when executing

dct = df_cstr (p, ac_idx, ...
setfield (dfdp_hook, "f", v_cstr));

Could someone send me a trivial working example or tell me what I am
doing wrong?

--
Philippe Dobbelaere
Bell Labs, Nokia
Contact number +32 3 240 8217

```