Azzera filtri
Azzera filtri

How to solve these mathematical equations simultaneously?

2 visualizzazioni (ultimi 30 giorni)
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 Commento
John D'Errico
John D'Errico il 16 Dic 2017
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.

Accedi per commentare.

Risposta accettata

David Goodmanson
David Goodmanson il 17 Dic 2017
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

Più risposte (0)

Categorie

Scopri di più su General Applications in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by