I have these equations,
$$\int_\epsilon^{z_m} \frac{z_m^d dz}{z^d \sqrt{f(z) z_m^{2d} - f(z_m) z^{2d}}} - \int_\epsilon^{z_s} \frac{z_s^d dz}{z^d \sqrt{f(z) (z_s^{2d} - z^{2d})}} = 0 \tag{1}\label{1}$$
$$T = \int_0^{z_s} \frac{z^d dz}{\sqrt{f(z) (z_s^{2d} - z^{2d})}} + b \tag{2}\label{2}$$
$$T = \int_0^{z_m} \frac{-dz}{f(z) \sqrt{1 - \frac{f(z) z_m^{2d}}{f(z_m) z^{2d}}}} - t_b \tag{3}\label{3}$$
where $b$, $t_b$ are constants, $\epsilon$ can be set to any small number, $z_h < z_m < z_{m-critical}$, $z_s < z_h$.
My goal is to find $z_m$ that satisfies equation $\eqref{1}$ ($z_m$ that makes the first equation to be 0). However, I also have this $z_s$ parameter which depends on $z_m$ through $T$ (before, I was solving for $z_s$ by giving a value to $T$ but now $T$ depends on the value of $z_m$ which is what I'm trying to find in the first place). So immediately, I think I can combine equation $\eqref{2}$ $\eqref{3}$ and together with equation $\eqref{1}$ I have two equations in two unknowns.
All of these integrals can be evaluated except for the integral in $\eqref{3}$ which diverges at $z=z_h$ ($z_h$ is just a number which I show in the code). However, using the Method -> PrincipalValue
in NIntegrate
this problem can be resolved.
d = 3;
b = 0.1;
tb = 10.103;
zmcritical = 13.128;
zh = 10;
f[z_] := 1 - (z/zh)^(d + 1)
Sv[z_?NumericQ, zm_?NumericQ] := zm^d/(z^d Sqrt[zm^(2 d) f[z] - z^(2 d) f[zm]])
SA[z_?NumericQ, zs_?NumericQ] := zs^d/(z^d Sqrt[f[z] (zs^(2 d) - z^(2 d) )])
SvA[zm_?NumericQ, zs_?NumericQ] := NIntegrate[Sv[z, zm], {z, 10^-1, zm}] - NIntegrate[SA[z, zs], {z, 10^-1, zs}]
tzm[z_?NumericQ, zm_?NumericQ] := -1/(f[z] Sqrt[1 - (zm^(2 d) f[z])/(z^(2 d) f[zm])])
tzs[z_?NumericQ, zs_?NumericQ] := z^d/Sqrt[f[z] (zs^(2 d) - z^(2 d) )]
tzmzs[zm_?NumericQ, zs_?NumericQ] := NIntegrate[tzm[z, zm], {z, 0, zh, zm}, Method -> PrincipalValue] - NIntegrate[tzs[z, zs], {z, 0, zs}] - b - tb
NSolve[{SvA[zm, zs] == 0, tzmzs[zm, zs] == 0}, {zm, zs}]
NIntegrate::nlim: z = zm is not a valid limit of integration.
NIntegrate::nlim: z = zs is not a valid limit of integration.
NIntegrate::nlim: z = zs is not a valid limit of integration.
General::stop: Further output of NIntegrate::nlim will be suppressed during this calculation.
NIntegrate::ilim: Invalid integration variable or limit(s) in Reduce`ReduceVar[1].
NIntegrate::ilim: Invalid integration variable or limit(s) in Reduce`ReduceVar[1].
NIntegrate::ilim: Invalid integration variable or limit(s) in Reduce`ReduceVar[1].
General::stop: Further output of NIntegrate::ilim will be suppressed during this calculation.
NSolve[{-NIntegrate[SA[z, zs], {z, 1/10, zs}] + NIntegrate[Sv[z, zm], {z, 1/10, zm}] == 0, -10.203 - NIntegrate[tzs[z, zs], {z, 0, zs}] + NIntegrate[tzm[z, zm], {z, 0, 10, zm}, Method -> PrincipalValue] == 0}, {zm, zs}]
So problem occurs when solving those two equations in two unknowns. Another issue is that I don't know where to put the constraint zh < zm < zm-critical
and zs < zh
. If I use NIntegrate
, definitely it is not an option there. If I use Integrate
then I can put it there using Assumptions
but I cannot use Method -> PrincipalValue
.
Any suggestions or thoughts on how to go about this problem?