Error when using Continuous Function and adigator version of Interp2
A MATLAB Automatic Differentiation Tool
Brought to you by:
anilvrao2,
weinstein87
I'm receiving the following error when using the adigatorGenInterp2pp and adigatorEvalInterp2pp to handle table data, and a continuous function that is being fed into GPOPS.
**Index exceeds matrix dimensions.
Error in adigator (line 337)
FlowInfo.Children = TempFlowInfo(1:InnerCount);
Error in adigatorGenFiles4gpops2 (line 204)
adigator(ContFunc,{cinput},ContDeriv1,ADopts);
Error in adigatorCheck (line 59)
F = adigatorGenFiles4gpops2(setup);
Error in UnpoweredGlideMain (line 194)
setup = adigatorCheck(setup);**
The function [,] = aero(mach, alpha, aux) is inside of the continuous function. Inside of the aero function, the following functions are called to do a linear interpolation on table data.
ppCl = adigatorGenInterp2pp(aero.Mach,aero.Alpha,aero.Cl,method);
Cl = adigatorEvalInterp2pp(ppCl,Mach,Alpha);
ppCd= adigatorGenInterp2pp(aero.Mach,aero.Alpha,aero.Cd,method);
Cd= adigatorEvalInterp2pp(ppCd,Mach,Alpha);
The same error does not occur when I create a polynomial via the curvefit toolbox and use the function [,] = aero(mach, alpha, aux) inside of the continuous function.
Hi,
Sorry for the delay on this. I think the issue is that you are using adigatorGenInterp2pp inside of the function to be differentiated. The routine is meant to be called outside of the function to be differentiated, and the resulting 2d poly passed in as auxiliary data.
Matt