필터 지우기
필터 지우기

Solving Complex Equations Using "fmincon"

조회 수: 24 (최근 30일)
Ceyhan TURKMEN
Ceyhan TURKMEN 2020년 12월 4일
답변: Alan Weiss 2020년 12월 7일
Hello all, sorry if it is a dumb question I am new to optimization. I am trying to solve a complex equation system using fmincon. I have 3 equations and my objective function is as follows:
function Fun = ObjFun(ab)
x = ab(1:3) + ab(4:6) * 1i;
Eqs = [...Equations...]
Fun = [real(Eqs); imag(Eqs)];
end
I am getting 6 values. Are the first 3 values real and the last 3 values are imaginary parts? I can't be sure. I want to form a+bi representation. My second question is: should I use polar coordinates (x = ab(1:3) .* exp(ab(4:6) * 1i)) inside the function to create complex values from real and imaginary parts (instead of x = ab(1:3) + ab(4:6)*1i)? Thanks for the help.

채택된 답변

Alan Weiss
Alan Weiss 2020년 12월 7일
I don't understand why you are trying to use fmincon to solve systems of nonlinear equations. Use fsolve for that. And then you get the bonus that fsolve can handle complex variables. See Complex Numbers in Optimization Toolbox Solvers.
Alan Weiss
MATLAB mathematical toolbox documentation

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by