incorrect incoming wave direction in automatic calculation of TEPA
When using automatic calculation of the incoming wave, the wave angle calculated by ARTEMIS is the combination of the incoming and the reflected wave (thx @regis.walther for notifying me about this). This leads to the code converging to the wrong results (except when the reflection coeffcient = 0)
When a wave reflects on a wall, you can determine the incoming wave angle form the combined wave angle. This is most easily seen from the figure below (it is a bit crappy, sorry): So the angle of incoming wave component (which we look for is) ¬i. This is also the angle or the reflected wave. Artemis calculates the angle of the sum of the incoming and reflected wave, which is in the figure. R is the reflection coefficient. In this figure what is physically shown is the wave potential (which is physically a vector with). You can also think of it as the wave orbital velocity vectors. Both these quantities are lineair in R (meaning that a reflected wave has a velocity vector that is R time the magnitude of the incoming wave). In case R< 1, the reflection is partial, and the two vectors in the figure do not have the same length, meaning that you can calculate the incoming wave angle form the wave angle in Artemis. Writing out the gonio, the equation you get is (everything in degrees):
I plotted this relation for different values of the reflection coefficient R. You see that for R is 0, you get a straight line, which you should have, because then the incoming wave is equal to the total wave (no reflection). You also see the problem when R gets large. For R = 1, the equation is indeterminate (meaning that you cannot determine the incoming wave from the total one). For other large values of R is already becomes difficult (because a small change in leads to large changes in i) .