MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Novice problem in mathematica syntax : Function of a function:

  • To: mathgroup at smc.vnet.net
  • Subject: [mg128737] Re: Novice problem in mathematica syntax : Function of a function:
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Thu, 22 Nov 2012 04:32:30 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <20121122004955.3BA2E68BD@smc.vnet.net>

I don't have a problem. Recommend that you start with a fresh session.

epsmodel[w_, omega0_, gama_, epsinfi_, omegaP_] =
 FullSimplify[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)]


epsinfi + omegaP^2/(omega0^2 + I*gama*w - w^2)

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},
  Frame -> True,
  Axes -> False,
  FrameLabel -> {"w20", "Reflectivity GaSb"},
  PlotRange -> {0, 1}],
 {{epsinfi20, 15}, 2, 25,
  Appearance -> "Labeled"},
 {{omega020, 150}, 0, 300,
  Appearance -> "Labeled"},
 {{gama20, 20}, 0, 300,
  Appearance -> "Labeled"},
 {omegaP20, 0, 300,
  Appearance -> "Labeled"}]


Bob Hanlon


On Wed, Nov 21, 2012 at 7:49 PM, Prasad P Iyer <prasadpiyer at gmail.com> wrote:
> 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
>
>



  • Prev by Date: Special characters on file names: issues with linux
  • Next by Date: Re: How to calculate the partial derivative?
  • Previous by thread: Novice problem in mathematica syntax : Function of a function:
  • Next by thread: Problem with NonlinearModelFit