Solving complex linear equations with conjugate operations
Show older comments
Consider the following equations:
Assuming
and
, substitute them to equations
The real parts and imaginary parts correspondingly equate:

Regarding
as unknowns, rearrange to obtain the linear system form
.

The result is (using
):
My questions:
1. For complex linear equations involving conjugate operations, is it necessary to calculate them separately?
2. This is just an example. I intend to use this approach to address other similar systems of complex linear equations. In my calculations for other instances, I found the determinant of
to be 1e-6, approximately zero. How should I handle this to ensure the accuracy of the equation solutions?
My MATLAB code is attached below.
clc;clear;close all;
%% Set a question
z_1_true=4+2i;%The true value of z1
z_2_true=5+3i;
ee1=z_1_true+z_2_true;%Constant term
ee2=conj(z_1_true)+2*z_2_true-z_1_true;
%% taking the real part and the imaginary part respectively, twice the number of equations
syms z_1 [2 1] real%z1
syms z_2 [2 1] real%z2
z1_com=z_1(1)+1i*z_1(2);%z1_com represents the complex form of z1
z2_com=z_2(1)+1i*z_2(2);
eqns2_com=[z1_com+z2_com-ee1;
conj(z1_com)+2*z2_com-z1_com-ee2];%Construct complex equation
eqns2=[real(eqns2_com)==0;imag(eqns2_com)==0];%Taking the real part and the imaginary part
vars=[reshape(z_1,1,2),reshape(z_2,1,2)];%The variables need to be solved
[A2,b2] = equationsToMatrix(eqns2,vars);%Extract the A and b matrices
Sol2=double(A2)\double(b2);%calculation method
z1_sol2=Sol2(1)+1i*Sol2(2);z2_sol2=Sol2(3)+1i*Sol2(4);
E11=z1_sol2+z2_sol2-ee1;
E22=conj(z1_sol2)+2*z2_sol2-z1_sol2-ee2;
disp('Solve separately:');
disp(['true value of z1:', num2str(z_1_true),',result:',num2str(z1_sol2),',Error of first equation:',num2str(E11)]);
disp(['true value of z2:', num2str(z_2_true),',result:',num2str(z2_sol2),',Error of second equation:',num2str(E22)]);
Accepted Answer
More Answers (0)
Categories
Find more on Linear Algebra 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!