Help with scilab code for calculating transmission coefficient

In summary, the conversation discusses an issue with generating a graph in Scilab using a given formula. The output graph does not match the expected result and it is suspected that the calculation of T is incorrect. After troubleshooting, it is suggested to use element by element division instead of matrix division, and this solution successfully generates the desired graph.
  • #1
Reshma
749
6
I seem to be getting some arbitrary values from my Scilab code for a function. I have to generate a graph showing the dependence of the transmission on the air gap separating two higher refractive index materials i.e. I want to plot "T" as a function of "d".
[tex] T = \frac{1}{1 + \beta \sinh^2 (\delta)}[/tex]
δ = 2∏d/λ

Code:
d = [0:0.01:1]
delta = 2*%pi*d
T = 1/(1+0.36*(sinh(delta))^2)
plot(d,T)
xtitle("Transmission dependence on d","d","T")

The output graph does not match with what I was expecting. The transmission T should start at 1 and decrease with increasing d. Instead the graph seems reversed. I have attached the output graph file. I plotted the graph with the same formula in excel and it turns out right. Can someone take a look at my code and point out where I am going wrong.

Thanks in advance.
 

Attachments

  • graph.jpg
    graph.jpg
    11.8 KB · Views: 461
Technology news on Phys.org
  • #2
I don't have Scilab but I think your problem is that T is calculated by matrix division not an element by element division. Other than that it seems like the code should work fine.

Try:
T = 1 ./(1+0.36 .*(sinh(delta)) .^2)
 
  • #3
Wow, that worked (graph attached). Thanks a lot, Bob!
 

Attachments

  • FTR.jpg
    FTR.jpg
    10.6 KB · Views: 491

1. What is Scilab and why is it used for calculating transmission coefficient?

Scilab is a free and open-source software for numerical computation and data visualization. It is commonly used in scientific and engineering fields for tasks such as data analysis, simulation, and modeling. Scilab is particularly useful for calculating transmission coefficient because it has built-in functions and tools for handling complex mathematical operations.

2. What is transmission coefficient and why is it important?

Transmission coefficient is a measure of the effectiveness of a barrier in allowing a wave to pass through it. It is important in various fields such as physics, electronics, and telecommunications as it helps in determining the efficiency of signal transmission and the behavior of waves in different materials.

3. How can I calculate transmission coefficient using Scilab?

To calculate transmission coefficient using Scilab, you can use the built-in function "transcoeff" which takes in parameters such as the input and output signal and the impedance of the barrier. Alternatively, you can also use the "bode" function to plot the frequency response of the system and calculate the transmission coefficient from there.

4. Can Scilab handle complicated transmission coefficient calculations?

Yes, Scilab is capable of handling complex calculations for transmission coefficient. It has a wide range of mathematical functions and tools that can be used to handle complicated equations and formulas. Additionally, Scilab also supports user-defined functions, allowing for customization and flexibility in calculations.

5. Are there any resources available for learning how to use Scilab for calculating transmission coefficient?

Yes, there are plenty of resources available for learning how to use Scilab for calculating transmission coefficient. You can refer to the official Scilab documentation, online tutorials and forums, and even books specifically dedicated to using Scilab for mathematical computation and analysis. Additionally, many universities and institutions offer courses on Scilab and its applications in scientific research.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • Programming and Computer Science
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
624
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
4
Views
614
  • Introductory Physics Homework Help
Replies
2
Views
737
Replies
1
Views
1K
  • Programming and Computer Science
Replies
2
Views
632
  • Programming and Computer Science
Replies
1
Views
1K
Back
Top