Unrecognized field name "FinDiffRelStep"

Hello everyone:
I am trying to replicate a paper from 2019, when running the fmincon optimization routine, I get the following error:
Unrecognized field name "FinDiffRelStep".
Error in finitedifferences
Error in nlconst (line 336)
finitedifferences(XOUT,funfcn{3},confcn{3},lb,ub,f, ...
Error in fmincon (line 759)
nlconst(funfcn,X,l,u,full(A),B,full(Aeq),Beq,confcn,options,defaultopt, ...
It referes to the following section of the gradient computation in the main loop:
% Compute finite difference gradients
if serialFinDiff % Call serial finite-differences code
if ~isFseminf
if DerivativeCheck || (~flags.grad && ~flags.gradconst) % No objective gradients,
% no constraint gradients
[gf,gnc(:,nonlIneqs_idx),gnc(:,nonlEqs_idx),numEvals] = ...
finitedifferences(XOUT,funfcn{3},confcn{3},lb,ub,f, ...
nc(nonlIneqs_idx),nc(nonlEqs_idx),1:numberOfVariables, ...
finDiffOpts,sizes,gf,gnc(:,nonlIneqs_idx), ...
gnc(:,nonlEqs_idx),finDiffFlags,[],varargin{:});
By setting options = optimset('Largescale','off','display','iter') in the main code "FinDiffRelStep" is generated but afterwards not recognized in nlconst. What can I do to run nlconst without FinDiffRelStep?
Thanks
Daniel

3 Comments

The MATLAB version suitable for the code does not run on your machine ?
Hello Torsten,
Yes it does, up to nlconst. In a different project we are working on we can run the fmincon optimization routine without a problem. I am using MATLABR2022a but the code was written in 2006. I am not sure if it is a version problem.
Torsten
Torsten on 17 Jan 2023
Edited: Torsten on 17 Jan 2023
What I wanted to say is: As the first option, I'd run a code for the MATLAB version it was written for instead of making modifications to the code. Usually, necessary modifications grow like a cascade.

Sign in to comment.

Answers (0)

Products

Release

R2022a

Asked:

on 17 Jan 2023

Edited:

on 17 Jan 2023

Community Treasure Hunt

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

Start Hunting!