Skip to main content
edited body
Source Link

The code does not run properly due many simple issues. First, we cannot use brackets and braces in the functionsfunction definitions because Mathematica will comprehend differently from conventional math. Secondly, the functions V11,V12,V21 and V22 can be neglected and just use V1 and V2 with the proper Tkin variable. The functions VAA and VBB can be erased because VA and VB have the same definition. Ultimately, the angle $\theta$ needs a value.

f1 = 0.0;
f2 = 0.0;
f3 = -9.0;       (*fN*)
T = 300;         (*K*)
\[Nu] = 1.002;   (*(fN*s)/\[Mu]m^2*)

r[0] = 0.5;      (*\[Mu]m*)
r[1] = 0.2;      (*\[Mu]m*)
r[2] = 0.8;      (*\[Mu]m*)

\[Gamma][0] = 6 \[Pi] \[Nu] r[0];  
\[Gamma][1] = 6 \[Pi] \[Nu] r[1];
\[Gamma][2] = 6 \[Pi] \[Nu] r[2];

(*15.1098*)
(*3.77745*)


\[Theta] = 3.14;


V1[x_] := (1/\[Gamma][1]) (f2 - 
     f3 (((x - T)/T) Cos[\[Theta]] Sin[\[Theta]])/(\[Gamma][
           1]/\[Gamma][0] + ((x - T)/T) (Sin[\[Theta]])^2));
V2[y_] := (1/\[Gamma][2]) (f2 - 
     f3 (((y - T)/T) Cos[\[Theta]] Sin[\[Theta]])/(\[Gamma][
           2]/\[Gamma][0] + ((y - T)/T) (Sin[\[Theta]])^2));



VA[Tkin1_, 
   Tkin2_, \[Phi]1_, \[Phi]2_] := {{V1[Tkin1] Sin[\[Phi]1] - 
     V1 [Tkin2] Sin[\[Phi]2], 
    V1[Tkin1] Cos[\[Phi]1] + V1[Tkin2] Cos[\[Phi]2]}};
VB[Tkin1_, 
   Tkin2_, \[Phi]1_, \[Phi]2_] := {{V2[Tkin1] Sin[\[Phi]1] - 
     V2[Tkin2] Sin[\[Phi]2], 
    V2[Tkin1] Cos[\[Phi]1] - V2[Tkin2] Cos[\[Phi]2]}};

delta[Tkin1_, Tkin2_, \[Phi]1_, \[Phi]2_] := 
  ArcCos[(VA[Tkin1, Tkin2, \[Phi]1, \[Phi]2].Transpose[
       VB[Tkin1, Tkin2, \[Phi]1, \[Phi]2]])/(Norm[
       VA[Tkin1, Tkin2, \[Phi]1, \[Phi]2]] Norm[
       VB[Tkin1, Tkin2, \[Phi]1, \[Phi]2]])];

\[Phi]1 = \[Pi]/3;
\[Phi]2 = \[Pi]/4;



Plot3D[delta[Tkin1, Tkin2, \[Phi]1, \[Phi]2], {Tkin1, 300, 
  1000}, {Tkin2, 300, 1000}, 
 AxesLabel -> {"Tkin1", "Tkin2", "\[Gamma]"}, 
 ColorFunction -> "BrownCyanTones", PlotRange -> Automatic]

The plot of the angle $\gamma$$\Delta$ will be

enter image description here

Surely this code can be improved in order to get a more elegant and fine working algorithm.

The code does not run properly due many simple issues. First, we cannot use brackets and braces in the functions definitions because Mathematica will comprehend differently from conventional math. Secondly, the functions V11,V12,V21 and V22 can be neglected and just use V1 and V2 with the proper Tkin variable. The functions VAA and VBB can be erased because VA and VB have the same definition. Ultimately, the angle $\theta$ needs a value.

f1 = 0.0;
f2 = 0.0;
f3 = -9.0;       (*fN*)
T = 300;         (*K*)
\[Nu] = 1.002;   (*(fN*s)/\[Mu]m^2*)

r[0] = 0.5;      (*\[Mu]m*)
r[1] = 0.2;      (*\[Mu]m*)
r[2] = 0.8;      (*\[Mu]m*)

\[Gamma][0] = 6 \[Pi] \[Nu] r[0];  
\[Gamma][1] = 6 \[Pi] \[Nu] r[1];
\[Gamma][2] = 6 \[Pi] \[Nu] r[2];

(*15.1098*)
(*3.77745*)


\[Theta] = 3.14;


V1[x_] := (1/\[Gamma][1]) (f2 - 
     f3 (((x - T)/T) Cos[\[Theta]] Sin[\[Theta]])/(\[Gamma][
           1]/\[Gamma][0] + ((x - T)/T) (Sin[\[Theta]])^2));
V2[y_] := (1/\[Gamma][2]) (f2 - 
     f3 (((y - T)/T) Cos[\[Theta]] Sin[\[Theta]])/(\[Gamma][
           2]/\[Gamma][0] + ((y - T)/T) (Sin[\[Theta]])^2));



VA[Tkin1_, 
   Tkin2_, \[Phi]1_, \[Phi]2_] := {{V1[Tkin1] Sin[\[Phi]1] - 
     V1 [Tkin2] Sin[\[Phi]2], 
    V1[Tkin1] Cos[\[Phi]1] + V1[Tkin2] Cos[\[Phi]2]}};
VB[Tkin1_, 
   Tkin2_, \[Phi]1_, \[Phi]2_] := {{V2[Tkin1] Sin[\[Phi]1] - 
     V2[Tkin2] Sin[\[Phi]2], 
    V2[Tkin1] Cos[\[Phi]1] - V2[Tkin2] Cos[\[Phi]2]}};

delta[Tkin1_, Tkin2_, \[Phi]1_, \[Phi]2_] := 
  ArcCos[(VA[Tkin1, Tkin2, \[Phi]1, \[Phi]2].Transpose[
       VB[Tkin1, Tkin2, \[Phi]1, \[Phi]2]])/(Norm[
       VA[Tkin1, Tkin2, \[Phi]1, \[Phi]2]] Norm[
       VB[Tkin1, Tkin2, \[Phi]1, \[Phi]2]])];

\[Phi]1 = \[Pi]/3;
\[Phi]2 = \[Pi]/4;



Plot3D[delta[Tkin1, Tkin2, \[Phi]1, \[Phi]2], {Tkin1, 300, 
  1000}, {Tkin2, 300, 1000}, 
 AxesLabel -> {"Tkin1", "Tkin2", "\[Gamma]"}, 
 ColorFunction -> "BrownCyanTones", PlotRange -> Automatic]

The plot of the angle $\gamma$ will be

enter image description here

Surely this code can be improved in order to get a more elegant and fine working algorithm.

The code does not run properly due many simple issues. First, we cannot use brackets and braces in the function definitions because Mathematica will comprehend differently from conventional math. Secondly, the functions V11,V12,V21 and V22 can be neglected and just use V1 and V2 with the proper Tkin variable. The functions VAA and VBB can be erased because VA and VB have the same definition. Ultimately, the angle $\theta$ needs a value.

f1 = 0.0;
f2 = 0.0;
f3 = -9.0;       (*fN*)
T = 300;         (*K*)
\[Nu] = 1.002;   (*(fN*s)/\[Mu]m^2*)

r[0] = 0.5;      (*\[Mu]m*)
r[1] = 0.2;      (*\[Mu]m*)
r[2] = 0.8;      (*\[Mu]m*)

\[Gamma][0] = 6 \[Pi] \[Nu] r[0];  
\[Gamma][1] = 6 \[Pi] \[Nu] r[1];
\[Gamma][2] = 6 \[Pi] \[Nu] r[2];

(*15.1098*)
(*3.77745*)


\[Theta] = 3.14;


V1[x_] := (1/\[Gamma][1]) (f2 - 
     f3 (((x - T)/T) Cos[\[Theta]] Sin[\[Theta]])/(\[Gamma][
           1]/\[Gamma][0] + ((x - T)/T) (Sin[\[Theta]])^2));
V2[y_] := (1/\[Gamma][2]) (f2 - 
     f3 (((y - T)/T) Cos[\[Theta]] Sin[\[Theta]])/(\[Gamma][
           2]/\[Gamma][0] + ((y - T)/T) (Sin[\[Theta]])^2));



VA[Tkin1_, 
   Tkin2_, \[Phi]1_, \[Phi]2_] := {{V1[Tkin1] Sin[\[Phi]1] - 
     V1 [Tkin2] Sin[\[Phi]2], 
    V1[Tkin1] Cos[\[Phi]1] + V1[Tkin2] Cos[\[Phi]2]}};
VB[Tkin1_, 
   Tkin2_, \[Phi]1_, \[Phi]2_] := {{V2[Tkin1] Sin[\[Phi]1] - 
     V2[Tkin2] Sin[\[Phi]2], 
    V2[Tkin1] Cos[\[Phi]1] - V2[Tkin2] Cos[\[Phi]2]}};

delta[Tkin1_, Tkin2_, \[Phi]1_, \[Phi]2_] := 
  ArcCos[(VA[Tkin1, Tkin2, \[Phi]1, \[Phi]2].Transpose[
       VB[Tkin1, Tkin2, \[Phi]1, \[Phi]2]])/(Norm[
       VA[Tkin1, Tkin2, \[Phi]1, \[Phi]2]] Norm[
       VB[Tkin1, Tkin2, \[Phi]1, \[Phi]2]])];

\[Phi]1 = \[Pi]/3;
\[Phi]2 = \[Pi]/4;



Plot3D[delta[Tkin1, Tkin2, \[Phi]1, \[Phi]2], {Tkin1, 300, 
  1000}, {Tkin2, 300, 1000}, 
 AxesLabel -> {"Tkin1", "Tkin2", "\[Gamma]"}, 
 ColorFunction -> "BrownCyanTones", PlotRange -> Automatic]

The plot of the angle $\Delta$ will be

enter image description here

Surely this code can be improved in order to get a more elegant and fine working algorithm.

Source Link

The code does not run properly due many simple issues. First, we cannot use brackets and braces in the functions definitions because Mathematica will comprehend differently from conventional math. Secondly, the functions V11,V12,V21 and V22 can be neglected and just use V1 and V2 with the proper Tkin variable. The functions VAA and VBB can be erased because VA and VB have the same definition. Ultimately, the angle $\theta$ needs a value.

f1 = 0.0;
f2 = 0.0;
f3 = -9.0;       (*fN*)
T = 300;         (*K*)
\[Nu] = 1.002;   (*(fN*s)/\[Mu]m^2*)

r[0] = 0.5;      (*\[Mu]m*)
r[1] = 0.2;      (*\[Mu]m*)
r[2] = 0.8;      (*\[Mu]m*)

\[Gamma][0] = 6 \[Pi] \[Nu] r[0];  
\[Gamma][1] = 6 \[Pi] \[Nu] r[1];
\[Gamma][2] = 6 \[Pi] \[Nu] r[2];

(*15.1098*)
(*3.77745*)


\[Theta] = 3.14;


V1[x_] := (1/\[Gamma][1]) (f2 - 
     f3 (((x - T)/T) Cos[\[Theta]] Sin[\[Theta]])/(\[Gamma][
           1]/\[Gamma][0] + ((x - T)/T) (Sin[\[Theta]])^2));
V2[y_] := (1/\[Gamma][2]) (f2 - 
     f3 (((y - T)/T) Cos[\[Theta]] Sin[\[Theta]])/(\[Gamma][
           2]/\[Gamma][0] + ((y - T)/T) (Sin[\[Theta]])^2));



VA[Tkin1_, 
   Tkin2_, \[Phi]1_, \[Phi]2_] := {{V1[Tkin1] Sin[\[Phi]1] - 
     V1 [Tkin2] Sin[\[Phi]2], 
    V1[Tkin1] Cos[\[Phi]1] + V1[Tkin2] Cos[\[Phi]2]}};
VB[Tkin1_, 
   Tkin2_, \[Phi]1_, \[Phi]2_] := {{V2[Tkin1] Sin[\[Phi]1] - 
     V2[Tkin2] Sin[\[Phi]2], 
    V2[Tkin1] Cos[\[Phi]1] - V2[Tkin2] Cos[\[Phi]2]}};

delta[Tkin1_, Tkin2_, \[Phi]1_, \[Phi]2_] := 
  ArcCos[(VA[Tkin1, Tkin2, \[Phi]1, \[Phi]2].Transpose[
       VB[Tkin1, Tkin2, \[Phi]1, \[Phi]2]])/(Norm[
       VA[Tkin1, Tkin2, \[Phi]1, \[Phi]2]] Norm[
       VB[Tkin1, Tkin2, \[Phi]1, \[Phi]2]])];

\[Phi]1 = \[Pi]/3;
\[Phi]2 = \[Pi]/4;



Plot3D[delta[Tkin1, Tkin2, \[Phi]1, \[Phi]2], {Tkin1, 300, 
  1000}, {Tkin2, 300, 1000}, 
 AxesLabel -> {"Tkin1", "Tkin2", "\[Gamma]"}, 
 ColorFunction -> "BrownCyanTones", PlotRange -> Automatic]

The plot of the angle $\gamma$ will be

enter image description here

Surely this code can be improved in order to get a more elegant and fine working algorithm.