Error (Reference to non-existent field 'p'. Error in solvesos (line 125) p = everything.p;)

56 views
Skip to first unread message

Muhammad Wasim

unread,
Mar 20, 2021, 7:29:10 PM3/20/21
to YALMIP
Hi 
John i am trying to decompose the polynomial into v(x)'Qv(x) form i have written the following simple code:

dVm = - (3932700907989997*x1^2*x2^2)/73786976294838206464 - (4714943362120061*x1^2*x2^4)/295147905179352825856 - (5108447900614061*x3^2*x4^2)/147573952589676412928 - (1162816141501059*x2^2*x4^4)/18446744073709551616 - (1014430099317699*x2^4*x4^2)/18446744073709551616 - (3282433306093835*x3^2*x4^4)/295147905179352825856 - (863727308798173*x1*x2)/36893488147419103232 - (2861329002368897*x1*x2^3)/1125899906842624 - (7880766748682943*x1^3*x2)/295147905179352825856 - (391886690144623*x1*x2^5)/36893488147419103232 - (3281653193370533*x1^2)/2251799813685248 - (4912484843745425*x3^2)/2251799813685248 - (1125528341952243*x2^6)/281474976710656 - (307030302734091*x4^4)/140737488355328 - (3758901578648623*x1*x2*x3^2)/147573952589676412928 - (7025121871751591*x1*x2*x4^2)/73786976294838206464 - (2374176674933761*x1*x2*x4^4)/147573952589676412928 - (2549261596971401*x1*x3*x4)/288230376151711744;

dVm=-(1).*dVm
F=sos(dVm);
solvesos(F)

but it ends up in the error that


Reference to non-existent field 'p'.

Error in solvesos (line 125)
p = everything.p;

please guide me what should i do to correct it

Muhammad Wasim

unread,
Mar 20, 2021, 7:40:41 PM3/20/21
to YALMIP
Sorry the correct code is:
x1=sdpvar(1,1);
x2=sdpvar(1,1);
x3=sdpvar(1,1);
x4=sdpvar(1,1);

dVm = - (3932700907989997*x1^2*x2^2)/73786976294838206464 - (4714943362120061*x1^2*x2^4)/295147905179352825856 - (5108447900614061*x3^2*x4^2)/147573952589676412928 - (1162816141501059*x2^2*x4^4)/18446744073709551616 - (1014430099317699*x2^4*x4^2)/18446744073709551616 - (3282433306093835*x3^2*x4^4)/295147905179352825856 - (863727308798173*x1*x2)/36893488147419103232 - (2861329002368897*x1*x2^3)/1125899906842624 - (7880766748682943*x1^3*x2)/295147905179352825856 - (391886690144623*x1*x2^5)/36893488147419103232 - (3281653193370533*x1^2)/2251799813685248 - (4912484843745425*x3^2)/2251799813685248 - (1125528341952243*x2^6)/281474976710656 - (307030302734091*x4^4)/140737488355328 - (3758901578648623*x1*x2*x3^2)/147573952589676412928 - (7025121871751591*x1*x2*x4^2)/73786976294838206464 - (2374176674933761*x1*x2*x4^4)/147573952589676412928 - (2549261596971401*x1*x3*x4)/288230376151711744;

dVm=-(1).*dVm
F=sos(dVm);
solvesos(F)

Johan Löfberg

unread,
Mar 21, 2021, 3:28:56 AM3/21/21
to YALMIP
this error can only occur when there is something absolutely trivially non-sos. In your case it looks like highest degree in x1 is x1^3

Muhammad Wasim

unread,
Mar 21, 2021, 5:02:30 AM3/21/21
to YALMIP
Thank you so much for such a useful answer. Your answer helps me a lot. I have checked it and found that this particular polynomial is non-SOS. 
Reply all
Reply to author
Forward
0 new messages