  Reconfigurable Intelligent Surfaces (RISs) have emerged as a promising
technology for enhancing satellite communication systems by manipulating the
phase of electromagnetic waves. This study addresses optimising phase shift
values (\phi_{R}) in RIS networks under both ideal and non-ideal conditions.
For ideal scenarios, we introduce a novel approach that simplifies the
traditional optimisation methods for determining the optimal value. Leveraging
trigonometric identities and the law of cosines, we create a more tractable
formulation for the received power that allows for efficient optimisation of
\phi_{R}. However, practical applications often grapple with non-ideal
conditions. These conditions can introduce phase errors, significantly
affecting the received signal and overall system performance. To accommodate
these complexities, our optimisation framework extends to include phase errors,
which are modelled as a uniform distribution. To solve this optimisation
problem, we propose a stochastic framework that harnesses the Monte Carlo
method to consider all plausible phase error values. Furthermore, we employ the
Broyden Fletcher Goldfarb Shanno (BFGS) algorithm, an iterative method known
for its efficacy. This algorithm systematically updates \phi_{R} values,
incorporating the gradient of the objective function and Hessian matrix
approximations. The algorithm also monitors convergence to balance
computational complexity and accuracy. The results of the theoretical analysis
are illustrated with several examples. As herein demonstrated, the proposed
solution offers profound insights into the impacts of phase errors on RIS
system performance. It also unveils innovative optimisation strategies for
real-world satellite communication scenarios under diverse conditions.
