[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63858] fmincon fails in Octave 7.1.0, but not
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #63858] fmincon fails in Octave 7.1.0, but not Octave 6.3 |
Date: |
Wed, 1 Mar 2023 17:00:58 -0500 (EST) |
URL:
<https://savannah.gnu.org/bugs/?63858>
Summary: fmincon fails in Octave 7.1.0, but not Octave 6.3
Group: GNU Octave
Submitter: None
Submitted: Wed 01 Mar 2023 10:00:56 PM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: 7.1.0
Discussion Lock: Any
Operating System: GNU/Linux
Fixed Release: None
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Wed 01 Mar 2023 10:00:56 PM UTC By: Anonymous
Hi,
In the code below, I use fmincon for non-linear optimization. The code seems
to work in Octave 6.3, but hits the following error in 7.1.0:
error: @<anonymous>: function called with too many inputs
error: called from
@<anonymous>
__dfdp__ at line 304 column 15
fmincon>@<anonymous> at line 385 column 26
__jacobian_constants__>@<anonymous> at line 135 column 11
__octave_sqp_wrapper__>@<anonymous> at line 61 column 19
sqp at line 364 column 7
__octave_sqp_wrapper__ at line 76 column 60
fmincon at line 451 column 24
test_fmincon at line 35 column 22
Do you know what might be the problem? Does the functionality of fmincon
change with newer versions of Octave?
clear
pkg load optim
function alpha=alpha_poly(beta,mgn,msn,Lpn)
betapol=[beta;0];
K=length(beta);
mgn=mean(mgn); msn=mean(msn); Lpn=mean(Lpn,1);
Hn=0;
for k=1:K
j=K+1-k;
Hn=Hn+beta(j)*((msn+log(Lpn)).^k-msn.^k);
endfor
Hn=log(0.01*sum(exp(Hn).*Lpn,2));
alpha=mgn-msn-polyval(betapol,msn)-Hn;
endfunction
function S=objfun_g(beta,mgn,msn,Lpn,param)
A=param(1); B=param(2);
alpha=A+B*beta;
S=alpha-alpha_poly(beta,mgn,msn,Lpn);
S=S'*S;
endfunction
mg = 8.2141
ms = 7.3109
Lps =[ 0.061017 0.065218 0.076858 0.088419 0.099907 0.11133 0.12269
0.13399 0.14525 0.15646 0.16762 0.17876 0.18987
0.20095 0.21201 0.22306 0.23409 0.24513 0.25616
0.2672 0.27825 0.28931 0.30039 0.3115 0.32264
0.33381 0.34502 0.35628 0.36759 0.37895 0.39037 0.40187
0.41343 0.42508 0.43681 0.44863 0.46056 0.47258 0.48473
0.49699 0.50938 0.52191 0.53458 0.54741 0.5604
0.57357 0.58692 0.60047 0.61423 0.6282 0.64241
0.65687 0.67159 0.68659 0.70189 0.71751 0.73346
0.74976 0.76645 0.78354 0.80107 0.81905 0.83753 0.85654
0.87612 0.8963 0.91715 0.93869 0.961 0.98414 1.0082
1.0332 1.0593 1.0865 1.115 1.1449
1.1764 1.2096 1.2447 1.2819 1.3216 1.3639
1.4094 1.4585 1.5117 1.5697 1.6334 1.7039
1.7826 1.8714 1.9729 2.0907 2.2299 2.3985
2.6092 2.8842 3.2668 3.8574 4.9767
14.11 ]
params = [1.2235; -6.9294]
b0 = .2564
alpha_star=[]; beta_star=[];
options=optimset('Algorithm','octave_sqp');
[beta_star,f_star,e]=fmincon(@(beta)
objfun_g(beta,mg,ms,Lps,params),b0,[],[],[],[],-1,10,[],options);
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63858>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #63858] fmincon fails in Octave 7.1.0, but not Octave 6.3,
anonymous <=
- Message not available
- [Octave-bug-tracker] [bug #63858] fmincon fails in Octave 7.1.0, but not Octave 6.3, Nicholas Jankowski, 2023/03/01
- [Octave-bug-tracker] [bug #63858] fmincon fails in Octave 7.1.0, but not Octave 6.3, Markus Mützel, 2023/03/02
- [Octave-bug-tracker] [bug #63858] [octave forge] (optim) fmincon fails in Octave 7.1.0, but not Octave 6.3, Markus Mützel, 2023/03/02
- [Octave-bug-tracker] [bug #63858] [octave forge] (optim) fmincon fails in Octave 7.1.0, but not Octave 6.3, Markus Mützel, 2023/03/02
- [Octave-bug-tracker] [bug #63858] [octave forge] (optim) fmincon fails in Octave 7.1.0, but not Octave 6.3, Rik, 2023/03/06
- [Octave-bug-tracker] [bug #63858] [octave forge] (optim) fmincon fails in Octave 7.1.0, but not Octave 6.3, Nicholas Jankowski, 2023/03/06
- [Octave-bug-tracker] [bug #63858] [octave forge] (optim) fmincon fails in Octave 7.1.0, but not Octave 6.3, Rik, 2023/03/06
- [Octave-bug-tracker] [bug #63858] [octave forge] (optim) fmincon fails in Octave 7.1.0, but not Octave 6.3, Rik, 2023/03/06