## 2 Materials and Methods
### Calculation of the Mud Pressure  
The calculation of the mud pressure of a wellbore, drilled along a principal direction, requires the Kirsch solution coupled with the strength criteria described in Section 2.1. At the boundary of the hole, the Kirsch solution in plane strain conditions (Figure 4) becomes  
\[ \begin{gathered}\sigma^{\prime}{}_{\theta}=S-p_{w}-p_{f},\\ \sigma^{\prime}{}_{r}=p_{w}-p_{f},\\ \sigma^{\prime}{}_{axis}=S_{z}-p_{f},\\ S=\sigma_{MAX}\ +\sigma_{min}\ -2(\sigma_{MAX}\ -\sigma_{min}\ ) cos2\theta,\\ S_{z}=\sigma_{z}-2\
u(\sigma_{MAX}-\sigma_{min})\cos 2\theta\end{gathered}  \tag{4}\]  
where \(\sigma_{min}\), \(\sigma_{MAX}\) and \(\sigma_{z}\) are the far field stresses, \(S\) and \(S_{z}\) are the induced state of stress, \(\theta\) is the borehole azimuth, \(p_{w}\) is the mud pressure and \(\
u\) is the Poisson ratio. Figure 4: Variables reported in Equation (4): \(\sigma_{MAX}\), \(\sigma_{min}\) and \(\sigma_{z}\) are the far field stresses; \(\theta\) is the borehole azimuth and is counted from \(\sigma_{MAX}\). \(R_{w}\) is the borehole radius and \(r\) is the radial distance; \(p_{w}\) is the mud pressure. Figure 3: (**a**) Strength envelops of the Hoek–Brown criterion adapted to anisotropic rock (HBm) for different \(\beta_{w}\). (**b**) Trend of the shale strength with \(\beta_{w}\) obtained with HBm. The analysis focuses on the combination of the effective tangential stress \(\sigma^{\prime}_{\theta}\) and radial stress \(\sigma^{\prime}_{r}\) which are both affected by the mud pressure \(p_{w}\) (we disregarded the occurrence of failure with \(\sigma^{\prime}_{axis}\)): \(\sigma_{\theta}>\sigma_{axis}>\sigma_{r}\). The coupling between Equation (4) and WPM (Equations (2a) and (2b)) gives the limit mud pressures for the weakness planes and the rock material:  
\[p_{w\_slip}=\frac{S\Big{(}1-\frac{\tan\phi^{\prime}_{w}}{\tan\beta_{w}}\Big{)} \sin 2\beta_{w}-2c^{\prime}_{w}+2\tan\phi^{\prime}_{w}p_{f}}{2\Big{[}\tan\phi^{ \prime}_{w}+\Big{(}1-\frac{\tan\phi^{\prime}_{w}}{\tan\beta_{w}}\Big{)}\sin 2 \beta_{w}\Big{]}}, \tag{5a}\] \[p_{w\_MC}=\frac{S-\sigma_{c}+p_{f}(N_{\phi}-1)}{\big{(}N_{\phi}+1\big{)}} \tag{5b}\]  
The coupling between Equation (4) and HBm gives [52]:  
\[p_{w\_H\&Bm}=\frac{4S+m_{\beta w}\sigma_{c\beta w}-\Big{[}\sigma_{c\beta w}^{2 }(m_{\beta w}^{2}+16)+8m_{\beta w}\sigma_{c\beta w}\Big{(}S-2p_{f}\Big{)}\Big{]} ^{0.5}}{8} \tag{6}\]  
The angle \(\beta_{w}\) must be determined at any azimuth \(\vartheta\) of the wellbore because it is one of the variables of Equation (5a) and is indirectly involved in Equation (6) for the calculation of the uniaxial compressive strength \(\sigma_{c\beta w}\) and the dimensionless constant \(m_{\beta w}\). The authors of [52] found the equations that relate to \(\beta_{w}\), the inclination of the weakness plane \(\delta\) and the azimuth \(\vartheta\). Figure 5 shows the change in the angle \(\beta_{w}\) with the inclination of the weakness plane \(\delta\), at different azimuth \(\vartheta\). Vertical weakness planes (\(\delta=90^{\circ}\)) seem to be uncommon in real fields [58]. Figure 5c shows horizontal weakness planes with the reference system shown in Figure 5a and with a rotation of the maximum and minimum far field stresses. This new configuration is equivalent to \(\delta=90^{\circ}\) and is here defined as \(\delta^{\star}=0^{\circ}\). In this new system, the mud pressure for avoiding slip along the horizontal weakness planes must be calculated according to the case with \(\delta=90^{\circ}\) of the original reference system (vertical planes). The mud pressures reported in Equations (5) and (6) take into account the pore fluid pressure \(p_{f}\), according to the Terzaghi principle (Equation (1)). Shales have a low permeability and immediately after drilling, the condition close to the boundary of the borehole can become undrained (no fluid flow through the rock pores). The undrained conditions can induce a change in pore fluid pressure \(\Delta p_{f}\
eq 0\) when \(R>1\) and the rock is soft.