optimization problem - problem using det funciton
Show older comments
Hello
i'm trying to solve an optimization problem with involve calcualte the det of a matrix (here it's the temp varible).
the temp operator work for me before with optimization varibles, but now there is a problem. i think it's involve with using a non-linear optimization varibles, such as the varible F.
the error i get:
Check for missing argument or incorrect argument data type in call to function 'det'.
Error in optimization_vector_form (line 82)
prob.Objective = det(temp);
any ideas?
Thank you
clc;
clear;
close all;
Time = 100;
dt=1;
N=Time/dt;
%% Optimization problem
prob = optimproblem('ObjectiveSense','max');
%optimization varibles
omega = optimvar('omega',N,'LowerBound',w_min,'UpperBound',w_max);
T = optimvar('T',N,'LowerBound',T_min,'UpperBound',T_max);
%% Constrains
for i=1:N-1
cons1(i) = (T(i+1)-T(i))/dt >= T_dot_min;
cons2(i) = (T(i+1)-T(i))/dt <= T_dot_max;
cons3(i) = (omega(i+1)-omega(i))/dt >= omega_dot_min;
cons4(i) = (omega(i+1)-omega(i))/dt <= omega_dot_max;
end
prob.Constraints.cons1 = cons1;
prob.Constraints.cons2 = cons2;
prob.Constraints.cons3 = cons3;
prob.Constraints.cons4 = cons4;
for i=1:N-1
A(i) = omega(i)^2;
B(i) = T(i)^2;
C(i) = omega(i)*T(i);
F(i) = omega(i)^2*T(i);
G(i) = omega(i)*T(i)^2;
H(i) = omega(i)^2*T(i)^2;
end
D = sum(omega);
E = sum(T);
temp = [A.sum F.sum D C.sum;
F.sum H.sum C.sum G.sum;
D C.sum Time E;
C.sum G.sum E B.sum];
prob.Objective = det(temp);
Accepted Answer
More Answers (0)
Categories
Find more on Choose a Solver in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!