θ[α_, γ_, W_, J_, N_] := J*α/N

θ[Pi/3, 1/120, 1250, 100, 500]

P[α_, γ_, W_, J_, N_] := -W*
        Tan[α/2 - θ[α, γ, W, J, N]]

N[P[Pi/3, 1/120, 1250, 100, 500]]

B[α_, γ_, W_, J_, N_] := 
      Sqrt[P[α, γ, W, J, N]^2 + W^2]

N[B[Pi/3, 1/120, 1250, 100, 500]]

δ[α_, γ_, W_, J_, 
        N_] := (Pi - α + 2  θ[α, γ, W, J, N])/
        2

N[δ[Pi/3, 1/120, 1250, 100, 500], 5]

R[α_, γ_, W_, J_, N_] := 
      B[α, γ, W, J, N]*
        Sin[γ/2]/
          Sin[Pi - γ/2 - δ[α, γ, W, J, 
                N]]

N[R[Pi/3, 1/120, 1250, 100, 500], 5]

L[α_, γ_, W_, J_, N_] := 
      B[α, γ, W, J, N]*
        Sin[γ/2]/
          Sin[δ[α, γ, W, J, N] - γ/2]

DD[α_, γ_, W_, J_, 
        N_] := (2  P[α, γ, W, J, N] + 
            R[α, γ, W, J, N] - 
            L[α, γ, W, J, N])/2

N[DD[Pi/3, 1/120, 1250, 100, 500]]

\(Plot[DD[Pi/3, 1/120, 1250, j, 500], {j, 0, 499}, 
      AxesLabel -> {"J", \*""\!\(D\_J\)O""}, 
      PlotPoints -> 160]\)

aj[α_, γ_, W_, J_, 
        N_] := (R[α, γ, W, J, N] + 
            L[α, γ, W, J, N])/2

N[aj[Pi/3, 1/120, 1250, 250, 500]]

PpD[α_, γ_, W_, J_, 
        N_] := (Sin[δ[α, γ, W, J, 
                N]]*(L[α, γ, W, J, N] - 
                R[α, γ, W, J, N]))/2

PpRp[α_, γ_, W_, J_, 
        N_] := (Sin[δ[α, γ, W, J, N] - γ/
                    2]*(R[α, γ, W, J, N] + 
                  L[α, γ, W, J, N]))/(2*
              Cos[γ/2]) + (Sin[δ[α, γ, W, J, 
                  N]]*((L[α, γ, W, J, N] - 
                    R[α, γ, W, J, N])))/2

bj[α_, γ_, W_, J_, N_] := 
      Sqrt[PpRp[α, γ, W, J, N]^2 - 
          PpD[α, γ, W, J, N]^2]

N[bj[Pi/3, 1/120, 1250, 250, 500]]

\(Plot[{aj[Pi/3, 1/120, 1250, j, 500], 
        bj[Pi/3, 1/120, 1250, j, 500]}, {j, 0, 499}, 
      AxesLabel -> {"J", \*""\!\(D\_J\)O""}, 
      PlotPoints -> 160]\)

Sqrt[(D[
                  aj[α, γ, W, J, 
                    N], α]^2)*(Ua)^2  +  (D[
                  aj[α, γ, W, J, 
                    N], γ]^2)*(Ug)^2 + (D[
                  aj[α, γ, W, J, N], 
                  W]^2)*(Uw)^2];

Uaj[α_, γ_, W_, J_, N_, Ua_, Ug_, 
          Uw_] = %;

N[Uaj[Pi/3, 1/120, 1250, 0, 
          865, (0.57735*Pi/180), (0.0135898*Pi/180), 
          3.5]]*2

Sqrt[(D[
                  bj[α, γ, W, J, 
                    N], α]^2)*(Ua)^2  +  (D[
                  bj[α, γ, W, J, 
                    N], γ]^2)*(Ug)^2 + (D[
                  bj[α, γ, W, J, N], 
                  W]^2)*(Uw)^2];

Ubj[α_, γ_, W_, J_, N_, Ua_, Ug_, 
          Uw_] = %;

N[Ubj[Pi/3, 1/120, 1250, 0, 
          865, (0.57735*Pi/180), (0.0135898*Pi/180), 
          3.5]]*2

Sqrt[(D[
                  DD[α, γ, W, J, 
                    N], α]^2)*(Ua)^2  +  (D[
                  DD[α, γ, W, J, 
                    N], γ]^2)*(Ug)^2 + (D[
                  DD[α, γ, W, J, N], 
                  W]^2)*(Uw)^2];

Udj[α_, γ_, W_, J_, N_, Ua_, Ug_, 
          Uw_] = %;

N[Udj[Pi/3, 1/120, 1250, 0, 
          865, (0.57735*Pi/180), (0.0135898*Pi/180), 
          3.5]]*2

U[α_, γ_, W_, J_, N_, Ua_, Ug_, Uw_] = 
        Sqrt[(D[DD[α, γ, W, J, 
                      N], α]^2)*(Ua)^2  +  (D[
                    DD[α, γ, W, J, 
                      N], γ]^2)*(Ug)^2 + (D[
                    DD[α, γ, W, J, N], 
                    W]^2)*(Uw)^2];

N[U[Pi/3, 1/120, 1250, 0, 
          865, (0.57735*Pi/180), (0.0135898*Pi/180), 
          3.5]]*2

\(Plot[
      U[Pi/3, 1/120, 1250, 125, 500, Ua, 0, 3.5], {Ua, 
        0, \((Pi/3)\)/
          1000}, 
AxesLabel -> {"U(α)", \*""(Subscript[U, C])""}]\)

\(Plot[
      U[Pi/3, 1/120, 1250, 125, 500, 0, Ug, 3.5], {Ug, 
        0, \((1/120)\)/
          1000}, 
AxesLabel -> {"U(γ)", \*""(Subscript[U, C])""}]\)

\(Plot[
      U[Pi/3, 1/120, 1250, J
, 
        866, \((Pi/3)\)/50, \((1/120)\)/1000, 1.5], {J, 0, 865}, 
      AxesLabel -> {"J", \*""\!\(U\_C\)""}, 
      PlotPoints -> 160]\)

({{\(Plot3D[
            U[Pi/3, 1/120, 1250, 125, 500, Ua, Ug, 
              1.5], {Ua, \((0.57735*
                    Pi/180)\) - \((0.57735*
                      Pi/180)\)*0.25, 
\((0.57735*
                    Pi/180)\) + \((0.57735*
                      Pi/180)\)*0.25}, 
{Ug, \((0.0135898*
                    Pi/180)\) - \((0.0135898*Pi/180)\)*0.25, \((0.0135898*
                    Pi/180)\) + \((0.0135898*
                      Pi/180)\)*0.25}, 
AxesLabel -> {"       u(α)", "          u(γ)", \*""(Subscript[u, C])((Subscript[d, J])\!\(\()\_\\ \\ \\ \\ \)\)""}, 
            TextStyle -> {FontFamily -> "Arial", 
                FontSize -> 10}]\)}, {\[Placeholder]}})

ca[α_, γ_, W_, J_, N_] = 
        D[DD[α, γ, W, J, N], α];

\(Plot[ca[Pi/3, 1/120, 1250, J
, 866], {J, 0, 865}, 
      AxesLabel -> {"J", \*""\!\(c\_α\)""}, 
      PlotPoints -> 866]\)

cg[α_, γ_, W_, J_, N_] = 
        D[DD[α, γ, W, J, N], γ];

\(Plot[cg[Pi/3, 1/120, 1250, J
, 866], {J, 0, 865}, 
      AxesLabel -> {"J", \*""\!\(c\_γ\)""}, 
      PlotPoints -> 866]\)

cW[α_, γ_, W_, J_, N_] = 
        D[DD[α, γ, W, J, N], W];

\(Plot[cW[Pi/3, 1/120, 1250, J
, 866], {J, 0, 865}, 
      AxesLabel -> {"J", \*""\!\(c\_W\)""}, 
      PlotPoints -> 866]\)

OutputDir = "C:\\ModelOutput\\";

\(\(Export[
        OutputDir <> "J.txt", 
Transpose
[
{
Table[
              U[Pi/3, 1/120, 1250, J, 866, \((Pi/3)\)/1000, \((1/120)\)/1000, 
                3.5], {J, 0, 865, 
                1}]
}
]
, "CSV"];\)\)

\(\(Export[
        OutputDir <> "Ua.txt", 
Transpose
[
{
Table[
              U[Pi/3, 1/120, 1250, 125, 500, Ua, \((1/120)\)/1000, 3.5], {Ua, 
                0, \((Pi/3)\)/1000, \((Pi/3)\)/
                  100000}]
}
]
, "CSV"];\)\)

\(\(Export[
        OutputDir <> "Ug.txt", 
Transpose
[
{
Table[
              U[Pi/3, 1/120, 1250, 125, 500, \((Pi/3)\)/1000, Ug, 3.5], {Ug, 
                0, \((1/120)\)/1000, \((1/120)\)/
                  100000}]
}
]
, "CSV"];\)\)

Export[
        OutputDir <> "UC.txt", 
Table[
          U[Pi/3, 1/120, 1255, 125, 500, Ua, Ug, 1.5], {Ua, 
            0, (Pi/3)/1000, (Pi/3)/100000}, 
{Ug, 
            0, (1/120)/1000,  (1/120)/
              100000}]
, "CSV"];

\(\(Export[
        OutputDir <> "Uc_j.txt", 
Transpose
[
{
Table[
              U[Pi/3, 1/120, 1250, J, 
                865, \((0.57735*Pi/180)\), \((0.0135898*Pi/180)\), 1.5], {J, 
                0, 865, 
                1}]
}
]
, "CSV"];\)\)

\(\(\(Export[
        OutputDir <> "dj.txt", 
Transpose
[
{
Table[
              N[DD[Pi/3, 1/120, 1250, J, 865]], {J, 0, 865, 
                1}]
}
]
, "CSV"];\)\(
\)
    \)\)

\(\(Export[
        OutputDir <> "aj.txt", 
Transpose
[
{
Table[
              N[aj[Pi/3, 1/120, 1250, J, 865]], {J, 0, 865, 
                1}]
}
]
, "CSV"];\)\)

\(\(Export[
        OutputDir <> "bj.txt", 
Transpose
[
{
Table[
              N[bj[Pi/3, 1/120, 1250, J, 865]], {J, 0, 865, 
                1}]
}
]
, "CSV"];\)\)

\(\(Export[
        OutputDir <> "Uaj_j.txt", 
Transpose
[
{
Table[
              Uaj[Pi/3, 1/120, 1250, J, 
                865, \((0.57735*Pi/180)\), \((0.0135898*Pi/180)\), 1.5], {J, 
                0, 865, 
                1}]
}
]
, "CSV"];\)\)

\(\(Export[
        OutputDir <> "Ubj_j.txt", 
Transpose
[
{
Table[
              Ubj[Pi/3, 1/120, 1250, J
, 
                865, \((0.57735*Pi/180)\), \((0.0135898*Pi/180)\), 1.5], {J, 
                0, 865, 
                1}]
}
]
, "CSV"];\)\)

\(\(Export[
        OutputDir <> "Udj_ua.txt", 
Transpose
[
{
Table[
              U[Pi/3, 1/120, 1250, 125, 
500, 
                Ua, \((0.0135898*Pi/180)\), 
                1.5], {Ua, \((0.57735*
                      Pi/180)\) - \((0.57735*
                        Pi/180)\)*0.25, 
\((0.57735*
                      Pi/180)\) + \((0.57735*
                        Pi/180)\)*0.25, \((\((0.57735*Pi/180)\)*0.5)\)/
                  1000}]
}
]
, "CSV"];\)\)

\(\(Export[
        OutputDir <> "Udj_ug.txt", 
Transpose
[
{
Table[
              U[Pi/3, 1/120, 1250, 
                125, 
500, \((0.57735*Pi/180)\), Ug, 
                1.5], {Ug, \((0.0135898*
                      Pi/180)\) - \((0.0135898*
                        Pi/180)\)*0.25, 
\((0.0135898*
                      Pi/180)\) + \((0.0135898*
                        Pi/180)\)*0.25, \((\((0.0135898*Pi/180)\)*0.5)\)/
                  1000}]
}
]
, "CSV"];\)\)

\(\(Export[
        OutputDir <> "ca_j.txt", 
Transpose
[
{
Table[
              N[ca[Pi/3, 1/120, 1250, J, 865]], {J, 0, 865, 
                1}]
}
]
, "CSV"];\)\)

\(\(Export[
        OutputDir <> "cg_j.txt", 
Transpose
[
{
Table[
              N[cg[Pi/3, 1/120, 1250, J, 865]], {J, 0, 865, 
                1}]
}
]
, "CSV"];\)\)

\(\(Export[
        OutputDir <> "cW_j.txt", 
Transpose
[
{
Table[
              N[cW[Pi/3, 1/120, 1250, J, 865]], {J, 0, 865, 
                1}]
}
]
, "CSV"];\)\)