a = 3; Tau = 100; T0 = 1/2; g0 = Tanh[2/T0];
z0 = (1 - g0) Tau;
s = NDSolve[{D[G[q, x], x] + (2 z0 (1 - x)^a + q^2) G[q, x] ==
Sqrt[2/Pi] q, G[0, x] == 0, G[10, x] == 0.0795932, G[q, 0] == 0.797885 q/(q^2 + 2 z0)}, G[q, x], {q, 0, 10}, {x, 0, 1}, AccuracyGoal -> 20]
Plot[(G[q, x]) /. s /. q -> 0.5, {x, 0, 1}]
P[y_, x_] := Sqrt[2/Pi] NIntegrate[Sin[q y]*G[q, x], {q, 0, 10}, AccuracyGoal -> 20]
Here, I want to use the G[q,x] from the NDSolve, as solution in the NIntegrate code of P[y,x]. But I am not able to understand how to call it. This code is working till Plot of G[q,x]. But P[y,x] is giving a lot of errors.
G
inNDSolve
.a = 3; Tau = 100; T0 = 1/2; g0 = Tanh[2/T0]; z0 = (1 - g0) Tau; sol = NDSolve[{D[G[q, x], x] + (2 z0 (1 - x)^a + q^2) G[q, x] == Sqrt[2/Pi] q, G[0, x] == 0, G[10, x] == 0.0795932, G[q, 0] == 0.797885 q/(q^2 + 2 z0)}, G, {q, 0, 10}, {x, 0, 1}, AccuracyGoal -> 20]; P[y_, x_] := Sqrt[2/Pi] NIntegrate[Sin[q y]*G[q, x] /. sol[[1]], {q, 0, 10}, AccuracyGoal -> 20]; P[3, 2]
$\endgroup$