## 10 Reputation

4 years, 326 days

## Trying to follow...

@acer Sorry about the misunderstanding, I thought you were pointing out a wrong difinition of multiplication between the two functions, and got confused as I couldnt see such a one. The use of lowercase minimze/maximize is a flop on my side too and I changed them to the uppercases - I dont actually know the difference between lower- and uppercase in this instance.
Thanks for your help and sorry if I have offended you :/ For reference changing to uppercase and fixing the multiplication thing seems to have fixed it, and it now just complains about encountering complex numbers, which is expected. If you find time, do you know of a way to make it ignore the imaginary part of any complex numbers encountered and just use the real part?

@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

ErrorTest.mw

Now that you are at it, do you have any guesses as to what the error further up in the code could be? :P

## Full code...

whoops, here it is Solving_Cat_Body.mw

## explanation...

@akiel123 The reason theta__ps1p is currently a procedure, is because it was originally intended to just modify p__1x slightly if p__1x and p__2y are the same, so as to avoid division by zero, but for clarity i just put a 1 instead.

## Dividing by 0 when not dividing by 0...

@acer Okay, so I worked through a couple of iterations and I cant seem to solve the problem that is telling me that I am dividing by 0 in some tan statement, however I dont see a possibility of division by 0 anywhere, so I am guessing it is some deeper problem. Any suggestions?

 (1)

 (2)

CALLING PARAMETERS

p3: Joint on type-3 part     p4:joint on type-2 subpart    : min angle    : Max angle    FL1: Length of type-3 subpart     FL2: length of type-2 subpart    : Height of type-3 subpart    : Height of type-2 subpart    : Width of material used for legs    : Max diameter of spring    : Diameter of the joint.

 >

## Thanks!...

Awesome, it is working now :) replaced degrees with radians and fixde some mistyped theta__1 variables and it works now - not surprisingly there isnt any solutions for the random data in the example but that wasnt really expected either :D Once again, thanks alot!

## Smart thinking!...

Alright here goes the document. The reson for making the procedure is to not have to write the two lines of variables every time I have to call it, which is very optimal since I have to use it multiple times throughout the document (there are a multiple spring-sets to optimize) and also, in the end it is supposed to look nice and neat, so it would be prefereable to tug all the ugly details it away in its own section :)

## Reprocessed, slightly different error...

Thanks alot - As you wisely suggested, I moved the operator definitions out of the proc and used the suggest method to do this definition. Also I fixed the stupid error with wrong argument calls :) It now has a problem with d__MinCorner instead of d__min, so I guess that means progress, but as you can see it is still complaining. Checked this time and made sure that all functions are called with the proper amount of arguments :D I changed two obsolete operators into variables, but I dont see a way to convert the other operators to variables (expressions?)

 Page 1 of 1
﻿