2
$\begingroup$

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?

$\endgroup$

1 Answer 1

1
+50
$\begingroup$

Probably there is no solution in the range you are looking for. To show this we can visualize solution of two equations with using ContourPlot[] as follows

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

pic = {ContourPlot[{SvA[zm, zs] == 0}, {zm, 12.5, 13.1279}, {zs, 8, 
    9.99}, ContourStyle -> Blue], 
  ContourPlot[{tzmzs[zm, zs] == 0}, {zm, 12.5, 13.1279}, {zs, 8, 
    9.99}, ContourStyle -> Red]}

Show[pic]

Figure 1

$\endgroup$
5
  • $\begingroup$ Each point of the blue line is where each pair (zm,zs) satisfies $\eqref{1}$ right? So it means from that I can already conclude what zm will make $\eqref{1}$ equal to zero given the zs from the pair, although the red line just shows that the constraint of $\eqref{2}$ $\eqref{3}$ will not produce the same pair of (zm,zs) right? $\endgroup$
    – mathemania
    Commented Aug 1, 2021 at 15:15
  • $\begingroup$ Also, from the plot of SvA[zm,zs] (blue line), what does SvA[12.8, 9] = 0.00319888 mean? (12.8, 9) is not on the blue line but SvA[12.8, 9] produces a value, albeit small. $\endgroup$
    – mathemania
    Commented Aug 1, 2021 at 15:29
  • $\begingroup$ @mathemania The blue line consist of solution of equation SvA[zm, zs] == 0, and red line consist of solution of equation tzmzs[zm, zs] == 0. The crossing of two lines consists of solution two equations { SvA[zm, zs] == 0, tzmzs[zm, zs] == 0`. Unfortunately there is no crossing points in the region you are looking for. $\endgroup$ Commented Aug 1, 2021 at 19:29
  • $\begingroup$ I see. However, suppose I can modify the constraints or study the system I am using so as to accommodate a solution of the two equations, how can I make my code work as in my post? NSolve produces an error. $\endgroup$
    – mathemania
    Commented Aug 1, 2021 at 23:09
  • $\begingroup$ @mathemania In numerical computation we also can use FindRoot[]. First we can estimate solution with ContourPlot and then solve it with FindRoot , for example FindRoot[{SvA[zm, zs] == 0, tzmzs[zm, zs] + 7 == 0}, {{zm, 13.08}, {zs, 9.9}}, PrecisionGoal -> 6, AccuracyGoal -> 3] we have out {zm -> 13.0884, zs -> 9.93653} $\endgroup$ Commented Aug 2, 2021 at 0:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.