Team:Washington-Software/Modeling

From 2009.igem.org

(Difference between revisions)
(Solution)
 
(20 intermediate revisions not shown)
Line 1: Line 1:
-
{| style="color:#1b2c8a;background-color:#0c6;" cellpadding="3" cellspacing="1" border="1" bordercolor="#fff" width="62%" align="center"
+
{{:Team:Washington-Software/Header|out|out|out|in}}
-
!align="center"|[[Team:Washington-Software|Home]]
+
-
!align="center"|[[Team:Washington-Software/Team|The Team]]
+
-
!align="center"|[[Team:Washington-Software/Project|The Project]]
+
-
!align="center"|[[Team:Washington-Software/Parts|Parts Submitted to the Registry]]
+
-
!align="center"|[[Team:Washington-Software/Modeling|Modeling]]
+
-
!align="center"|[[Team:Washington-Software/Notebook|Notebook]]
+
-
|}
+
<html>
<html>
Line 33: Line 26:
==Mathematical Modeling==
==Mathematical Modeling==
-
===Alpha===
+
===Solving Reverse Triangulation in 3-D Space with Polar Coordinate Constraints===
====Problem====
====Problem====
Given the following construction and point ''p'', or (''x'',''y'',''z'') find the angles ''θ<sub>1</sub>'', ''θ<sub>2</sub>'', and ''θ<sub>3</sub>''.
Given the following construction and point ''p'', or (''x'',''y'',''z'') find the angles ''θ<sub>1</sub>'', ''θ<sub>2</sub>'', and ''θ<sub>3</sub>''.
Line 52: Line 45:
====Construction====
====Construction====
 +
We based the mathematical construction on the physical structure of ALPHA.
 +
From the top to the bottom:
From the top to the bottom:
*A circle centered at the origin with radius ''TR'', named ''O''
*A circle centered at the origin with radius ''TR'', named ''O''
Line 65: Line 60:
**The ray from the center of ''P'' to ''P<sub>x</sub>'' is parallel to the ray from the center of ''O'' to the point which is on ''A<sub>x</sub>'' and ''O'' 's circumference, for all ''x''.
**The ray from the center of ''P'' to ''P<sub>x</sub>'' is parallel to the ray from the center of ''O'' to the point which is on ''A<sub>x</sub>'' and ''O'' 's circumference, for all ''x''.
*Construct three line segments ''CA<sub>1</sub>'', ''CA<sub>2</sub>'', and ''CA<sub>3</sub>'' such that:
*Construct three line segments ''CA<sub>1</sub>'', ''CA<sub>2</sub>'', and ''CA<sub>3</sub>'' such that:
-
**''CA<sub>x</sub>'' is in the same plane as ''A<sub>x</sub>'', for all ''x'', and
+
**''CA<sub>x</sub>'' is in the same plane as ''A<sub>x</sub>'', for all ''x'',
 +
**The length of ''CA<sub>x</sub>'' is ''CA'', and
**The angle between ''CA<sub>x</sub>'' and ''A<sub>x</sub>'' is ''θ<sub>x</sub>'', for all ''x''.
**The angle between ''CA<sub>x</sub>'' and ''A<sub>x</sub>'' is ''θ<sub>x</sub>'', for all ''x''.
*The distance between ''P<sub>x</sub>'' and the end point of ''CA<sub>x</sub>'' that is not on ''A<sub>x</sub>'' is ''L'', for all ''x''.
*The distance between ''P<sub>x</sub>'' and the end point of ''CA<sub>x</sub>'' that is not on ''A<sub>x</sub>'' is ''L'', for all ''x''.
====Solution====
====Solution====
-
#Note that the control arms can only move in a circle, while linkage can move in a sphere.
+
#Note that the locus of the control arms are circles of radius ''CA'', while the locus of the linkages are spheres of radius ''L''.<!---
-
#We will calculate ''θ<sub>1</sub>'' first, which only involves the points, circles and lines ''p'', ''CA<sub>1</sub>'', ''A<sub>1</sub>'', and ''P<sub>1</sub>''.
+
Step 1---------------------------------------------------------------------------------------------->
-
#Find the plane where ''CA<sub>1</sub>'' 's circle resides in. Use it to cut the sphere around ''P<sub>1</sub>''. For future reference, call ''CA<sub>1</sub>'' 's circle ''C<sub>1</sub>'' and the circle resulting from the cut ''C<sub>2</sub>''
+
#We will calculate ''θ<sub>1</sub>'' first, which only involves the points, circles and lines ''p'', ''CA<sub>1</sub>'', ''A<sub>1</sub>'', and ''P<sub>1</sub>''.<!-----
 +
Step 2---------------------------------------------------------------------------------------------->
 +
#Find the plane where ''CA<sub>1</sub>'' 's circle resides in. Use it to cut the sphere around ''P<sub>1</sub>''. For future reference, call ''CA<sub>1</sub>'' 's circle ''C<sub>1</sub>'' and the circle resulting from the cut ''C<sub>2</sub>''<!-------------------------------
 +
Step 3---------------------------------------------------------------------------------------------->
#Define ''x<sub>o<sub>1</sub></sub>'', for x offset, for the difference in the ''x'' coordinates of the center of ''C<sub>1</sub>'' and the point ''P<sub>1</sub>''.
#Define ''x<sub>o<sub>1</sub></sub>'', for x offset, for the difference in the ''x'' coordinates of the center of ''C<sub>1</sub>'' and the point ''P<sub>1</sub>''.
-
#*''x<sub>o<sub>1</sub></sub> = TR - (BR + x)''
+
#*''x<sub>o<sub>1</sub></sub> = TR - BR - x''<!-------
-
#*''x<sub>o<sub>1</sub></sub> = TR - BR - x''
+
Step 4---------------------------------------------------------------------------------------------->
#Define ''D<sub>1</sub>'' to be the distance between the center of ''C<sub>1</sub>'' and ''C<sub>2</sub>''. It will also be the line connecting the centers.
#Define ''D<sub>1</sub>'' to be the distance between the center of ''C<sub>1</sub>'' and ''C<sub>2</sub>''. It will also be the line connecting the centers.
-
#*''D<sub>1</sub> = sqrt(x<sub>1</sub><sup>2</sup> + z<sup>2</sup>)''
+
#*''D<sub>1</sub> = sqrt(x<sub>1</sub><sup>2</sup> + z<sup>2</sup>)''<!--------------
-
#Obviously, ''D<sub>1</sub>'', ''CA<sub>1</sub>'', and linkage form a triangle. The angle between ''CA<sub>1</sub>'' and ''D<sub>1</sub>'' is a close approximation to ''θ<sub>1</sub>'', but it is not exact. We will call this angle ''θ<sub>1<sub>1</sub></sub>''. We use the law of cosines to calculate ''θ<sub>1<sub>1</sub></sub>''.
+
Step 5-------------------------------------------------------------------->
-
#*''L<sup>2</sup> = CA<sup>2</sup> + D<sup>2</sup> - CA * D * cos(θ<sub>1<sub>1</sub></sub>)''<br><br>
+
#Obviously, ''D<sub>1</sub>'', ''CA<sub>1</sub>'', and linkage form a triangle. The angle between ''CA<sub>1</sub>'' and ''D<sub>1</sub>'' is a close approximation to ''θ<sub>1</sub>'', but it is not exact. We will find the error in the next step. We will call this angle ''θ<sub>1<sub>1</sub></sub>''. We use the law of cosines to calculate ''θ<sub>1<sub>1</sub></sub>''.
-
#*''θ<sub>1<sub>1</sub></sub> = cos<sup>-1</sup>((D<sup>2</sup> + CA<sup>2</sup> - L<sup>2</sup>)/(2*D*CA))''<br><br>
+
#*''L<sup>2</sup> = CA<sup>2</sup> + D<sub>1</sub><sup>2</sup> - CA * D * cos(θ<sub>1<sub>1</sub></sub>)''<br><br>
 +
#*''θ<sub>1<sub>1</sub></sub> = cos<sup>-1</sup>((D<sub>1</sub><sup>2</sup> + CA<sup>2</sup> - L<sup>2</sup>)/(2*D<sub>1</sub>*CA))''<br><br><!-------
 +
Step 6------------------------------------->
#One endpoint of ''D<sub>1</sub>'' is on ''A<sub>1</sub>''. Thus, we can make another triangle, and the angle between ''D<sub>1</sub>'' and ''A<sub>1</sub>'' is the difference between ''θ<sub>1</sub>'' and ''θ<sub>1<sub>1</sub></sub>''. We will call this angle ''θ<sub>1<sub>2</sub></sub>''. If we have the length of the side on ''A<sub>1</sub>'' be ''z'', then the last side will be ''x<sub>o</sub>'' and the triangle will be a right angle triangle. Since only ''x<sub>o<sub>1</sub></sub>'' changes sign in the good interval, we should use a trigonometric function that involves ''x<sub>o</sub>'' in the numerator. Thus,
#One endpoint of ''D<sub>1</sub>'' is on ''A<sub>1</sub>''. Thus, we can make another triangle, and the angle between ''D<sub>1</sub>'' and ''A<sub>1</sub>'' is the difference between ''θ<sub>1</sub>'' and ''θ<sub>1<sub>1</sub></sub>''. We will call this angle ''θ<sub>1<sub>2</sub></sub>''. If we have the length of the side on ''A<sub>1</sub>'' be ''z'', then the last side will be ''x<sub>o</sub>'' and the triangle will be a right angle triangle. Since only ''x<sub>o<sub>1</sub></sub>'' changes sign in the good interval, we should use a trigonometric function that involves ''x<sub>o</sub>'' in the numerator. Thus,
#*''θ<sub>1<sub>2</sub></sub> = sin<sup>-1</sup>(x<sub>o<sub>1</sub></sub>/D<sub>1</sub>)''<br><br>
#*''θ<sub>1<sub>2</sub></sub> = sin<sup>-1</sup>(x<sub>o<sub>1</sub></sub>/D<sub>1</sub>)''<br><br>
-
#*''θ<sub>1</sub> = cos<sup>-1</sup>((D<sup>2</sup> + CA<sup>2</sup> - L<sup>2</sup>)/(2*D*CA)) - sin<sup>-1</sup>(x<sub>o<sub>1</sub></sub>/D<sub>1</sub>)''
+
#*''θ<sub>1</sub> = cos<sup>-1</sup>((D<sub>1</sub><sup>2</sup> + CA<sup>2</sup> - L<sup>2</sup>)/(2*D<sub>1</sub>*CA)) - sin<sup>-1</sup>(x<sub>o<sub>1</sub></sub>/D<sub>1</sub>)''<!----
-
#You just have to rotate the model ''φ<sub>1</sub>'' degrees counterclockwise for ''θ<sub>2</sub>'', and another ''φ<sub>2</sub>'' degrees for ''θ<sub>3</sub>'' using the two dimensional rotational matrixes
+
Step 7------------------------------------------------------------------>
 +
#You just have to rotate the model ''φ<sub>1</sub>'' degrees counterclockwise for ''θ<sub>2</sub>'', and another ''φ<sub>2</sub>'' degrees for ''θ<sub>3</sub>'' using the following three dimensional rotational matrixes: <br> [[Image:Rotation_Matrix.jpg]]<!---
     {''cos(φ<sub>2</sub>),-sin(φ<sub>2</sub>)''}
     {''cos(φ<sub>2</sub>),-sin(φ<sub>2</sub>)''}
  ''R<sub>1</sub>''={                }
  ''R<sub>1</sub>''={                }
Line 91: Line 93:
     {''cos(φ<sub>3</sub>) -sin(φ<sub>3</sub>)''}
     {''cos(φ<sub>3</sub>) -sin(φ<sub>3</sub>)''}
  ''R<sub>2</sub>''={                }
  ''R<sub>2</sub>''={                }
-
     {''sin(φ<sub>3</sub>)  cos(φ<sub>3</sub>)''}
+
     {''sin(φ<sub>3</sub>)  cos(φ<sub>3</sub>)''}-----><!-----------
 +
Step 8-------------------------->
 +
#Once you rotate the model, use steps 3-7 to get the next angles.
 +
#*''θ<sub>2</sub> = cos<sup>-1</sup>((D<sub>2</sub><sup>2</sup> + CA<sup>2</sup> - L<sup>2</sup>)/(2*D<sub>2</sub>*CA)) - sin<sup>-1</sup>(x<sub>o<sub>2</sub></sub>/D<sub>2</sub>)''
 +
#*''θ<sub>3</sub> = cos<sup>-1</sup>((D<sub>3</sub><sup>2</sup> + CA<sup>2</sup> - L<sup>2</sup>)/(2*D<sub>3</sub>*CA)) - sin<sup>-1</sup>(x<sub>o<sub>3</sub></sub>/D<sub>3</sub>)''<!---
 +
Step 9---------------------------------------->

Latest revision as of 22:18, 18 October 2009

WashingtonColorSeal-21-clip.gif Home Team Project Modeling Notebook Challenges Miscellaneous

Contents

Mathematical Modeling

Solving Reverse Triangulation in 3-D Space with Polar Coordinate Constraints

Problem

Given the following construction and point p, or (x,y,z) find the angles θ1, θ2, and θ3.

Note that positive z is the down direction.

Constants

  • TR
    • Top radius
  • BR
    • Bottom radius
  • L
    • Linkage
  • CA
    • Control Arm
  • φ1 and φ2
    • Two angles

Construction

We based the mathematical construction on the physical structure of ALPHA.

From the top to the bottom:

  • A circle centered at the origin with radius TR, named O
  • Make three lines A1, A2, and A3 such that:
    • The lines Ax are perpendicular to a tangent of O and a radius of O,
    • The angle between the radii of A1 and A2 is φ1, and
    • The angle between the radii of A2 and A3 is φ2.
  • Make a circle centered at point p with radius BR, named P
  • Find three points P1, P2, and P3 such that:
    • They are on the circumference of P,
    • The angle between the radius which touches P1 and the radius that touches P2 is φ1,
    • The angle between the radius which touches P2 and the radius that touches P3 is φ2,
    • The ray from the center of P to Px is parallel to the ray from the center of O to the point which is on Ax and O 's circumference, for all x.
  • Construct three line segments CA1, CA2, and CA3 such that:
    • CAx is in the same plane as Ax, for all x,
    • The length of CAx is CA, and
    • The angle between CAx and Ax is θx, for all x.
  • The distance between Px and the end point of CAx that is not on Ax is L, for all x.

Solution

  1. Note that the locus of the control arms are circles of radius CA, while the locus of the linkages are spheres of radius L.
  2. We will calculate θ1 first, which only involves the points, circles and lines p, CA1, A1, and P1.
  3. Find the plane where CA1 's circle resides in. Use it to cut the sphere around P1. For future reference, call CA1 's circle C1 and the circle resulting from the cut C2
  4. Define xo1, for x offset, for the difference in the x coordinates of the center of C1 and the point P1.
    • xo1 = TR - BR - x
  5. Define D1 to be the distance between the center of C1 and C2. It will also be the line connecting the centers.
    • D1 = sqrt(x12 + z2)
  6. Obviously, D1, CA1, and linkage form a triangle. The angle between CA1 and D1 is a close approximation to θ1, but it is not exact. We will find the error in the next step. We will call this angle θ11. We use the law of cosines to calculate θ11.
    • L2 = CA2 + D12 - CA * D * cos(θ11)

    • θ11 = cos-1((D12 + CA2 - L2)/(2*D1*CA))

  7. One endpoint of D1 is on A1. Thus, we can make another triangle, and the angle between D1 and A1 is the difference between θ1 and θ11. We will call this angle θ12. If we have the length of the side on A1 be z, then the last side will be xo and the triangle will be a right angle triangle. Since only xo1 changes sign in the good interval, we should use a trigonometric function that involves xo in the numerator. Thus,
    • θ12 = sin-1(xo1/D1)

    • θ1 = cos-1((D12 + CA2 - L2)/(2*D1*CA)) - sin-1(xo1/D1)
  8. You just have to rotate the model φ1 degrees counterclockwise for θ2, and another φ2 degrees for θ3 using the following three dimensional rotational matrixes:
    Rotation Matrix.jpg
  9. Once you rotate the model, use steps 3-7 to get the next angles.
    • θ2 = cos-1((D22 + CA2 - L2)/(2*D2*CA)) - sin-1(xo2/D2)
    • θ3 = cos-1((D32 + CA2 - L2)/(2*D3*CA)) - sin-1(xo3/D3)