Message Boards Message Boards

0
|
1415 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Problems evaluating & plotting a user-defined piecewise function

Posted 1 year ago

The attached worksheet attempts to calculate & plot the Fresnel reflection coefficients at the boundaries of a simple three-layer etalon cavity. The calculation & plotting at the first (external) boundary execute as expected, however, the calculation & plotting of the real & imaginary parts of the coefficients at the second (internal) cavity boundary do not return the expected values. The problem appears to be in the evaluation of the coefficient definitions, which I define in terms of a piecewise function to account for the phase changes when the AOI at the internal boundary equals or exceeds the critical angle, which I define previously. I feel like I might be missing something simple in my use of Mathematica syntax; any help is appreciated in advance. Scott

POSTED BY: Scott Milligan
4 Replies

Thank you, Gianluca,

I am tardy in my response, but your comments enabled me to track down my errors, which were indeed with my function expression, and not with my syntax. Everything is working as expected now.

Scott

POSTED BY: Scott Milligan

Your function Subscript[r, te][NDegtoRad[x]][[2]] is almost constant:

Subscript[r, te][NDegtoRad[x]][[2]]

You should review its definition.

POSTED BY: Gianluca Gorni

Thank you, Gianluca, for replying, but your suggestion only tells me what I already knew (i.e., that my piecewise definition for parts two and three of my plot variables is not executing as expected) without explaining why that is happening. To clarify further, the expected plot of these parts (which I previously evaluated in another application) would look something like the following: real&imaginarypartsFresnelrinternalboundary

Scott

enter image description here

Attachment

Attachments:
POSTED BY: Scott Milligan

You can check the values this way:

{Subscript[r, te][NDegtoRad[x]][[2]], 
  Subscript[r, tm][NDegtoRad[x]][[2]], 
  Subscript[r, te][NDegtoRad[x]][[3]], 
  Subscript[r, tm][NDegtoRad[x]][[3]]} /. 
 Map[List, Thread[x -> \[Theta]]]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract