absolute value in equality constraints
Afficher commentaires plus anciens
i would like to know how to write the absolute value in equality constraints.
var10(i) = var10(i-1) + (0.5/4500) * (ABS ( 0.25*var7(i) ) ) / var9(i)
my Input(i) is a vector with the length of 350*1 with positive integer values, that are measurements of a continuous variable.
prob = optimproblem;
% equality constrainst
prob.Constraints.econs6 = optimconstr(N); %Non linear with absoulte
prob.Constraints.econs6(1) = var10(1) == (0.5*(1/4500) * abs((var7(1) *0.25))) ./ var9(1);
prob.Constraints.econs6(2:N)= var10(2:N) == var10(1:N-1) + (0.5*(1/4500) * abs((var7(2:N)*0.25))) ./ var9(2:N);
x0.var7 = zeros(size(N));
x0.var9 = zeros(size(N));
x0.var10 = zeros(size(N));
[values,fval,exitflag,output] = solve(prob,x0,'Options',options);
thanks in advance for hints.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Nonlinear Optimization dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!