I'm trying to use ADiGator on my GPOPS-II optimization. I first used it with a simple code and it worked perfectly fine. I'm now trying to use it with a more complex code implying static parameters but it doesn't work and the problem seems to be due to the static parameters. Here is the error I get when I run adigatorGenFiles4gpops2(setup):
Error using cada/subsref (line 86)
Invalid vectorized subsref
Error in cadastruct/subsref (line 47)
y = subsref(y,s(dotcount+1:end));
Error in adigatortempfunc1 (line 28)
delta = input.phase.parameter(1,1);
To make things a bit clearer, in my main function I setup the bounds of my parameters as follows:
Is this in your continuous function? If so you need to access and use
parameters as if they are functions of time. So for continuous function you
do
Delta = input.phase.parameter (:,1)
Then you need to use it the same as you would state and control variables
in the continuous file. You should be doing this even with finite
differences otherwise the derivative approximation will be wrong.
Pretty sure this is the issue, can let me know if not.
I'm trying to use ADiGator on my GPOPS-II optimization. I first used it
with a simple code and it worked perfectly fine. I'm now trying to use it
with a more complex code implying static parameters but it doesn't work and
the problem seems to be due to the static parameters. Here is the error I
get when I run adigatorGenFiles4gpops2(setup):
Error using cada/subsref (line 86)
Invalid vectorized subsref
Error in cadastruct/subsref (line 47)
y = subsref(y,s(dotcount+1:end));
Error in adigatortempfunc1 (line 28)
delta = input.phase.parameter(1,1);
To make things a bit clearer, in my main function I setup the bounds of my
parameters as follows:
Hello,
I'm trying to use ADiGator on my GPOPS-II optimization. I first used it with a simple code and it worked perfectly fine. I'm now trying to use it with a more complex code implying static parameters but it doesn't work and the problem seems to be due to the static parameters. Here is the error I get when I run adigatorGenFiles4gpops2(setup):
Error using cada/subsref (line 86)
Invalid vectorized subsref
Error in cadastruct/subsref (line 47)
y = subsref(y,s(dotcount+1:end));
Error in adigatortempfunc1 (line 28)
delta = input.phase.parameter(1,1);
To make things a bit clearer, in my main function I setup the bounds of my parameters as follows:
% Static parameters bounds
bounds.parameter.lower = [deltamin, phimin, gammamin, lTs_lMo_min];
bounds.parameter.upper = [deltamax, phimax, gammamax, lTs_lMo_max];
and I try to access them in my continuous function as follows:
% Access static parameters
delta = input.phase.parameter(1,1);
phi = input.phase.parameter(1,2);
gamma = input.phase.parameter(1,3:NMuscles_optimized+2);
lTs_lMo = input.phase.parameter(1,NMuscles_optimized+3:end);
It worked fine when I was using the SparseCD derivatives supplier but no longer with ADiGator...
Any help would be great. I can attach my codes or give more details if needed,
Many thanks for helping,
Antoine Falisse
Hi Antoine,
Is this in your continuous function? If so you need to access and use
parameters as if they are functions of time. So for continuous function you
do
Delta = input.phase.parameter (:,1)
Then you need to use it the same as you would state and control variables
in the continuous file. You should be doing this even with finite
differences otherwise the derivative approximation will be wrong.
Pretty sure this is the issue, can let me know if not.
-Matt
On Mar 17, 2015 12:40 PM, "Antoine Falisse" antoinefalisse@users.sf.net
wrote: