フィルターのクリア

How to solve these mathematical equations simultaneously?

2 ビュー (過去 30 日間)
Luqman Saleem
Luqman Saleem 2017 年 12 月 16 日
コメント済み: Luqman Saleem 2017 年 12 月 20 日
I have three equation given as:
  1. 2*cot (theta/2) = cot (k1/2) - cot (k2/2)
  2. N*k1 = 2pi*lambda1 + theta
  3. N*k2 = 2pi*lambda2 - theta
N=0,1,2... (up to some finite integer)
lambda1=[0,1,2...N-1]
lambda2=[0,1,2...N-1]
also there is equation which says k=k1+k2=2*pi*n/N such that n=[0, 1, 2...N]
I want to find combinations of lambda1 and lambda2 which will satisfy all three equation at the same time. I also want to find values of k1 and k2 when lambda1 and lambda2 are satisfying above three equations.
Any help please.
  1 件のコメント
John D'Errico
John D'Errico 2017 年 12 月 16 日
Please don't ask the identically same question every 20 minutes. Asking it again and again will gain no better response. But it will get the duplicate questions closed.

サインインしてコメントする。

採用された回答

David Goodmanson
David Goodmanson 2017 年 12 月 17 日
Hello Luqman
Assuming N and n are set beforehand, there are four equations & five unknowns, so one of the unknowns gets to be the independent variable. It helps to pick an easy one, k1 and not theta or lambda. If you solve the first equation for theta in terms of k1, then everything else follows.
If theta is a solution, then theta +- 2*pi*m is also a solution for any integer m, so you have to decide how to deal with theta. The acot function restricts theta between -pi and pi, so if you run the initial code, you get jumps when theta goes past those boundaries. But staying within the boundaries is perfectly acceptable. If you go with the 'unwrap' line uncommented, the jumps are removed and the range of theta is larger. Valid solutions either way.
If the unwrap function is in, then theta is smooth and monotonic and you can use it as the independent variable, as in the second plot. I did not plot theta2 since theta1 + theta2 = n, making one of the two of them uninteresting. It looks like you can use lambda1 or lambda2 as the independent in some cases but not all.
If you are swapping around independent and dependent variables it helps to be dense in points. I used about a million since they're inexpensive.
N = 5;
n = 1;
k1 = 0:1e-5:8;
k2 = 2*pi*n/N -k1;
theta = 2*acot((1/2)*(cot(k1/2) - cot(k2/2)));
% theta = unwrap(theta); % comment this out, or not
lam1 = (1/(2*pi))*(N*k1-theta);
lam2 = (1/(2*pi))*(N*k2+theta);
figure(1)
plot(k1,theta,k1,lam1)
figure(2)
plot(theta,k1,theta,lam1) % use with unwrap function
  1 件のコメント
Luqman Saleem
Luqman Saleem 2017 年 12 月 20 日
hi thank you for your reply. I helped a lot

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by