Plot Relative Intensity of Function in Maple

In summary: Homework Statement Plot the following function in maple (any graphics software):I_\theta = I_m (cos (\beta))^2 \left( \frac{sin(\alpha)}{\alpha} \right)^2Homework EquationsRange = -20 degrees to 20 degrees\beta = \frac{\pi d}{\lambda} \sin(\theta)\alpha = \frac{\pi a}{\lambda} \sin(\theta)d = 0,2a = 0,1\lambda = 632,8The Attempt at a SolutionThis is the maple code:plot((cos((Pi*.2)*sin(theta)/(632.8))^2)(sin((Pi*.1
  • #1
Schwarzschild90
113
1

Homework Statement


Plot the following function in maple (any graphics software):

[itex]I_\theta = I_m (cos (\beta))^2 \left( \frac{sin(\alpha)}{\alpha} \right)^2[/itex]

Homework Equations


Range = -20 degrees to 20 degrees
[itex]\beta = \frac{\pi d}{\lambda} \sin(\theta)[/itex]
[itex]\alpha = \frac{\pi a}{\lambda} \sin(\theta)[/itex]
[itex]d = 0,2[/itex]
[itex]a = 0,1[/itex]
[itex]\lambda = 632,8[/itex]

The Attempt at a Solution


This is the maple code:
plot((cos((Pi*.2)*sin(theta)/(632.8))^2)(sin((Pi*.1)*sin(theta)/(632.8))*(632.8)/((Pi*.1)*sin(theta)))^2, theta = convert(-20*degrees, radians) .. convert(20*degrees, radians), axes = boxed);

And in latex:

[itex]\displaystyle {\it plot} \left( \left( \left( \left( \cos \left( 0.0009929180323\\
\mbox{}\,\sin \left( \theta \right) \right) \right) ^{2} \right) \left( 2014.264960\,{\frac {\sin \left( 0.0004964590161\\
\mbox{}\,\sin \left( \theta \right) \right) }{\sin \left( \theta \right) }} \right) \right) ^{2},\theta={{\it convert} \left( -20\\
\mbox{}\,{\it degrees},{\it radians} \right) \ldots {\it convert} \left( 20\,{\it degrees},{\it radians} \right) }\\
\mbox{},{\it axes}={\it boxed} \right)[/itex]Yields this:

upload_2015-12-14_16-28-55.png


It should have a spike at (-17.5 degrees in radians) and at 0 degrees in radians and another at 17.5 degrees in radians. Mine has a single spike at 0 degrees in radians.
 
Last edited:
Physics news on Phys.org
  • #2
Schwarzschild90 said:

Homework Statement


Plot the following function in maple (any graphics software):

[itex]I_\theta = I_m (cos (\beta))^2 \left( \frac{sin(\alpha)}{\alpha} \right)^2[/itex]

Homework Equations


Range = -20 degrees to 20 degrees
[itex]\beta = \frac{\pi d}{\lambda} \sin(\theta)[/itex]
[itex]\alpha = \frac{\pi a}{\lambda} \sin(\theta)[/itex]
[itex]d = 0,2[/itex]
[itex]a = 0,1[/itex]
[itex]\lambda = 632,8[/itex]

The Attempt at a Solution


This is the maple code:
plot((cos((Pi*.2)*sin(theta)/(632.8))^2)(sin((Pi*.1)*sin(theta)/(632.8))*(632.8)/((Pi*.1)*sin(theta)))^2, theta = convert(-20*degrees, radians) .. convert(20*degrees, radians), axes = boxed);
Your Maple code is wrong, I believe. Simplifying greatly, ##\cos(\beta) = \cos(\sin(\theta))## (with several factors removed), and similarly for ##\sin(\alpha)##. Your Maple code above appears to be multiplying these functions instead of using function composition.

Also, instead of working with the very long plot expression that you have above, it would be worthwhile to assign some variables above the plot statement. For example, create a variable and assign the value ##\pi/2## to it. And another for the 632.8 constant -- where does this one come from? Is that ##\frac{\pi \lambda}{d}##? It looks like you might have missed the other constant, ##\frac{\pi \lambda}{a}##.

Schwarzschild90 said:
And in latex:

[itex]\displaystyle {\it plot} \left( \left( \left( \left( \cos \left( 0.0009929180323\\
\mbox{}\,\sin \left( \theta \right) \right) \right) ^{2} \right) \left( 2014.264960\,{\frac {\sin \left( 0.0004964590161\\
\mbox{}\,\sin \left( \theta \right) \right) }{\sin \left( \theta \right) }} \right) \right) ^{2},\theta={{\it convert} \left( -20\\
\mbox{}\,{\it degrees},{\it radians} \right) \ldots {\it convert} \left( 20\,{\it degrees},{\it radians} \right) }\\
\mbox{},{\it axes}={\it boxed} \right)[/itex]Yields this:

View attachment 93338

It should have a spike at (-17.5 degrees in radians) and at 0 degrees in radians and another at 17.5 degrees in radians. Mine has a single spike at 0 degrees in radians.
 
  • Like
Likes Schwarzschild90
  • #3
I cleaned up the code, as you suggested
upload_2015-12-14_17-54-30.png

upload_2015-12-14_17-54-43.png


I can't see where the error is
 

Attachments

  • upload_2015-12-14_17-54-25.png
    upload_2015-12-14_17-54-25.png
    500 bytes · Views: 390
  • #4
Schwarzschild90 said:

Homework Statement


Plot the following function in maple (any graphics software):

[itex]I_\theta = I_m (cos (\beta))^2 \left( \frac{sin(\alpha)}{\alpha} \right)^2[/itex]

Homework Equations


Range = -20 degrees to 20 degrees
[itex]\beta = \frac{\pi d}{\lambda} \sin(\theta)[/itex]
[itex]\alpha = \frac{\pi a}{\lambda} \sin(\theta)[/itex]
[itex]d = 0,2[/itex]
[itex]a = 0,1[/itex]
[itex]\lambda = 632,8[/itex]

The Attempt at a Solution


This is the maple code:
plot((cos((Pi*.2)*sin(theta)/(632.8))^2)(sin((Pi*.1)*sin(theta)/(632.8))*(632.8)/((Pi*.1)*sin(theta)))^2, theta = convert(-20*degrees, radians) .. convert(20*degrees, radians), axes = boxed);

And in latex:

[itex]\displaystyle {\it plot} \left( \left( \left( \left( \cos \left( 0.0009929180323\\
\mbox{}\,\sin \left( \theta \right) \right) \right) ^{2} \right) \left( 2014.264960\,{\frac {\sin \left( 0.0004964590161\\
\mbox{}\,\sin \left( \theta \right) \right) }{\sin \left( \theta \right) }} \right) \right) ^{2},\theta={{\it convert} \left( -20\\
\mbox{}\,{\it degrees},{\it radians} \right) \ldots {\it convert} \left( 20\,{\it degrees},{\it radians} \right) }\\
\mbox{},{\it axes}={\it boxed} \right)[/itex]Yields this:

View attachment 93338

It should have a spike at (-17.5 degrees in radians) and at 0 degrees in radians and another at 17.5 degrees in radians. Mine has a single spike at 0 degrees in radians.

I want to test the plot myself, but I do not know what your ##I_m## means. It looks like a notation for a Bessel function of the second kind, but I do not see any Bessel functions in your plotting expressions.
 
  • #5
I've taken I_m = 1 and since I know only a little about bessel functions, I cannot tell you if this is one.

(I know that Bessel functions can be used to model the waves coming off of a bass)
 
Last edited:
  • #6
Ray Vickson said:
I want to test the plot myself, but I do not know what your ##I_m## means. It looks like a notation for a Bessel function of the second kind, but I do not see any Bessel functions in your plotting expressions.

With the parameters you gave, the intensity ##I_{\theta}## is smooth, has no "spikes" (if I understand that to mean a very sharp, pointed peak), and is so close to 1 for ##-20^o < \theta < 20^o## that it will plot as a straight line (unless you restrict the y-axis to values between about 0.999995 to 1.0, as you did in your first post).

You can see this easily. Let ##\beta = u \sin(\theta)## and ##\alpha = v \sin(\theta)##, where ##u = \pi d/ \lambda \doteq 0 .9929180323 \, 10^{-3}## and ##v = \pi a / \lambda \doteq 0.4964590161\, 10^{-3}##. Then, with ##\theta## in radians we have
[tex] I_{\theta} = \cos^2 (u \sin(\theta)) \, \left( \frac{\sin(v \sin(\theta))}{v \sin(\theta)} \right)^2 [/tex]
Note that ##I_{\theta}## is an even function of ##\theta##, so to know its behavior on ##\theta \in (-\pi,\pi)## it is sufficient to restrict attention to the positive half ##\theta \in [0, \pi)##. You can find its local minimal on ##-\pi < \theta < \pi## by solving ##(d/d \, \theta) I_{\theta} = 0 ## numerically; the solution is at ##\theta = \theta_m = 1.5707963267948966192##, at which point we have ##I_{\theta} = .99999893185601793245##. In other words, on the interval ##-\pi < \theta < \pi## the function ##I_{\theta}## lies between a minimum of ##0.9999989## (at ##\theta = \pm 1.5707##) and a maximum of ##1.0## at ##\theta = 0##.

You can also see this using an expansion of ##I_{\theta}## around ##\theta = 0##. Its Maclaurin expansion is
[tex] I_{\theta} = 1 + p_2 S^2 + p_4 S^4+ p_6 S^6 + \cdots, \; \text{with } \; S = \sin(\theta)[/tex]
where
[tex] \begin{array}{lcr}
p_2 &=&-0.10680434033590471660 \, 10^{-5} \\
p_4& =&0.40768810279355082790 \, 10^{-12} \\
p_6& =&-0.71916540449698892880 \, 10^{-19}
\end{array} [/tex]
In other words, ##I_{\theta} \doteq 1 - 0.0000011 \, S^2 + 0.00000000000076 \, S^4 - 0.000000000000000000072 \, S^6 + \cdots##, for ##-1 < S = \sin(\theta) < 1##.

The results in your first post are correct, so your supposition about "spikes" is incorrect.
 
Last edited:
  • #7
I see that, but I am still at a total loss though
 
  • #8
Schwarzschild90 said:
I see that, but I am still at a total loss though

At a total loss about what? You have a correct plot, so if somebody told you there should be a spike at 17.5 degrees they were telling you something that is NOT TRUE.
 
  • #9
Schwarzschild90 said:

Homework Statement


Plot the following function in maple (any graphics software):

[itex]I_\theta = I_m (cos (\beta))^2 \left( \frac{sin(\alpha)}{\alpha} \right)^2[/itex]

Homework Equations


Range = -20 degrees to 20 degrees
[itex]\beta = \frac{\pi d}{\lambda} \sin(\theta)[/itex]
[itex]\alpha = \frac{\pi a}{\lambda} \sin(\theta)[/itex]
[itex]d = 0,2[/itex]
[itex]a = 0,1[/itex]
[itex]\lambda = 632,8[/itex]
Include the units of the data.
The formula might be that of double-slit diffraction in terms of the deflection angle theta. 632.8 nm must be the wavelength of the incident light (from a He-Ne laser) 'a' is the slit width and 'b' is the distance between the slits. They are of micrometer size, comparable with the wavelength, cannot be 0.1 and 0.2 nm!
 
  • #10
d = 0.2 mm = 200000 nm
a = 0.1 mm = 100000 nm

The plot still isn't right
 
  • #11
Schwarzschild90 said:
d = 0.2 mm = 200000 nm
a = 0.1 mm = 100000 nm

The plot still isn't right
Was not it a=0.01 mm and d=0.02 mm?
 

1. What is plot relative intensity?

Plot relative intensity is a tool used in spectroscopy to visualize and analyze the intensity of spectral lines. It is a graph that shows the relative intensity of each spectral line as a function of its wavelength or frequency.

2. How is plot relative intensity calculated?

Plot relative intensity is calculated by dividing the intensity of each spectral line by the maximum intensity in the spectrum. This results in a graph where the maximum intensity is represented by a value of 1, and all other intensities are expressed as a fraction of the maximum.

3. What is the purpose of using plot relative intensity?

The purpose of using plot relative intensity is to compare and analyze the relative strengths of different spectral lines. By plotting the intensities as a function of wavelength or frequency, it is easier to identify and study patterns and trends in the data.

4. How does plot relative intensity differ from absolute intensity?

Plot relative intensity takes into account the maximum intensity in the spectrum, while absolute intensity does not. This means that plot relative intensity is a normalized representation of the data, while absolute intensity shows the raw intensity values.

5. Can plot relative intensity be used for all types of spectroscopy?

Yes, plot relative intensity can be used for all types of spectroscopy where intensity is measured, such as UV-Vis, IR, and NMR spectroscopy. It is a commonly used tool for analyzing spectral data in many scientific fields.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
563
  • Calculus and Beyond Homework Help
Replies
5
Views
358
  • Calculus and Beyond Homework Help
Replies
3
Views
799
  • Calculus and Beyond Homework Help
Replies
4
Views
958
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • General Math
Replies
1
Views
266
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Programming and Computer Science
Replies
3
Views
855
  • Introductory Physics Homework Help
Replies
2
Views
632
Back
Top