Conversion to logical from symfun is not possible
Show older comments
How to fix this error: Conversion to logical from symfun is not possible ?
Code:
syms s eqn1 eqn2 eqn3;
kp = sym('kp','real');
ki = sym('ki','real');
kd = sym('kd','real');
w = sym('w','real');
i0 = 1;
i1 = 1;
i2 = 1;
eqn1 = (subs(V_jw_even,w,0))*i0 > 0;
eqn2 = (subs(V_jw_even,w,w_roots))*i1 > 0;
eqn3 = (subs(V_jw_even,w,inf))*i2 > 0;
% [ V_jw_even] is a symbolic polynomial. V_jw_even = (- kd - 1)*w^4 + (ki - 9*kd + 17)*w^2 + 9*ki
% [w_roots] is a real and positive root . w_roots ~= 1.4638
% Define o passo de busca para x e y
step = 0.5;
solution_found = false;
% Enquanto a solução ainda não foi encontrada
for ki = x_min:step:x_max
for kd = y_min:step:y_max
% Verifica se as inequações são satisfeitas para os valores atuais de x e y
solution_found = eqn1 && eqn2 && eqn3;
if solution_found
fprintf('Solucao encontrada: x = %.2f, y = %.2f\n', ki, kd);
solution_found = true;
end
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Symbolic Math Toolbox 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!