Menu

Error from adigatorPrintTempFiles

Help
2015-07-28
2015-07-30
  • Allison Kinney

    Allison Kinney - 2015-07-28

    I have code that worked with a previous version of ADiGator (v0.4) and I am attempting to upgrade the code to work with the current version of ADiGator (v1.1). However, when I try to generate the files for GPOPS II in v1.1, I receive the error below from adigatorPrintTempFiles. Any guidance would be helpful. I can attach/send my files, if needed.

    Thank you,

    Allison Kinney

    Call to adigator:
    Transforming user function: 'Endpoint_SCModel'
    taking derivatives wrt: 'v'...
    Printing derivatives to file 'Endpoint_SCModelADiGatorGrd'
    Successfully transformed user function 'Endpoint_SCModel' to derivative function 'Endpoint_SCModelADiGatorGrd'
    Total file generation time: 1.8174
    Error using evalin
    Undefined function or variable 'BroCount'.

    Error in adigatorPrintTempFiles>PrintTemp (line 342)
    BroCount = evalin('caller','BroCount');

    Error in adigatorPrintTempFiles (line 33)
    PrintTemp(Ffid,StartLocation,EndLocation,Tfid,indent,FunStrChecks,DerNumber);

    Error in adigator (line 411)
    [ForCount,IfCount] = adigatorPrintTempFiles(FunctionInfo(Fcount).File.fid,Tfid,...

    Error in adigatorGenFiles4gpops2 (line 204)
    adigator(ContFunc,{cinput},ContDeriv1,ADopts);

     
  • Matthew J. Weinstein

    Hi Allison,

    That is odd. The error seems to be occurring due to an error statement placed directly in a flow control construct which is not an if statement. For instance, I could see this type of routine causing the error:

    if badthing
    myerrorroutine()
    end

    function myerrorroutine()
    error(...)
    end

    In which case you could remedy the situation by placing the error statement directly within the if statement. Do you have something like this in your code?

    What is strange is that the only thing which has changed (from 0.4 to 1.1) regarding this section of code is that it now looks for "error (" (with the space) as well as "error(", where it only used to look for "error(", but "error (" used to be produce a different error.

    -Matt

     
  • Allison Kinney

    Allison Kinney - 2015-07-30

    Hi Matt,

    Thanks for the hint about an error statement. I didn't actually have an error function in my code, but a variable called error (bad MATLAB programming on my part to have a variable with the same name as a MATLAB function). So, the change to search for error with the space actually found my variable named error. I've changed the variable name and now everything works with v1.1.

    Thanks!

    Allison

     

    Last edit: Allison Kinney 2015-07-30

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.