Message Boards Message Boards

0
|
2160 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Why for some parameters the output of the numerical integration seem wrong?

Posted 5 years ago

G is a numerical integration, it is dependent on afa and d, the codes are as following. I found that if I set
d1=d2=0.67times10^(-9) and try to get a set of G with {afa,0,Pi/6,0.005}, the curve of the output is smooth. However, if I set d1=d2=1.34times10^(-9) and try to get a set of G with {afa,0,Pi/6,0.005}, the curve of the output is not smooth and seems like noise. I wonder that it is because the integrand (in detail is Abs[A2]^2) varies rapidly in some regions for d1=d2=1.34*10^(-9). How to solve this problem? Many thanks!

Clear["`*"]
vh = 1;
d1 = 1.34*10^(-9);
d2 = 1.34*10^(-9);
mu = 5.5;
HBAR = 1.05457266*10^(-34);
ME = 9.1093897*10^(-31);
ELEC = 1.60217733*10^(-19);
Kh = 2.95*10^(10);
kc = Sqrt[2*ME*ELEC/HBAR^2];
k := kc*Sqrt[mu]

k0 := Sqrt[k^2 - k^2 Sin[x]^2]
kh := Sqrt[k^2 - (Kh - k Sin[x] Cos[y])^2 - k^2 Sin[x]^2 Sin[y]^2]
khg := Sqrt[
  k^2 - (2*Kh*Sin[afa/2]*Sin[afa/2] - 
      k Sin[x] Cos[y])^2 - (2*Kh*Sin[afa/2]*Cos[afa/2] + 
      k Sin[x] Sin[y])^2]
kg1 := Sqrt[
  k^2 - (Kh*Cos[Pi/3 - afa] - 
      k Sin[x] Cos[y])^2 - (Kh*Sin[Pi/3 - afa] + k Sin[x] Sin[y])^2]
kg2 := Sqrt[
  k^2 - (Kh*Cos[afa] - k Sin[x] Cos[y])^2 - (k Sin[x] Sin[y] - 
      Kh*Sin[afa])^2]

k0pl := Sqrt[k^2 - k^2 Sin[x]^2 + kc^2 vh]
k0mi := Sqrt[k^2 - k^2 Sin[x]^2 - kc^2 vh]
khpl := Sqrt[
  k^2 - (Kh - k Sin[x] Cos[y])^2 - k^2 Sin[x]^2 Sin[y]^2 + kc^2 vh]
khmi := Sqrt[
  k^2 - (Kh - k Sin[x] Cos[y])^2 - k^2 Sin[x]^2 Sin[y]^2 - kc^2 vh]

k0plpl := Sqrt[k^2 - k^2 Sin[x]^2 + 2*kc^2 vh]
k0mimi := Sqrt[k^2 - k^2 Sin[x]^2 - 2*kc^2 vh]
khplpl := 
 Sqrt[k^2 - (Kh - k Sin[x] Cos[y])^2 - k^2 Sin[x]^2 Sin[y]^2 + 
   2*kc^2 vh]
khmimi := 
 Sqrt[k^2 - (Kh - k Sin[x] Cos[y])^2 - k^2 Sin[x]^2 Sin[y]^2 - 
   2*kc^2 vh]
khgplpl := 
 Sqrt[k^2 - (2*Kh*Sin[afa/2]*Sin[afa/2] - 
      k Sin[x] Cos[y])^2 - (2*Kh*Sin[afa/2]*Cos[afa/2] + 
      k Sin[x] Sin[y])^2 + 2*kc^2 vh]
khgmimi := 
 Sqrt[k^2 - (2*Kh*Sin[afa/2]*Sin[afa/2] - 
      k Sin[x] Cos[y])^2 - (2*Kh*Sin[afa/2]*Cos[afa/2] + 
      k Sin[x] Sin[y])^2 - 2*kc^2 vh]
kg1plpl := 
 Sqrt[k^2 - (Kh*Cos[Pi/3 - afa] - 
      k Sin[x] Cos[y])^2 - (Kh*Sin[Pi/3 - afa] + k Sin[x] Sin[y])^2 + 
   2*kc^2 vh]
kg1mimi := 
 Sqrt[k^2 - (Kh*Cos[Pi/3 - afa] - 
      k Sin[x] Cos[y])^2 - (Kh*Sin[Pi/3 - afa] + k Sin[x] Sin[y])^2 - 
   2*kc^2 vh]
kg2plpl := 
 Sqrt[k^2 - (Kh*Cos[afa] - k Sin[x] Cos[y])^2 - (k Sin[x] Sin[y] - 
      Kh*Sin[afa])^2 + 2*kc^2 vh]
kg2mimi := 
 Sqrt[k^2 - (Kh*Cos[afa] - k Sin[x] Cos[y])^2 - (k Sin[x] Sin[y] - 
      Kh*Sin[afa])^2 - 2*kc^2 vh]

A11 := Exp[
   I*k0pl*d1]/(Exp[I*(k0 + kg1plpl - kg1)*d1] + Exp[I*k0plpl*d1])
A12 := Exp[
   I*k0pl*d1]/(Exp[I*(k0 + kg2plpl - kg2)*d1] + Exp[I*k0plpl*d1])
B11 := Exp[
   I*(k0pl + kg1plpl - kg1)*d1]/(Exp[I*(k0 + kg1plpl - kg1)*d1] + 
    Exp[I*k0plpl*d1])
B12 := Exp[
   I*(k0pl + kg2plpl - kg2)*d1]/(Exp[I*(k0 + kg2plpl - kg2)*d1] + 
    Exp[I*k0plpl*d1])
A2 := Exp[
   I*khpl*d1]/(Exp[I*(kh + khgplpl - khg)*d1] + Exp[I*khplpl*d1])
B2 := Exp[
   I*(khpl + khgplpl - khg)*d1]/(Exp[I*(kh + khgplpl - khg)*d1] + 
    Exp[I*khplpl*d1])
A31 := Exp[
   I*k0mi*d1]/(Exp[I*(k0mimi + kg1 - kg1mimi)*d1] + Exp[I*k0*d1])
A32 := Exp[
   I*k0mi*d1]/(Exp[I*(k0mimi + kg2 - kg2mimi)*d1] + Exp[I*k0*d1])
B31 := Exp[
   I*(k0mi + kg1 - kg1mimi)*d1]/(Exp[I*(k0mimi + kg1 - kg1mimi)*d1] + 
    Exp[I*k0*d1])
B32 := Exp[
   I*(k0mi + kg2 - kg2mimi)*d1]/(Exp[I*(k0mimi + kg2 - kg2mimi)*d1] + 
    Exp[I*k0*d1])
A4 := Exp[
   I*khmi*d1]/(Exp[I*(khmimi + khg - khgmimi)*d1] + Exp[I*kh*d1])
B4 := Exp[
   I*(khmi + khg - khgmimi)*d1]/(Exp[I*(khmimi + khg - khgmimi)*d1] + 
    Exp[I*kh*d1])

T1 := 1/4 Re[
    Abs[A11]^2*k0plpl*Exp[I*(k0plpl - Conjugate[k0plpl])*(d1 + d2)] + 
     Abs[A11]^2*kg1plpl*
      Exp[I*(kg1plpl - Conjugate[kg1plpl])*(d1 + d2)] + 
     Abs[A2]^2*khplpl*Exp[I*(khplpl - Conjugate[khplpl])*(d1 + d2)] + 
     Abs[A2]^2*khgplpl*
      Exp[I*(khgplpl - Conjugate[khgplpl])*(d1 + d2)] + 
     Abs[B31]^2*k0mimi*Exp[I*(k0mimi - Conjugate[k0mimi])*(d1 + d2)] +
      Abs[B31]^2*kg1mimi*
      Exp[I*(kg1mimi - Conjugate[kg1mimi])*(d1 + d2)] + 
     Abs[B4]^2*khmimi*Exp[I*(khmimi - Conjugate[khmimi])*(d1 + d2)] + 
     Abs[B4]^2*khgmimi*
      Exp[I*(khgmimi - Conjugate[khgmimi])*(d1 + d2)] + 
     Abs[B11 + A31]^2*k0*Exp[I*(k0 - Conjugate[k0])*(d1 + d2)] + 
     Abs[B11 - A31]^2*kg1*Exp[I*(kg1 - Conjugate[kg1])*(d1 + d2)] + 
     Abs[A4 - B2]^2*kh*Exp[I*(kh - Conjugate[kh])*(d1 + d2)] + 
     Abs[A4 + B2]^2*khg*Exp[I*(khg - Conjugate[khg])*(d1 + d2)] + 
     Conjugate[A11]*B31*k0mimi*
      Exp[I*(k0mimi - Conjugate[k0plpl])*(d1 + d2)] + 
     A11*Conjugate[B31]*k0plpl*
      Exp[I*(k0plpl - Conjugate[k0mimi])*(d1 + d2)] + 
     Conjugate[A11]*(B11 + A31)*k0*
      Exp[I*(k0 - Conjugate[k0plpl])*(d1 + d2)] + 
     A11*Conjugate[B11 + A31]*k0plpl*
      Exp[I*(k0plpl - Conjugate[k0])*(d1 + d2)] + 
     Conjugate[B31]*(B11 + A31)*k0*
      Exp[I*(k0 - Conjugate[k0mimi])*(d1 + d2)] + 
     B31*Conjugate[B11 + A31]*k0mimi*
      Exp[I*(k0mimi - Conjugate[k0])*(d1 + d2)] - 
     Conjugate[A11]*B31*kg1mimi*
      Exp[I*(kg1mimi - Conjugate[kg1plpl])*(d1 + d2)] - 
     A11*Conjugate[B31]*kg1plpl*
      Exp[I*(kg1plpl - Conjugate[kg1mimi])*(d1 + d2)] + 
     Conjugate[A11]*(A31 - B11)*kg1*
      Exp[I*(kg1 - Conjugate[kg1plpl])*(d1 + d2)] + 
     A11*Conjugate[A31 - B11]*kg1plpl*
      Exp[I*(kg1plpl - Conjugate[kg1])*(d1 + d2)] + 
     Conjugate[B31]*(B11 - A31)*kg1*
      Exp[I*(kg1 - Conjugate[kg1mimi])*(d1 + d2)] + 
     B31*Conjugate[B11 - A31]*kg1mimi*
      Exp[I*(kg1mimi - Conjugate[kg1])*(d1 + d2)] - 
     Conjugate[A2]*B4*khmimi*
      Exp[I*(khmimi - Conjugate[khplpl])*(d1 + d2)] - 
     A2*Conjugate[B4]*khplpl*
      Exp[I*(khplpl - Conjugate[khmimi])*(d1 + d2)] + 
     Conjugate[A2]*(B2 - A4)*kh*
      Exp[I*(kh - Conjugate[khplpl])*(d1 + d2)] + 
     A2*Conjugate[B2 - A4]*khplpl*
      Exp[I*(khplpl - Conjugate[kh])*(d1 + d2)] + 
     Conjugate[B4]*(A4 - B2)*kh*
      Exp[I*(kh - Conjugate[khmimi])*(d1 + d2)] + 
     B4*Conjugate[A4 - B2]*khmimi*
      Exp[I*(khmimi - Conjugate[kh])*(d1 + d2)] + 
     Conjugate[A2]*B4*khgmimi*
      Exp[I*(khgmimi - Conjugate[khgplpl])*(d1 + d2)] + 
     A2*Conjugate[B4]*khgplpl*
      Exp[I*(khgplpl - Conjugate[khgmimi])*(d1 + d2)] - 
     Conjugate[A2]*(A4 + B2)*khg*
      Exp[I*(khg - Conjugate[khgplpl])*(d1 + d2)] - 
     A2*Conjugate[A4 + B2]*khgplpl*
      Exp[I*(khgplpl - Conjugate[khg])*(d1 + d2)] - 
     Conjugate[B4]*(A4 + B2)*khg*
      Exp[I*(khg - Conjugate[khgmimi])*(d1 + d2)] - 
     B4*Conjugate[A4 + B2]*khgmimi*
      Exp[I*(khgmimi - Conjugate[khg])*(d1 + d2)]];

T2 := 1/4 Re[
    Abs[A12]^2*k0plpl*Exp[I*(k0plpl - Conjugate[k0plpl])*(d1 + d2)] + 
     Abs[A12]^2*kg2plpl*
      Exp[I*(kg2plpl - Conjugate[kg2plpl])*(d1 + d2)] + 
     Abs[A2]^2*khplpl*Exp[I*(khplpl - Conjugate[khplpl])*(d1 + d2)] + 
     Abs[A2]^2*khgplpl*
      Exp[I*(khgplpl - Conjugate[khgplpl])*(d1 + d2)] + 
     Abs[B32]^2*k0mimi*Exp[I*(k0mimi - Conjugate[k0mimi])*(d1 + d2)] +
      Abs[B32]^2*kg2mimi*
      Exp[I*(kg2mimi - Conjugate[kg2mimi])*(d1 + d2)] + 
     Abs[B4]^2*khmimi*Exp[I*(khmimi - Conjugate[khmimi])*(d1 + d2)] + 
     Abs[B4]^2*khgmimi*
      Exp[I*(khgmimi - Conjugate[khgmimi])*(d1 + d2)] + 
     Abs[B12 + A32]^2*k0*Exp[I*(k0 - Conjugate[k0])*(d1 + d2)] + 
     Abs[B12 - A32]^2*kg2*Exp[I*(kg2 - Conjugate[kg2])*(d1 + d2)] + 
     Abs[A4 - B2]^2*kh*Exp[I*(kh - Conjugate[kh])*(d1 + d2)] + 
     Abs[A4 + B2]^2*khg*Exp[I*(khg - Conjugate[khg])*(d1 + d2)] + 
     Conjugate[A12]*B32*k0mimi*
      Exp[I*(k0mimi - Conjugate[k0plpl])*(d1 + d2)] + 
     A12*Conjugate[B32]*k0plpl*
      Exp[I*(k0plpl - Conjugate[k0mimi])*(d1 + d2)] + 
     Conjugate[A12]*(B12 + A32)*k0*
      Exp[I*(k0 - Conjugate[k0plpl])*(d1 + d2)] + 
     A12*Conjugate[B12 + A32]*k0plpl*
      Exp[I*(k0plpl - Conjugate[k0])*(d1 + d2)] + 
     Conjugate[B32]*(B12 + A32)*k0*
      Exp[I*(k0 - Conjugate[k0mimi])*(d1 + d2)] + 
     B32*Conjugate[B12 + A32]*k0mimi*
      Exp[I*(k0mimi - Conjugate[k0])*(d1 + d2)] - 
     Conjugate[A12]*B32*kg2mimi*
      Exp[I*(kg2mimi - Conjugate[kg2plpl])*(d1 + d2)] - 
     A12*Conjugate[B32]*kg2plpl*
      Exp[I*(kg2plpl - Conjugate[kg2mimi])*(d1 + d2)] + 
     Conjugate[A12]*(A32 - B12)*kg2*
      Exp[I*(kg2 - Conjugate[kg2plpl])*(d1 + d2)] + 
     A12*Conjugate[A32 - B12]*kg2plpl*
      Exp[I*(kg2plpl - Conjugate[kg2])*(d1 + d2)] + 
     Conjugate[B32]*(B12 - A32)*kg2*
      Exp[I*(kg2 - Conjugate[kg2mimi])*(d1 + d2)] + 
     B32*Conjugate[B12 - A32]*kg2mimi*
      Exp[I*(kg2mimi - Conjugate[kg2])*(d1 + d2)] - 
     Conjugate[A2]*B4*khmimi*
      Exp[I*(khmimi - Conjugate[khplpl])*(d1 + d2)] - 
     A2*Conjugate[B4]*khplpl*
      Exp[I*(khplpl - Conjugate[khmimi])*(d1 + d2)] + 
     Conjugate[A2]*(B2 - A4)*kh*
      Exp[I*(kh - Conjugate[khplpl])*(d1 + d2)] + 
     A2*Conjugate[B2 - A4]*khplpl*
      Exp[I*(khplpl - Conjugate[kh])*(d1 + d2)] + 
     Conjugate[B4]*(A4 - B2)*kh*
      Exp[I*(kh - Conjugate[khmimi])*(d1 + d2)] + 
     B4*Conjugate[A4 - B2]*khmimi*
      Exp[I*(khmimi - Conjugate[kh])*(d1 + d2)] + 
     Conjugate[A2]*B4*khgmimi*
      Exp[I*(khgmimi - Conjugate[khgplpl])*(d1 + d2)] + 
     A2*Conjugate[B4]*khgplpl*
      Exp[I*(khgplpl - Conjugate[khgmimi])*(d1 + d2)] - 
     Conjugate[A2]*(A4 + B2)*khg*
      Exp[I*(khg - Conjugate[khgplpl])*(d1 + d2)] - 
     A2*Conjugate[A4 + B2]*khgplpl*
      Exp[I*(khgplpl - Conjugate[khg])*(d1 + d2)] - 
     Conjugate[B4]*(A4 + B2)*khg*
      Exp[I*(khg - Conjugate[khgmimi])*(d1 + d2)] - 
     B4*Conjugate[A4 + B2]*khgmimi*
      Exp[I*(khgmimi - Conjugate[khg])*(d1 + d2)]];

G := Re[NIntegrate[
     k Sin[x] T1, {x, 0, Pi/2}, {y, -Pi/6, -Pi/6 + afa}] + 
    NIntegrate[k Sin[x] T2, {x, 0, Pi/2}, {y, -Pi/6 + afa, Pi/6}]];

tmr := {afa, G};

Export["D://1.34.txt", Table[tmr, {afa, 0, Pi/6, 0.005}], "Table"];
POSTED BY: Henan Fang
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract