How to use function int() in objective function

28 views
Skip to first unread message

POLLY

unread,
Sep 16, 2014, 4:46:03 AM9/16/14
to yal...@googlegroups.com
Hello,

I'm a beginner of yalmip and I hope that you can spare your valuable time to help me solve the problem.  

Recently,I am writing an objective function which contains function int() which is attached below:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
p=sdpvar(1,1);
syms x
Objective=int(p*x,x,1,2);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


and the problem is:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Error using sdpvar/subsref (line 180)
Undefined function 'any' for input arguments of type 'sym'.

Error in coefficients (line 60)
    allvar = depends(p(i));

Error in int_sdpvar (line 15)
    [c,v] = coefficients(f,x(i));

Error in sdpvar/int (line 33)
F = int_sdpvar(f,x,from,to);
Error in ED3_analysis (line 64)
Objective=int(p*x,x,1,2);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I have spent a lot of time but still can't figure it out.

Thanks in advance, 

Polly

Johan Löfberg

unread,
Sep 16, 2014, 4:47:45 AM9/16/14
to yal...@googlegroups.com
You cannot use sym variables in a YALMIP model

Perhaps help sdpvar/int could set you on the right track
Reply all
Reply to author
Forward
0 new messages