m file per vincoli non lineari
% with the following function non linear constraints can be defined
% the name of the function is nlc_eng (non linear constraints_english)
% the function (m-file) must be saved in the current directory
function [c,ceq]=nlc(x)
% c is the expression of the nonlinear inequality constraints
% with more then 1 constraints create a new row with ;
% if the constraint is not present write c=[]
%%c=[];
c=[x(2)^2+5*x(1)^2-8];
% ceq is the expression of the nonlinear equality constraints
% with more then 1 constraint create a new row with ;
% if the constraint is not present write ceq=[]
ceq=[x(2)-2*x(1)^4];
% with the following function non linear constraints can be defined% the name of the function is nlc_eng (non linear constraints_english)% the function (m-file) must be saved in the current directoryfunction [c,ceq]=nlc_eng(x)% c is the expression of the nonlinear inequality constraints% with more then 1 constraints create a new row with ;% if the constraint is not present write c=[]%%c=[];c=[x(2)^2+5*x(1)^2-8];% ceq is the expression of the nonlinear equality constraints% with more then 1 constraint create a new row with ;% if the constraint is not present write ceq=[]ceq=[x(2)-2*x(1)^4];
16 novembre 2022