Hey all, I've been performing some calculations with Matlab, and I've been getting unexpected results. I've been trying to calculate reflectance (R) of materials using this Fresnel equation:
R=(((n0-(n-1i.*k))./(n0+(n-1i.*k)))+(((n-1i.*k)-(n2-1i.*k2))./((n-1i.*k)+(n2-1i.*k2))).*(exp(-2.*1i.*(2.*pi./y).*(n-1i.*k).*120))./(1+((n0-(n-1i.*k))./(n0+(n-1i.*k))).*(((n-1i.*k)-(n2-1i.*k2))./((n-1i.*k)+(n2-1i.*k2))).*(exp(-2.*1i.*(2.*pi./y).*(n-1i.*k).*120))))
But all the answers I'm getting aren't what they should be (we're running a test with known values. If you want to give it a try, the values that we're currently using are as follows:
y = 250
n0 = 1
n = 1.61
k = 0
n2 = 1.69
k2 = 3.67
R = .5 (or somewhere around there)
But the answer I get is R = .092.
So, is Matlab incapable of performing such a calculation, or is there something that I can do differently go get this to work? I'd love to hear your thoughts on this one.
Thanks.

 채택된 답변

John D'Errico
John D'Errico 2012년 2월 15일

0 개 추천

Is it incapable? No. Have you written it out correctly? How can we even guess? What are the odds that as long a line as that, you have made a typo? I will point out that you do NOT get 0.092. You get a complex result.
R = 0.092354 - 0.74233i
My guess is you have a typo.

댓글 수: 3

Alex
Alex 2012년 2월 15일
I've check the equation, I've had another person double check the equation. We've checked every mathematical relation withing as well as all the parenthesis. Everything should be working out. Since this is a physical property we're calculating, there shouldn't be an imaginary component, and yet there is one. Looking at the equation, I was confused as to why there wouldn't be one, but I was told that it was fine. Let me look for different equations. And yes, I know it's hard to take the equation itself at face value.
Alex
Alex 2012년 2월 15일
After taking the complex conjugate of the answer, we've gotten the proper results. So, the answer and the code were both correct after all, we were just missing the extra step. Thanks for checking it out.
Walter Roberson
Walter Roberson 2012년 2월 15일
complex conjugate, or the magnitude?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

질문:

2012년 2월 15일

편집:

2013년 10월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by