Example 4 As shown in Figure $5, \triangle A B C$'s area is three times the area of its inscribed rectangle $P Q R S$, and the values of side $B C$ and height $A D$ are rational numbers. Under what conditions is the perimeter of rectangle $P Q R S$ a rational number? Under what conditions is it an irrational number?
Solution: Let $BC=a$, $AD=h$, $PQ=m$, $PS=n$.
From equation (1), we get $\frac{h-n}{h}=\frac{m}{a}$, which means $mh + an = ah$.
Also, $mn = \frac{1}{3} \times \frac{1}{2} ah = \frac{1}{6} ah$, so,
$mhan = \frac{1}{6} a^2 h^2$.
From equations (1) and (2), we know that $hm$ and $an$ are the two roots of the equation $x^2 - ahx + \frac{1}{6} a^2 h^2 = 0$.
Solving this equation, we get $x_1, x_2 = \frac{1}{6}(3 \pm \sqrt{3}) ah$.
Therefore, the perimeter of rectangle $PQRS$ is
$$
2(m+n) = a + h \pm \frac{\sqrt{3}}{3}(a - h).
$$

Thus, when $a = h$, the perimeter of rectangle $PQRS$ is a rational number; when $a \neq h$, the perimeter of rectangle $PQRS$ is an irrational number.

From the above four examples, it can be seen that mathematics competitions are closely linked to textbook knowledge. Example 1 derives new conclusions under the original conditions, Example 3 and Example 4 change the conditions, and Example 2 is the converse of the original problem. Although these four examples have undergone significant changes from the original problem, the properties of similar triangles remain unchanged, truly embodying the principle that "all changes are within the scope of the fundamental principles."