Menu

ADiGator-GPOPS-II-Static parameters

Help
2015-03-17
2015-03-17
  • Antoine Falisse

    Antoine Falisse - 2015-03-17

    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

     
    • Matthew J. Weinstein

      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:

      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

      ADiGator-GPOPS-II-Static parameters
      https://sourceforge.net/p/adigator/discussion/help/thread/aeb38dec/?limit=25#b7af


      Sent from sourceforge.net because weinstein87@gmail.com is subscribed to
      https://sourceforge.net/p/adigator/discussion/help/

      To unsubscribe from further messages, a project admin can change settings
      at https://sourceforge.net/p/adigator/admin/discussion/forums. Or, if
      this is a mailing list, you can unsubscribe from the mailing list.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.