How to plot and find zeros of a complex polynomial?
2 ビュー (過去 30 日間)
古いコメントを表示
Given any complex polynomial, how to find and plot zeros in a complex plane? Here are a few examples what kind of plot i want...


0 件のコメント
回答 (1 件)
Sam Chak
2025 年 2 月 25 日
Hi @simran
I am unsure whether a symbolic approach exists. However, to use the fsolve() function, you need to provide initial guesses, which I have roughly estimated based on your image.
% Complex polynomial
function F = complexPolynomial(z)
F(1) = z(1)^5 + 1.2*conj(z(1))^4 - 1; % Real part
F(2) = imag(z(1)); % Imaginary part
end
% Initial guesses for z
initial_guesses = [1.0 + 0.0i;
-1.0 - 1.0i;
-1.0 + 1.0i;
0.6 - 1.2i;
0.6 + 1.2i;
1.0 - 0.3i;
1.0 + 0.3i];
% For storing solutions
solutions = [];
% Solve using fsolve for each initial guess
options = optimoptions('fsolve', 'Algorithm', 'levenberg-marquardt', 'Display', 'off');
for i = 1:length(initial_guesses)
z0 = initial_guesses(i);
solution = fsolve(@complexPolynomial, z0, options);
% Check if the solution is unique
if all(abs(solutions - solution(1)) >= 1e-6) % Tolerance for uniqueness
solutions = [solutions; solution(1)];
end
end
disp('Solutions:');
disp(solutions);
% Plot
G = zpk([], solutions, 1);
pzmap(G), grid on
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!