11 Replies Latest reply on Feb 20, 2014 9:07 PM by Bevin Pettitt

    Mathematical question on SW's geometric solution

    Bevin Pettitt

      I had what I thought was a straightforward geometry problem, but found I could not solve it mathematically.because of too many unknowns.


      I then sketched it in SW Part, and SW solved it.  I would like to know how, which I guess is a question for mathematicians or the SW software designers.


      The following image shows the SW sketch with the three known dimensions.  


      SW geom quest.JPG


      As you can see, the sketch is fully defined. 


      How does SW do this , or is there a simple mathematical solution that I have missed?




      PS.  I am retired but like to keep my maths brain active, and usually will attempt to find a solution before resorting to SW.

        • Re: Mathematical question on SW's geometric solution
          Dave Laban

          By inspection they're similar triangles, therefore the two unknown (ie, not 90deg) angles are the same.  Therefore only need to solve one unknown (I've gone for the smaller of the angles).




          150 = 50cosX + 300tanX




          3 = cosX + 6tanX



          Which looks like it should be solvable for X but I can't for the life of me remember my trig identities right now.


          I think?

            • Re: Mathematical question on SW's geometric solution
              Fredrik Karlsson

              ...and to make it fully constrained you need a few (not visible) assumptions: perpendicular, coincident...  :-)

              • Re: Mathematical question on SW's geometric solution
                Bevin Pettitt

                Back again,

                Thanks everyone for the replies.



                Yes I had tried that approach, one which I found to be the least complicated.  But unfortunately it was not successful:


                3 = cosx + 6tanx

                I apllied the standard trig function equivalents which are:

                sin^2x + cos^2x = 1

                tanx = sinx/cosx

                and these produced

                cosx = 1/ (square root of (1+ tan^2x)).


                Putting this into our simple equation  produces an equation with only one trig function but it is not pretty:

                -8/9 = 4tan^4x - 4tan^3x + 5tan^2x - 4tanx

                which I cannot solve for tanx.  Perhaps you can.


                Fredrik, John, and Anna,

                Sorrry that I did not explain myself clearly. I am just practising my mathematic skills (or lack of).  SW required only the three measurements plus the two right angles in the sketch to make it "defined", but so far I have found that three measurements are not enough to obtain the same result using only pen and paper.


                Yes my question is a mathematical question and probably should not be posted in a SW forum.  But there are a lot of clever people in this forum and I thought I would try here for a method.


                I may have access to a mathematics teacher (for 17 yo's). If so, I will let you know the response.


              • Re: Mathematical question on SW's geometric solution
                John Sutherland

                The act of graphically constructing the sketch defines the sides and the angles.  SW Measure tool will tell you what they all are.


                What is there to solve?

                • Re: Mathematical question on SW's geometric solution
                  Anna Wood

                  You have geometric constraints in your sketch.  Horizontal, Vertical, Perpendicular which help to fully define your sketch.


                  In SolidWorks go to View and toggle on Sketch Relations to see those geometric constraints.


                  Both Geometric and Dimensional Constraints work together to fully define your sketches.





                  • Re: Mathematical question on SW's geometric solution
                    Martijn Loonen

                    I think your problem is in the angles.

                    Solidworks sees them as right triangles (90 degree's)

                    If you would see them the same way you could use A^2 + B^2 = C^2


                    Q= B + B(2)


                    B^2 = C^2 / A^2


                    B(2)^2 - C(2)^2 / A(2)^2


                    • Re: Mathematical question on SW's geometric solution
                      Mike Pogue

                      There are certainly high school trigonometry methods of solving these types of problems, but normal computer programs cannot handle these methods.


                      Theses sketches are setting up a set of equations.


                      If the equations are linear, there is a simple matrix inversion that gives an analytical solution within machine precision. If the system turns out to be non-linear, the computer will iterate to the answer to produce a numerical solution within the arbitrarily selected precision. Normal computer programs will not solve even the simplest non-linear equations analytically. Only specialized programs, like Mathematica, or custom equation solvers do this. The The simplest and most commonly taught method for this is Newton Raphson (http://www.math.ohiou.edu/courses/math3600/lecture13.pdf).

                      It would be very interesting if someone at SolidWorks could give some high-level insight into the algorithm that sets up the system of equations.

                        • Re: Mathematical question on SW's geometric solution
                          John Sutherland

                          <twisted knickers>


                          As I see it, the graphical construction (by mouse clicks) defines the coordinates of the verticies.


                          SW Fully Define checks that there are just sufficient constraints to prevent morphing, rotation and translation.  This does not need to know values of lengths or angles, merely that they are defined.


                          e.g.  A polygon of n sides is constrained against morphing by n+(n-3) constraints (linear or angular dimensions).  One fixed vertex constrains against translation and a second fixed vertex constrains against rotation.


                          Measuring the undefined lengths and angles is high school maths.


                          If each straight line is assumed to be a hypotenuse relative to the H & V axes, then, knowing the offsets of each vertex,  Pythagoras theorem will give the length of the line.


                          The angle of the line relative to H & V axes can be calculated by arccos(opposite/adjacent).

                          (In high school I had a book of tables to tell me arccos values, and later a slide rule, and later an electronic computer.  There must be a formula behind all this.)


                          Angles between lines can be calculated by subtraction.


                          </twisted knickers>

                            • Re: Mathematical question on SW's geometric solution
                              Mike Pogue

                              We are probably saying the same thing.


                              I'm not trying to be belligerent with the tags--just trying to separate what I know from what I'm pretty sure about. You are much much smarter than the SW sketch solver. You can spot shortcuts and elegant solutions. While I don't know for certain, I doubt that the sketch solver can even spot a right triangle. Pythagoras' theorem is certainly part of the algorithm that sets up the equations. I'm just saying that trig identities and the quadratic equation are almost definitely not. This stuf is getting dumped into a matrix of equations in a very general manner, and solved with an iterative method.