@acer Sorry for the late reply. F__Msl is supposed to be a multiplication between the value returned buy F__s1a and that from b__1, so this is the correct difinition, right?
As for bestangles, I am trying to find the two F__Msl values with lowest difference, based on a configuration of three angles, and the same spring (the length of which is defined by lr__s which in turn is based on theta__4. This is incorrectly defined in the code I see now, but I dont think it should have an impact on the current proble).
The errors further up in the code are a seperate problem that I am working to solve :D But they store the constants they should, and which are relevant for bestangles so I dont think they should have an impact.
As for all the square roots, they are a ton of pythagoras' sentences, which are used to calculate lengths critical to the result, so I unfortuneatly dont think that they can be avoided :/
I made an edited document with most if not all of the irrelevant code removed
Now that you are at it, do you have any guesses as to what the error further up in the code could be? :P