Warning: Cannot solve symbolically. Returning a numeric approximation instead.
이전 댓글 표시
Hello!
I'm trying to use the solve() function to solve a complex equation, but I can't seem to get it right. I keep getting "Warning: Cannot find explicit solution. ". This is my code:
d2=140;
d3=1200;
n3=1.445;
syms n2
ns=3.5;
lambda=600;
k2=n2.*2*pi/lambda;
k3=n3*2*pi/lambda;
delta2 = k2*d2;
delta3 = k3*d3;
M3 = [cos(delta3) (1i)*sin(delta3)/n3;(1i)*n3*sin(delta3) cos(delta3)];
M2 = [cos(delta2) (1i)*sin(delta2)/n2;(1i)*n2*sin(delta2) cos(delta2)];
M=M2*M3;
sub_vector = [1;ns];
sol=M*sub_vector;
r=(sol(1)-sol(2))/(sol(1)+sol(2));
solv = solve((abs(r))^2 == 1000,n2)
답변 (1개)
Walter Roberson
2015년 12월 21일
0 개 추천
You are rarely going to get a closed form solution to a trig function, especially one involving floating point values.
My tests suggest that n2 would have to be imaginary for the expression to equal 1000. Are you expecting an imaginary value? (I have not determined yet whether there are any solutions.)
댓글 수: 3
Walter Roberson
2015년 12월 21일
My tests show that there are an infinite number of solutions near n2 = complex(1.015,1.217)
AdamI120
2015년 12월 22일
Walter Roberson
2015년 12월 22일
No chance. If you plot abs(r)^2 over n2 = 2 to 4 you will find that it is strictly less than 1, and so cannot reach 1000. abs(r)^2 varies a fair bit but the upper limit over the real numbers is +1
In order for abs(r)^2 to reach 1000 then n2 needs to be a complex number whose real part is very close to 1.015 (narrow peak). The imaginary portion has a slightly wider range but not much.
카테고리
도움말 센터 및 File Exchange에서 Common Operations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!