Menu

Error in cadamtimesderiv??

Help
Cornelius
2015-02-06
2015-02-12
  • Cornelius

    Cornelius - 2015-02-06

    Hi
    I got the following Error. Do you have any idea why this error occurs?


    Call to adigator:
    Transforming user function: 'objective'
    taking derivatives wrt: 'vX_opt_centerscale'...

    Error using *
    Inner matrix dimensions must agree.

    Error in cadamtimesderiv (line 378)
    dzyR = xtemp*dyR;

    Error in / (line 177)
    Bnzlocs = cadamtimesderiv(A,x,Atemp,xtemp,Vcount,TD3,DPFLAG,'mtimes');

    Error in adigatortempfunc2 (line 87)
    xDelta_F2 = -(xR_Foot2_dqf/xM_f_wedgexR_Foot2_dqf.')\xR_Foot2_dqfxQ_f_dqs;

    Error in adigatortempfunc3 (line 142)
    [adigatorFunInfo, adigatorOutputs] = adigatortempfunc2(adigatorFunInfo, adigatorInputs);

    Error in adigatortempfunc24 (line 80)
    [adigatorFunInfo, adigatorOutputs] = adigatortempfunc3(adigatorFunInfo, adigatorInputs);

    Error in adigatortempfunc1 (line 13)
    [adigatorFunInfo, adigatorOutputs] = adigatortempfunc24(adigatorFunInfo, adigatorInputs);

    Error in adigator (line 535)
    FunctionInfo = adigatortempfunc1(FunctionInfo,UserFunInputs);

    Error in adigatorGenJacFile (line 128)
    [adiout,FunctionInfo] = adigator(UserFunName,UserFunInputs,AdiJacFileName,opts);


    Thanks for your help
    Cornelius

     
  • Matthew J. Weinstein

    Cornelius,

    It looks like matrix right divide derivative rules are messed up, I wrote all the code for left division and apparently messed up when switching. I will fix this when I get some time, but the quick fix is to use some transposes and matrix left divide. Matrix left division should work as long as it is not the underdetermined case.

    -Matt

     
  • Cornelius

    Cornelius - 2015-02-08

    Thanks. I used left divide instead of right divide and it worked.
    But I got another error in Function Printing:


    Call to adigator:
    Transforming user function: 'objective'
    taking derivatives wrt: 'vX_opt_centerscale'...
    Printing derivatives to file 'objective_ADiGatorJac'

    Warning: Valid hexadecimal digits are 0-9 and A-F.

    In adigatorVarAnalyzer at 330
    In lib\private\adigatortempfunc2 at 87
    In adigator at 658
    In adigatorGenJacFile at 128
    In objective_wrap at 40
    In fmincon at 564
    In main_flw at 209

    Cell contents reference from a non-cell array object.

    Error in cada/subsref>ForSubsRef (line 642)
    RowIndName = ADIGATORFORDATA(INNERLOC).SUBSREF(REFCOUNT).SIZES{2,1};

    Error in cada/subsref (line 27)
    [y,returnflag] = ForSubsRef(x,s);

    Error in adigatortempfunc22 (line 24)
    i = cadaforvar2(:,cadaforcount2);

    Error in adigator (line 658)
    FunctionInfo = feval(FuncCall,FunctionInfo,OverInputs);

    Error in adigatorGenJacFile (line 128)
    [adiout,FunctionInfo] = adigator(UserFunName,UserFunInputs,AdiJacFileName,opts);


     

    Last edit: Cornelius 2015-02-09
  • Matthew J. Weinstein

    Cornelius,

    I am not sure what is causing this issue - looks like it is occurring on the entrance to an embedded loop on the printing pass... The only thing I can think of is if you have an embedded loop which never runs for any iterations (i.e. for i = 1:0), then it may produce this error. If you want, you can send me the code and I will take a look at it.

    -Matt

     
  • Matthew J. Weinstein

    Oh, I also reworked the mrdivide, should be working properly now. See attached.

     
  • Cornelius

    Cornelius - 2015-02-12

    I appreciate your help very much, knowing that you don't have much time at the moment.
    I attached the file "perorb_flw_math" wich is a function in my objective file. In this function I use "cumtrapz_el" wich replaces "cumtrapz". I also attatched the tempfunc generated by adigater wich is mentioned in the error report.
    It seems like your tool stops working when it comes to the for loop in my cumtrapz_el function.

     
  • Matthew J. Weinstein

    This is quite strange, I cannot reproduce the error by calling cumtrapz_el, and am not sure why this ADIGATORFORDATA(INNERLOC).SUBSREF(REFCOUNT).SIZES field is an array. Seeing as I can't reproduce the error it might be something high level. If you can somehow recreate the error or send me some code that I can produce the error with, I can likely hunt it down much easier.

     

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.