You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered a problem about sosdemo2. The reason was that I made the following changes: % Constructing the vector field dx/dt = f f = [-x1^3-x1*x3^2; -sin(x2)-x1^2*x2; -x3+3*x1^2*x3-3*x3/(x3^2+1)];
I'm using a sin function here
Then I encountered an error like this, which I couldn't solve, so I asked you for help.
`Unable to convert expression containing symbolic variables into double array. Apply 'subs' function first to substitute values for variables.
Error in sym/double (line 872)
Xstr = mupadmex('symobj::double', S.s, 0);
I'm afraid SOS programming really only works when the vector field f is polynomial. There are some cases in which vector fields with trigonometric functions (such as your sin) can be represented using polynomials, using a suitable change of variables. See for example Section 3.3. in
A. Papachristodoulou, S. Prajna, "On the Construction of Lyapunov Functions using the Sum of Squares Decomposition, Proceedings of the 41st Conference on Decision and Control, 2002.
However, I'm not sure such a polynomial representation is possible for the particular example you consider.
I read the literature you provided, which means that SOSTOOL can only be used to solve polynomial problems. Therefore we need to convert non-polynomial functions into polynomial functions. For example:
y = sin(x);
y1 = x-1/6*x^3+1/120*x^5;#Taylor expansion approximation at 0 point
I understand the problem. In addition, I don’t know if you know another method, which is to use LQR to find the lyapunov function of a nonlinear system.
Hi,djagt
I encountered a problem about sosdemo2. The reason was that I made the following changes:
% Constructing the vector field dx/dt = f f = [-x1^3-x1*x3^2; -sin(x2)-x1^2*x2; -x3+3*x1^2*x3-3*x3/(x3^2+1)];
I'm using a sin function here
Then I encountered an error like this, which I couldn't solve, so I asked you for help.
`Unable to convert expression containing symbolic variables into double array. Apply 'subs' function first to substitute values for variables.
Error in sym/double (line 872)
Xstr = mupadmex('symobj::double', S.s, 0);
Error getequation (line 346)
At(:,(i-1)dimp^2+1:idimp^2) = sparse(-double(jacobian(Mivec,decvartable))');
Error sosconstr (line 104)
getequation(char(symexpr),sos.vartable,sos.decvartable,sos.varmat.vartable);
Error sosineq (line 125)
sos = sosconstr(sos,'ineq',symexpr);
Error demo2test (line 29)
prog = sosineq(prog,expr)`
Looking forward to your reply!
The text was updated successfully, but these errors were encountered: