i am writing code to optimize my onstraint in given equation.
i have this E11 and E22 values which are array of (1793*1). when i have written this function as
I am getting error that "fun should return a scalar value." i am lost here as my function is vector of (1793*1). To make it scalar do i need to use something. for now i am using "sum" for making this expression scalar. whole expression is written like
by using this i am getting solution but optimized values are way out of leak. so please help out if anyone has any experiene working with fmincon.
Another query is related to constraint. i have written them like.
nonlcon = @constraint;
A= [-1,0,0,0; 0,-1,0,0; 0,0,0,0;0,0,0,-1];
C0= [1e-5, 2e-5, 3e-5,4.5e-5];
C = fmincon(fun,C0,A,B,,,,,nonlcon)
constraint is defined as
function [c,ceq] = constraint(C)
c = -C(2)*C(4)+C(3)^2;
ceq = ;
Have i written them correctly or require some modifications?
Any help will be appreciated.