多参数方程组求解出的结果为什么是空的?。

E1=1;
E5_=0;
syms t k a phil E1_ E2 E2_ E6 E6_ E5
eqns=[E2==t*E1+1j*k*E5_;
E5==t*E6+1j*k*E2_;
E6_==t*E5_+1j*k*E1;
E1_==t*E2_+1j*k*E6;
E6==E2*a*exp(-1j*phil);
E2_==E6_*a*exp(-1j*phil)]
[answ1,answ2] = solve(eqns,[E1_,E5])
我希望的解是E1_=2*j*t*k*a*exp(-j*phil) E5=(t^2-k^2)*a*exp(-j*phil)
但是现在代码显示的answ1 =
Empty sym: 0-by-1
answ2 =
Empty sym: 0-by-1

 采纳的回答

nipecns juenrr
nipecns juenrr 2023-3-30

0 个投票

既然只有2个未知量,那只要2个方程就好了啊,你目前的情况是方程的个数大于未知数个数,那么很多有可能增广矩阵的秩不等于系数矩阵的秩,所以无解。你要保证方程的个数等于未知数的个数,修改如下
E1=1;
E5_=0;
syms t k a phil E1_ E2 E2_ E6 E6_ E5   
eqns=[E2==t*E1+1j*k*E5_,
      E5==t*E6+1j*k*E2_,
      E6_==t*E5_+1j*k*E1,
      E1_==t*E2_+1j*k*E6,
      E6==E2*a*exp(-1j*phil),
      E2_==E6_*a*exp(-1j*phil)];
[answ1,answ2,answ3,answ4,answ5,answ6] = solve(eqns,[E1_ E2 E2_ E6 E6_ E5])

更多回答(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!

Translated by