Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Re: Novice problem in mathematica syntax : Function of a function
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Alexei Boulbitch

Posts: 483
Registered: 2/28/08
Re: Novice problem in mathematica syntax : Function of a function
Posted: Nov 23, 2012 3:34 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

hi,

What I want to do is to : Plot Reflectivity:

Refelectivity is an expression ( or a function ) depending on nfilm which in turn depends on epsmodel( which in itself is a function of 3 parameters and a variable )

therefore :
epsmodel = f(a,b,c,d,x) (* result is a comlpex number *)
nfilm = sqrt[epsmodel]
reflectivity = ((nfilm - 1) / (nfilm +1))^2

I just want to plot reflectivity and see the variation in it when (a,b,c,x) varies ( using the Manipulate[] tool )

Please let me know how to do this in term of these functions ?


the exact formalism for which I got the error : variables are protected is shown below

epsmodel[w_, omega0_, gama_, epsinfi_, omegaP_] :=
epsinfi + (2 Pi*10^12 omegaP)^2/((2 Pi*10^12 omega0)^2 - (2 \
Pi*10^12*w)^2 + I*(2 Pi*10^12)^2 *gama*w);

nfilm[w1_, omega01_, gama1_, epsinfi1_, omegaP1_] :=
Sqrt[epsmodel[w1, omega01, gama1, omegaP1, epsinfi1]];

ReflectivityGaSb[w2_, omega02_, gama2_, epsinfi2_, omegaP2_] :=
Abs[((nfilm[w2, omega02, gama2, omegaP2, epsinfi2] - 1)/(
nfilm[w2, omega02, gama2, omegaP2, epsinfi2] + 1))^2];

Manipulate[
Plot[ReflectivityGaSb[w20, omega020, gama20, omegaP20,
epsinfi20], {w20, 0, 300}, PlotRange -> {0, 1}], {epsinfi20, 2,
25}, {omega020, 0, 300}, {gama20, 0, 300}, {omegaP20, 0, 300}]

Thanking you
Prasad P Iyer
PS. feel free to reply to ppiyer at outlook.com

Hi, Prasad,

Your code worked on my machine (Math. 8, Windows XP) without problems. The only thing that might be questionable, just check: the order of the last two parameters of the epsmodel in the definition of the function nfilm seam to be written in the reversed order. I think you did not intend that.

Have fun, Alexei


Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone : +352-2454-2566
Office fax: +352-2454-3566
mobile phone: +49 151 52 40 66 44

e-mail: alexei.boulbitch@iee.lu







Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.