I am having a problem using NDSolve to solve the following system of 4 equations, in 4 dependent variables $(r,t,\gamma,p_{r})$ and one independent variable $z$. Here we have:
$$ \begin{align} t &= t(z) \\ r &= r(z) \\ \gamma &= \gamma(r, t; z) \\ p_{r} &= p_{r}(r, t; z) \end{align} $$
We also have 3 known data sets called $ AA(r, t; z), BB(r, t; z) $, and $ CC(r, t; z) $ from experiment. The 4 equations are given below by total (not partial) derivatives as
$$ \begin{align} \frac{\mathrm{d}t}{\mathrm{d}z} &= \frac{\gamma}{\sqrt{\gamma^{2}-p_{r}^{2}-1}} \\ \frac{\mathrm{d}r}{\mathrm{d}z} &= \frac{p_{r}}{\sqrt{\gamma^{2}-p_{r}^{2}-1}} \\ \frac{\mathrm{d}\gamma}{\mathrm{d}z} &= \frac{\mathrm{d}r}{\mathrm{d}z} A(r, t; z) + B(r, t; z) \\ \frac{\mathrm{d}p_r}{\mathrm{d}z} &= \frac{\mathrm{d}t}{\mathrm{d}z} A(r, t; z) - C(r, t; z) \end{align} $$
But when I try to solve this using NDSolve, different errors keep popping up. For example, see this case and error below:
NDSolve[{D[t[z], z] == γ[r[z], t[z], z]/
Sqrt[γ[r[z], t[z], z]^2 - pr[r[z], t[z], z]^2 - 1],
D[r[z], z] == pr[r[z], t[z], z]/
Sqrt[γ[r[z], t[z], z]^2 - pr[r[z], t[z], z]^2 - 1],
D[γ[r[z], t[z], z], z] ==
D[r[z], z] AA[r[z], t[z], z, 0.0] + BB[r[z], t[z], z, 0.0],
D[pr[r[z], t[z], z], z] ==
D[t[z], z] AA[r[z], t[z], z, 0.0] - CC[r[z], t[z], z, 0.0],
r[0] == 0, t[0] == 0, γ[r[0], t[0], 0] == 1.1174,
pr[r[0], t[0], 0] == 0}, {r[z], t[z],
pr[r[z], t[z], z], γ[r[z], t[z], z]}, {z, 0.0, 1.76}]
NDSolve::overdet: There are fewer dependent variables, {r[z],t[z]}, than equations, so the system is overdetermined.
Originally I tried to put Dt in each left-hand side on each line, but I read in the Mathematica help about NDSolve that one should use D not Dt. It is a bit confusing and errors keep appearing.
Not sure what is it that I am doing wrong? Any suggestions on how to solve this issue?
UPDATE: user "Nasser" has asked that I clarify the defintions of AA, BB, CC functions. Since I am not able to retrieve the definition for these functions, which I call from another code file that includes C++, please use these approximate/equivalent definitions instead if needed:
AA[r_, t_, z_, k_] :=
N[-BesselJ[1, 240 r] Cos[2 Pi 11 10^9 t] Sin[(z Pi)/1.76]];
BB[r_, t_, z_, k_] :=
N[BesselJ[0, 240 r] Sin[2 Pi 11 10^9 t] Sin[(z Pi)/1.76]];
CC[r_, t_, z_, k_] :=
N[1/370 BesselJ[1, 240 r] Cos[2 Pi 11 10^9] Sin[(z Pi)/1.76]];
Please note that k here is a fixed constant (usually 0), so the variables are really just (r, t; z) here.

AA,BBandCCthere? your example does not include them. So can't really try the code fully like this. You also haver[z]but when you writepr[r, t, z]you just userinside. Too many problems to try the code like this. $\endgroup$[z]. I have fixed them (see edit). However, the problem is still there. Can you please advise on how else you would write such problem? I am a beginner so any suggestions are welcome! $\endgroup$Please feel free to use any other simple function as dummy to replace thembut I think it is you who should make your example complete. This is what MWE means. Others should not have to make extra code just to try your code, when they do not even know the context and what to add to replace these missing functions. $\endgroup$