The issue appears to be in the calculation of the 'G' and 'C' matrices within the 'Panel' function. The values of 'PC', 'P1', and 'P2' in the test script result in the following vectors:
- r0 = [2; 0; 0]
- r1 = [1; 1; 0]
- r2 = [-1; 1; 0]
However, when the 'Main.m' file is called, the vectors are:
- r0 = [0; 1; 0]
- r1 = [0.5; 0.5; 0]
- r2 = [0.5; -0.5; 0]
Looking at the plot of the 'P', 'G', and 'C' matrices, the control points seem to be positioned at midpoints between the chords along the span.
Please verify if this is the intended location for the control points. The method for calculating the points in the 'G' matrix, i.e. the vortex endpoints, is unclear.
Debugging the calculation of the 'G' matrix should help resolve the issue.
I believe this will assist you!