I am trying to create a function that takes in an input $\mu$ and place that input into the replace rule for a numerical integration, as seen in the code below:
Clear["Global`*"]
x = r/R;
Subscript[U, T] = \[CapitalOmega] R (x + \[Mu] Sin[\[Psi]]);
Subscript[U, R] = \[CapitalOmega] R \[Mu] Cos[\[Psi]];
U = Sqrt[Subscript[U, T]^2 + Subscript[U, R]^2];
NIntegrate[
NIntegrate[
1/2 \[Rho] U^3 Subscript[C, Subscript[d, 0]] /. #, {r, 0,
R} /. #], {\[Psi], 0, 2 Pi} /. #] & @{R -> 1, \[CapitalOmega] ->
1, Subscript[C, Subscript[d, 0]] -> 1, \[Rho] -> 1, \[Mu] -> 1}
Subscript[P, 0][\[Mu]_] =
NIntegrate[
NIntegrate[
1/2 \[Rho] U^3 Subscript[C, Subscript[d, 0]] /. #, {r, 0,
R} /. #], {\[Psi], 0, 2 Pi} /. #] & @{R ->
1, \[CapitalOmega] -> 1,
Subscript[C, Subscript[d, 0]] -> 1, \[Rho] -> 1, \[Mu] -> \[Mu]}
Subscript[P, 0][1]
Running this code has the following result:
As you can see, simply subbing in for $\mu$ using $\mu \rightarrow 1$ works fine, but it does not work when attempted as a function. How would I set up this function to correctly send the input to the replace rule?