Probleme d'optimisation

Fermé
ASIL - 22 janv. 2013 à 12:17
Bonjour,
mon code est comme suit: fonction objective

function J = myfunobj(v)
a=0;
b=1;
mu=1;
v=(1:10)';
n=length(v);
h=(b-a)/(n+1);
x1=2*ones(n,1);
x2=ones(n-1,1);
Ah=1/h*(diag(x1,0)-diag(x2,1)-diag(x2,-1));
y1=2*v.*v;
y2=1/2*(v(1:n-1).*v(2:n)+v(1:n-1).^2 +v(2:n).^2);
Mh=h/5*(diag(y1,0)+diag(y2,1)+diag(y2,-1));
J=1/2*dot(Ah*v,v)+mu*1/4*dot(Mh*v,v);
end

mon fonction contrainte est:

function[Ceq,C]=myfuncon(v)
a=0;
b=1;
v=(1:10)';
n=length(v);:
h=(b-a)/(n+1);
z1=ones(n,1);
z2=ones(n-1,1);
Bh=h/6*(4*diag(z1)+diag(z2,1)+diag(z2,-1));
Ceq =dot(Bh*v,v)-1;
C=[];
end

maintenant la fonction fmincon est:

%chercher le minimum de J avec contrainte d'égalité
J=myfunobj(v);
[Ceq,C]=myfuncon(v);

[u]= fmincon(@myfunobj,v0,[],[],[],[],[],[],@myfuncon);


mais quand je fais la compilation le resultat est comme suit:
Warning: Trust-region-reflective algorithm does not solve this type of problem, using active-set algorithm. You could also try the interior-point or sqp algorithms:
set the Algorithm option to 'interior-point' or 'sqp' and rerun. For more help, see Choosing the Algorithm in the documentation.
> In fmincon at 472

No feasible solution found.

fmincon stopped because the size of the current search direction is less than
twice the default value of the step size tolerance but constraints are not
satisfied to within the default value of the constraint tolerance.

<stopping criteria details>


u =

0 0 0 0 0 0 0 0 0 0
S'IL VOUS PLAIS AIDEZ MOI POUR RESOUDRE CET PROBLEME.
ET MERCI