[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: help needed with nonlinear inequality constraints (optimset "inequc"
From: |
Olaf Till |
Subject: |
Re: help needed with nonlinear inequality constraints (optimset "inequc") for nonlin_residmin in optim package |
Date: |
Fri, 16 Feb 2018 23:55:59 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Fri, Feb 16, 2018 at 12:49:23PM +0100, Philippe Dobbelaere wrote:
> 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
>
> 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
The probable cause was a bug, simply a missing line continuation '...'
in line 970 of inst/private/__nonlin_residmin__.m . The fix is
pushed. Can you use it without a new release?
This shows that I really must include tests to prevent such things
from creeping in... I had not even a demo included for nonlinear
constraints...
BTW: In this case the problem was easy to reproduce, but in general
you should provide a minimal code for demonstration. And a newer
Octave version would also help, giving line numbers in anonymous
function definitions, not just:
> __nonlin_residmin__> at line -1 column -1
> __nonlin_residmin__> at line -1 column -1
> ...
Olaf
--
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net
signature.asc
Description: PGP signature