0
$\begingroup$

I just begin to use mma this year, but i only know little about it. Could any one guide me plz.

clp[l_, p_] := Sqrt[(2 (p!))/(\[Pi] ((p + Abs[l])!))];
\[Lambda][w_] := (2 \[Pi]*c)/w;
k[w_] := w/c;
\[Sigma]0[w_] := 3*\[Lambda][w];
l[w_] := 10*\[Sigma]0[w];
f[w_] := (\[Pi]*\[Sigma]0[w]^2)/\[Lambda][w];
\[Sigma][z_, w_] := \[Sigma]0[w] Sqrt[1 + z^2/f[w]^2];
rr[z_, w_] := z + f[w]^2/z;
a[w_] := Sqrt[(p*(\[Lambda][w]*10^6)^2)/(1.37*10^18)];
ff[\[Rho]_, z_, w_, l_, p_] := ((Sqrt[2] \[Rho])/\[Sigma][z, w])^
   Abs[l]*LaguerreL[p, Abs[l], (2 \[Rho]^2)/\[Sigma][z, w]^2]* 
   E^(-(\[Rho]^2/\[Sigma][z, w]^2));

just like these above, i'm using := so many times,and i use the one defined in a new one like this

phipartialz[\[Rho]_, z_, w_, l_, p_] := -((2 c (1 + 2 p + Abs[l]))/(
    w (1 + (4 c^2 z^2)/(w^2 \[Sigma]0[w]^4)) \[Sigma]0[w]^2)) - (
   w (1 - (\[Rho]^2 (1 - (w^2 \[Sigma]0[w]^4)/(4 c^2 z^2)))/(
      2 (z + (w^2 \[Sigma]0[w]^4)/(4 c^2 z))^2)))/c;
phipartialr[\[Rho]_, z_, w_] := -((w *\[Rho])/(
   c*(z + (\[Pi]^2 \[Sigma]0[w]^4)/(z *\[Lambda][w]^2))));
ffpartialz[\[Rho]_, z_, w_, l_, 
   p_] := -((2^(2 + Abs[l]/2) c^2)/(
    w^2 ((4 c^2 \[Pi]^2 z^2)/w^2 + \[Pi]^2 \[Sigma]0[w]^4)^2))
     E^(-((\[Pi]^2 \[Rho]^2 \[Sigma]0[w]^2)/((4 c^2 \[Pi]^2 z^2)/
     w^2 + \[Pi]^2 \[Sigma]0[w]^4))) \[Pi]^(2 + Abs[l])
    z (\[Rho]/(
    Sqrt[\[Pi]^2 + (4 c^2 \[Pi]^2 z^2)/(
      w^2 \[Sigma]0[w]^4)] \[Sigma]0[w]))^
   Abs[l] (-4 \[Pi]^2 \[Rho]^2 LaguerreL[-1 + p, 1 + Abs[l], (
       2 \[Pi]^2 \[Rho]^2 \[Sigma]0[w]^2)/((4 c^2 \[Pi]^2 z^2)/
        w^2 + \[Pi]^2 \[Sigma]0[w]^4)] \[Sigma]0[w]^2 + 
     LaguerreL[p, Abs[l], (
       2 \[Pi]^2 \[Rho]^2 \[Sigma]0[w]^2)/((4 c^2 \[Pi]^2 z^2)/
        w^2 + \[Pi]^2 \[Sigma]0[w]^4)] (-2 \[Pi]^2 \[Rho]^2 \[Sigma]0[
          w]^2 + Abs[
          l] ((4 c^2 \[Pi]^2 z^2)/w^2 + \[Pi]^2 \[Sigma]0[w]^4)));
ffpartialr[\[Rho]_, z_, w_, l_, p_] := 
 2^(Abs[l]/
  2)/((1 + (4 c^2 z^2)/(w^2 \[Sigma]0[w]^4))^(3/2) \[Sigma]0[w]^3)
   E^(-(\[Rho]^2/((1 + (4 c^2 z^2)/(w^2 \[Sigma]0[w]^4)) \[Sigma]0[
     w]^2))) (\[Rho]/(
   Sqrt[1 + (4 c^2 z^2)/(w^2 \[Sigma]0[w]^4)] \[Sigma]0[w]))^(-1 + 
   Abs[l]) (-2 \[Rho]^2 (2 LaguerreL[-1 + p, 1 + Abs[l], (
         2 \[Rho]^2)/((1 + (4 c^2 z^2)/(
            w^2 \[Sigma]0[w]^4)) \[Sigma]0[w]^2)] + 
       LaguerreL[p, Abs[l], (
        2 \[Rho]^2)/((1 + (4 c^2 z^2)/(w^2 \[Sigma]0[w]^4)) \[Sigma]0[
          w]^2)]) + 
    Abs[l] LaguerreL[p, Abs[l], (
      2 \[Rho]^2)/((1 + (4 c^2 z^2)/(w^2 \[Sigma]0[w]^4)) \[Sigma]0[
        w]^2)] (1 + (4 c^2 z^2)/(w^2 \[Sigma]0[w]^4)) \[Sigma]0[w]^2)

and finally my goal is to calculate an NIntegrate, for example:

iA1[\[Theta]_, w_, ll_, pp_] := 
  2 \[Pi]*h0[w, ll, pp]*
   NIntegrate[\[Rho]*aa[\[Rho], z, w, ll, pp]*
     BesselJ[2 ll, 2 k[w]*\[Rho]*Sin[\[Theta]]]*
     Cos[2 \[Psi][\[Rho], z, \[Theta], w, ll, pp]], {z, -l[w]/2, 
     l[w]/2}, {\[Rho], 0, \[Sigma][z, w]}, MaxRecursion -> 100, 
    AccuracyGoal -> Infinity];

However the result seems to go wrong and the total calculation takes hours(to calculate various angles and omega). But i can't really fix this. Any suggustions will help.

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.