Conversion to logical from symfun is not possible
古いコメントを表示
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
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!