Borrar filtros
Borrar filtros

How to solve 2 systems of linear equations with complex numbers

16 visualizaciones (últimos 30 días)
Tawhid Khan
Tawhid Khan el 1 de Abr. de 2019
Comentada: Stephen Everett el 27 de Oct. de 2020
I am trying to solve these two equations where A and B are the variables:
A(-5E-4i)+B(.00166+5E-4i) = 0
A(.003+5E-4i)+B(-5E-4i)= .01
So far I tried this code but its not working:
Capture.PNG

Respuestas (2)

Matt J
Matt J el 1 de Abr. de 2019
Editada: Matt J el 1 de Abr. de 2019
There's no need to solve symbolically:
Matrix= [(-5E-4i),(.00166+5E-4i);...
(.003+5E-4i),(-5E-4i)];
AB=Matrix\[0;0.01]
AB =
3.1201 - 0.4558i
0.3854 + 0.8237i

madhan ravi
madhan ravi el 1 de Abr. de 2019
Editada: madhan ravi el 1 de Abr. de 2019
https://in.mathworks.com/help/symbolic/solve.html - single quotes were removed in the newer releases, the thing was to use syms to declare variables. The alternative is to use https://in.mathworks.com/help/matlab/ref/mldivide.html exactly as Matt showed below.
syms A B
e1 = A*(-5E-4i)+B*(.00166+5E-4i) == 0;
e2 = A*(.003+5E-4i)+B*(-5E-4i) == .01;
[A,B]=vpasolve(e1,e2)
Gives:
A =
3.1200854799813426046914748274026 - 0.45578296553343941143195508992931i
B =
0.38538768678070613609974428782671 + 0.82370415457850496041919594565537i

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by