pheidlauf / AeroBenchVV

Simulation and analysis tools for autonomous F-16 maneuvers as a V&V benchmark
GNU General Public License v3.0
63 stars 22 forks source link

trimmerFun ignores initial guesses #1

Closed stanleybak closed 6 years ago

stanleybak commented 6 years ago

trimmerFun gets called with 5 arguments from RunF16Sim.

The code starts out with:

if(nargin==2)
    x=Xguess;
    u=Uguess;
elseif(nargin<5)
    printOn = 0;
else
    x=zeros(13,1);
    u=zeros(4,1);
end

The 'else' case gets used, which means the initial guess gets ignored. This should be changed.

pheidlauf commented 6 years ago

The code was corrected as shown.

if(nargin>=2)
    x=Xguess;
    u=Uguess;
else
    % If called with insufficient args
    warning('Defaulting to zero states for initial trim guess');
    x=zeros(13,1);
    u=zeros(4,1);
end

if(nargin<5)
    printOn = 0;
end