I’ll come back later and think of a simpler calculation and way to understand it.
Here I am again. So, let’s not start with the number crunching, but with the logic. The areas at the top and bottom are affected by the same factor, namely the house length / ridge length. Being "like terms," we can cancel out this dimension in our logical consideration, which makes it clearer. At the top (in the area to be accounted for), we should have a maximum of two-thirds of the bottom value. So we have to get rid of one-third, i.e., remove it from the relevant area (between the two 230 height lines). Into this Nirvana account we can already book the eaves-side exterior wall thicknesses in advance, because whenever the knee wall is lower than 230, they always lie entirely in the "under 230" area. Now we still have to remove the area between the 230 height lines and the interior edges of the exterior walls. We assume a symmetrical gable roof and, for simplicity, consider only half the house width (between ridge plumb line and eaves). Our house width is 905 cm in the example, half is therefore 452.5 cm. Of this, only two-thirds may remain in the accounted area, consequently we have to shift one-third (here 150.83 cm) into the Nirvana area. We have borrowed 46.5 cm (the exterior wall thickness) here, so we still need to work out 104.33 cm. This is now our target value for the length of the adjacent side. Now, as lazy people, we ask our scientific calculator what the tangent factor would be. For 45° pitch it is 1.00. We thus have to subtract 1.00 × 104.33 cm from 230 cm in order not to exceed the two-thirds measuring rod. Consequently, our knee wall is at most 125.66 cm high. We see: that is less than the desired 140 cm. Now we can consider which strategy to pick, i.e., which of the two incompatible factors we sacrifice in order to meet our specification. The knee wall height is usually more sacred to home builders than the roof pitch: so let’s fix the knee wall height at 140 cm. That is 90 cm below 230 cm. 90 to 104.33 is 0.8626. We ask the calculator oracle again: this tangent factor corresponds to a pitch of 40.78° - even a bit more than the 38° from Yvonne’s proposal, which I had roughly guessed as the target range. If old 11ant miscalculated late at night, then feel free to be Schadenfreude - otherwise the calculation method should now be clear.