Changeset 1050 for trunk/Modelica/Mechanics/MultiBody/Frames.mo
- Timestamp:
- 02/24/08 19:43:25 (9 months ago)
- Files:
-
- 1 modified
-
trunk/Modelica/Mechanics/MultiBody/Frames.mo (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modelica/Mechanics/MultiBody/Frames.mo
r937 r1050 404 404 import Modelica.Math; 405 405 extends Modelica.Icons.Function; 406 input Real e[3] "Normalized axis of rotation (must have length=1)";406 input Real e[3](each final unit="1") "Normalized axis of rotation (must have length=1)"; 407 407 input Modelica.SIunits.Angle angle 408 408 "Rotation angle to rotate frame 1 into frame 2 along axis e"; … … 420 420 421 421 extends Modelica.Icons.Function; 422 input Real e[3] 422 input Real e[3](each final unit="1") 423 423 "Normalized axis of rotation to rotate frame 1 around e into frame 2 (must have length=1)"; 424 424 input Real v1[3] … … 606 606 </HTML>")); 607 607 protected 608 Real e1_1[3] "First rotation axis, resolved in frame 1";609 Real e2_1a[3] "Second rotation axis, resolved in frame 1a";610 Real e3_1[3] "Third rotation axis, resolved in frame 1";611 Real e3_2[3] "Third rotation axis, resolved in frame 2";608 Real e1_1[3](each final unit="1") "First rotation axis, resolved in frame 1"; 609 Real e2_1a[3](each final unit="1") "Second rotation axis, resolved in frame 1a"; 610 Real e3_1[3](each final unit="1") "Third rotation axis, resolved in frame 1"; 611 Real e3_2[3](each final unit="1") "Third rotation axis, resolved in frame 2"; 612 612 Real A 613 613 "Coefficient A in the equation A*cos(angles[1])+B*sin(angles[1]) = 0"; … … 718 718 function from_nxy "Return fixed orientation object from n_x and n_y vectors" 719 719 extends Modelica.Icons.Function; 720 input Real n_x[3] 720 input Real n_x[3](each final unit="1") 721 721 "Vector in direction of x-axis of frame 2, resolved in frame 1"; 722 input Real n_y[3] 722 input Real n_y[3](each final unit="1") 723 723 "Vector in direction of y-axis of frame 2, resolved in frame 1"; 724 724 output Orientation R "Orientation object to rotate frame 1 into frame 2"; … … 746 746 protected 747 747 Real abs_n_x=sqrt(n_x*n_x); 748 Real e_x[3] =if abs_n_x < 1.e-10 then {1,0,0} else n_x/abs_n_x;749 Real n_z_aux[3] =cross(e_x, n_y);750 Real n_y_aux[3] =if n_z_aux*n_z_aux > 1.0e-6 then n_y else (if abs(e_x[1])748 Real e_x[3](each final unit="1")=if abs_n_x < 1.e-10 then {1,0,0} else n_x/abs_n_x; 749 Real n_z_aux[3](each final unit="1")=cross(e_x, n_y); 750 Real n_y_aux[3](each final unit="1")=if n_z_aux*n_z_aux > 1.0e-6 then n_y else (if abs(e_x[1]) 751 751 > 1.0e-6 then {0,1,0} else {1,0,0}); 752 Real e_z_aux[3] =cross(e_x, n_y_aux);753 Real e_z[3] =e_z_aux/sqrt(e_z_aux*e_z_aux);752 Real e_z_aux[3](each final unit="1")=cross(e_x, n_y_aux); 753 Real e_z[3](each final unit="1")=e_z_aux/sqrt(e_z_aux*e_z_aux); 754 754 algorithm 755 755 R := Orientation(T={e_x,cross(e_z, e_x),e_z},w= zeros(3)); … … 758 758 function from_nxz "Return fixed orientation object from n_x and n_z vectors" 759 759 extends Modelica.Icons.Function; 760 input Real n_x[3] 760 input Real n_x[3](each final unit="1") 761 761 "Vector in direction of x-axis of frame 2, resolved in frame 1"; 762 input Real n_z[3] 762 input Real n_z[3](each final unit="1") 763 763 "Vector in direction of z-axis of frame 2, resolved in frame 1"; 764 764 output Orientation R "Orientation object to rotate frame 1 into frame 2"; … … 786 786 protected 787 787 Real abs_n_x=sqrt(n_x*n_x); 788 Real e_x[3] =if abs_n_x < 1.e-10 then {1,0,0} else n_x/abs_n_x;789 Real n_y_aux[3] =cross(n_z, e_x);790 Real n_z_aux[3] =if n_y_aux*n_y_aux > 1.0e-6 then n_z else (if abs(e_x[1])788 Real e_x[3](each final unit="1")=if abs_n_x < 1.e-10 then {1,0,0} else n_x/abs_n_x; 789 Real n_y_aux[3](each final unit="1")=cross(n_z, e_x); 790 Real n_z_aux[3](each final unit="1")=if n_y_aux*n_y_aux > 1.0e-6 then n_z else (if abs(e_x[1]) 791 791 > 1.0e-6 then {0,0,1} else {1,0,0}); 792 Real e_y_aux[3] =cross(n_z_aux, e_x);793 Real e_y[3] =e_y_aux/sqrt(e_y_aux*e_y_aux);792 Real e_y_aux[3](each final unit="1")=cross(n_z_aux, e_x); 793 Real e_y[3](each final unit="1")=e_y_aux/sqrt(e_y_aux*e_y_aux); 794 794 algorithm 795 795 R := Orientation(T={e_x,e_y,cross(e_x, e_y)},w= zeros(3)); … … 925 925 extends Modelica.Icons.Function; 926 926 input Integer axis(min=1, max=3) "Axis vector to be returned"; 927 output Real e[3] "Unit axis vector";927 output Real e[3](each final unit="1") "Unit axis vector"; 928 928 annotation(Inline=true); 929 929 algorithm … … 1245 1245 import Modelica.Math; 1246 1246 extends Modelica.Icons.Function; 1247 input Real e[3] "Normalized axis of rotation (must have length=1)";1247 input Real e[3](each final unit="1") "Normalized axis of rotation (must have length=1)"; 1248 1248 input Modelica.SIunits.Angle angle 1249 1249 "Rotation angle to rotate frame 1 into frame 2 along axis e"; … … 1660 1660 import Modelica.Math; 1661 1661 extends Modelica.Icons.Function; 1662 input Real e[3] "Normalized axis of rotation (must have length=1)";1662 input Real e[3](each final unit="1") "Normalized axis of rotation (must have length=1)"; 1663 1663 input Modelica.SIunits.Angle angle 1664 1664 "Rotation angle to rotate frame 1 into frame 2 along axis e"; … … 1675 1675 1676 1676 extends Modelica.Icons.Function; 1677 input Real e[3] 1677 input Real e[3](each final unit="1") 1678 1678 "Normalized axis of rotation to rotate frame 1 around e into frame 2 (must have length=1)"; 1679 1679 input Real v1[3] … … 1850 1850 </HTML>")); 1851 1851 protected 1852 Real e1_1[3] "First rotation axis, resolved in frame 1";1853 Real e2_1a[3] "Second rotation axis, resolved in frame 1a";1854 Real e3_1[3] "Third rotation axis, resolved in frame 1";1855 Real e3_2[3] "Third rotation axis, resolved in frame 2";1852 Real e1_1[3](each final unit="1") "First rotation axis, resolved in frame 1"; 1853 Real e2_1a[3](each final unit="1") "Second rotation axis, resolved in frame 1a"; 1854 Real e3_1[3](each final unit="1") "Third rotation axis, resolved in frame 1"; 1855 Real e3_2[3](each final unit="1") "Third rotation axis, resolved in frame 2"; 1856 1856 Real A 1857 1857 "Coefficient A in the equation A*cos(angles[1])+B*sin(angles[1]) = 0"; … … 1963 1963 function from_nxy "Return orientation object from n_x and n_y vectors" 1964 1964 extends Modelica.Icons.Function; 1965 input Real n_x[3] 1965 input Real n_x[3](each final unit="1") 1966 1966 "Vector in direction of x-axis of frame 2, resolved in frame 1"; 1967 input Real n_y[3] 1967 input Real n_y[3](each final unit="1") 1968 1968 "Vector in direction of y-axis of frame 2, resolved in frame 1"; 1969 1969 output TransformationMatrices.Orientation T … … 1992 1992 protected 1993 1993 Real abs_n_x=sqrt(n_x*n_x); 1994 Real e_x[3] =if abs_n_x < 1.e-10 then {1,0,0} else n_x/abs_n_x;1995 Real n_z_aux[3] =cross(e_x, n_y);1996 Real n_y_aux[3] =if n_z_aux*n_z_aux > 1.0e-6 then n_y else (if abs(e_x[1])1994 Real e_x[3](each final unit="1")=if abs_n_x < 1.e-10 then {1,0,0} else n_x/abs_n_x; 1995 Real n_z_aux[3](each final unit="1")=cross(e_x, n_y); 1996 Real n_y_aux[3](each final unit="1")=if n_z_aux*n_z_aux > 1.0e-6 then n_y else (if abs(e_x[1]) 1997 1997 > 1.0e-6 then {0,1,0} else {1,0,0}); 1998 Real e_z_aux[3] =cross(e_x, n_y_aux);1999 Real e_z[3] =e_z_aux/sqrt(e_z_aux*e_z_aux);1998 Real e_z_aux[3](each final unit="1")=cross(e_x, n_y_aux); 1999 Real e_z[3](each final unit="1")=e_z_aux/sqrt(e_z_aux*e_z_aux); 2000 2000 algorithm 2001 2001 T := {e_x,cross(e_z, e_x),e_z}; … … 2004 2004 function from_nxz "Return orientation object from n_x and n_z vectors" 2005 2005 extends Modelica.Icons.Function; 2006 input Real n_x[3] 2006 input Real n_x[3](each final unit="1") 2007 2007 "Vector in direction of x-axis of frame 2, resolved in frame 1"; 2008 input Real n_z[3] 2008 input Real n_z[3](each final unit="1") 2009 2009 "Vector in direction of z-axis of frame 2, resolved in frame 1"; 2010 2010 output TransformationMatrices.Orientation T … … 2033 2033 protected 2034 2034 Real abs_n_x=sqrt(n_x*n_x); 2035 Real e_x[3] =if abs_n_x < 1.e-10 then {1,0,0} else n_x/abs_n_x;2036 Real n_y_aux[3] =cross(n_z, e_x);2037 Real n_z_aux[3] =if n_y_aux*n_y_aux > 1.0e-6 then n_z else (if abs(e_x[1])2035 Real e_x[3](each final unit="1")=if abs_n_x < 1.e-10 then {1,0,0} else n_x/abs_n_x; 2036 Real n_y_aux[3](each final unit="1")=cross(n_z, e_x); 2037 Real n_z_aux[3](each final unit="1")=if n_y_aux*n_y_aux > 1.0e-6 then n_z else (if abs(e_x[1]) 2038 2038 > 1.0e-6 then {0,0,1} else {1,0,0}); 2039 Real e_y_aux[3] =cross(n_z_aux, e_x);2040 Real e_y[3] =e_y_aux/sqrt(e_y_aux*e_y_aux);2039 Real e_y_aux[3](each final unit="1")=cross(n_z_aux, e_x); 2040 Real e_y[3](each final unit="1")=e_y_aux/sqrt(e_y_aux*e_y_aux); 2041 2041 algorithm 2042 2042 T := {e_x,e_y,cross(e_x, e_y)};
