YSICS: Troubleshooting an Equation Plot Issue

Click For Summary
SUMMARY

The forum discussion centers on troubleshooting an equation plot issue related to a script used for generating plots. The user experiences unexpected results after modifying the thickness of the plot lines. A key insight provided by a participant identifies a potential typo in the original equation from the referenced publication, suggesting that the correct form should be ##2(n^2 - 1)(n^2 - s^2)##. Implementing this correction is likely to resolve the plotting discrepancies.

PREREQUISITES
  • Familiarity with plotting libraries in programming languages such as Python or MATLAB.
  • Understanding of mathematical notation and equation formatting.
  • Basic knowledge of troubleshooting techniques in coding.
  • Access to the publication referenced for context on the equations.
NEXT STEPS
  • Review the original publication for accurate equation definitions and context.
  • Learn about debugging techniques in plotting libraries to identify visual discrepancies.
  • Explore best practices for formatting equations in scripts to avoid syntax errors.
  • Investigate advanced plotting options to enhance visual clarity and presentation.
USEFUL FOR

Researchers, data analysts, and anyone involved in scientific computing who needs to troubleshoot plotting issues in their scripts.

zhillyz
Messages
64
Reaction score
0
TL;DR
Copied equations from paper into MATLAB and gave some test variables but output looks weird
Thickness1.png

First image showing script and plot
Thickness2.png

Second image where all I have done is slightly change the thickness and now the plot looks very weird.
Transmission.png

Final image showing the kind of plot I am expecting.

Am I just doing something stupid as I can't see what is wrong/different between my equations and the ones in the publication?
Here is the paper: https://iopscience.iop.org/article/10.1088/0022-3735/16/12/023/pdf
Any help of pointers would be appreciated.
PH
 

Attachments

  • Thickness2.png
    Thickness2.png
    45.9 KB · Views: 358
Physics news on Phys.org
They clearly have a typo in their definition of C since there are two opening parenthesis, but only one closing. My guess is that it should be ##2(n^2 - 1)(n^2 - s^2)##. Try that and see if it fixes the problem.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
7K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 11 ·
Replies
11
Views
3K
Replies
3
Views
5K
Replies
4
Views
3K