From: <jpi...@us...> - 2011-10-18 10:36:46
|
Revision: 8776 http://octave.svn.sourceforge.net/octave/?rev=8776&view=rev Author: jpicarbajal Date: 2011-10-18 10:36:36 +0000 (Tue, 18 Oct 2011) Log Message: ----------- mechanics. Documenting Modified Paths: -------------- trunk/octave-forge/main/mechanics/inst/@rigidbody/plot.m trunk/octave-forge/main/mechanics/inst/@rigidbody/rigidbody.m trunk/octave-forge/main/mechanics/inst/inertiamoment.m trunk/octave-forge/main/mechanics/inst/masscenter.m trunk/octave-forge/main/mechanics/inst/principalaxes.m Modified: trunk/octave-forge/main/mechanics/inst/@rigidbody/plot.m =================================================================== --- trunk/octave-forge/main/mechanics/inst/@rigidbody/plot.m 2011-10-18 08:57:52 UTC (rev 8775) +++ trunk/octave-forge/main/mechanics/inst/@rigidbody/plot.m 2011-10-18 10:36:36 UTC (rev 8776) @@ -13,6 +13,12 @@ ## You should have received a copy of the GNU General Public License ## along with this program; if not, see <http://www.gnu.org/licenses/>. +## -*- texinfo -*- +## @deftypefn {Function File} {@var{obj} =} plot () +## Plots the rigid body. +## +## @end deftypefn + function h = plot(obj, varargin) ax = []; Modified: trunk/octave-forge/main/mechanics/inst/@rigidbody/rigidbody.m =================================================================== --- trunk/octave-forge/main/mechanics/inst/@rigidbody/rigidbody.m 2011-10-18 08:57:52 UTC (rev 8775) +++ trunk/octave-forge/main/mechanics/inst/@rigidbody/rigidbody.m 2011-10-18 10:36:36 UTC (rev 8776) @@ -15,10 +15,28 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {@var{obj} =} rigidbody () +## @deftypefnx {Function File} {@var{obj} =} rigidbody (@var{param},@var{value}) ## Create object @var{obj} of the rigid_body class. ## -## If no input argument is provided the object is filled with default values. +## If no input arguments are provided the object is filled with default values. +## Valid values for @var{param} are: +## +## @strong{Mass}: Scalar. Sets the total mass of the body. ## +## @strong{CoM}: 1x2 matrix. Sets the position of the center of mass of the body. +## +## @strong{Angle}: Scalar. Sets the angle of the rigid body, respect to the +## positive x-axis. +## +## @strong{Shape}: A cell with the polynomial descriptions of the edges of the +## shape or a Nx2 matrix of vertices. If no shape is provided the body is assumed +## to be a point mass. The moment of inertia respect to an axis perpendicular to the +## plane passing through the center of mass of the body is calculated based on +## this shape. +## +## @strong{CoMOffset}: 1x2 matrix. Set the displacement of the baricenter of the +## shape respect to the center of mass. Use with care! Check demos. +## ## @end deftypefn function rigidbody = rigidbody(varargin) Modified: trunk/octave-forge/main/mechanics/inst/inertiamoment.m =================================================================== --- trunk/octave-forge/main/mechanics/inst/inertiamoment.m 2011-10-18 08:57:52 UTC (rev 8775) +++ trunk/octave-forge/main/mechanics/inst/inertiamoment.m 2011-10-18 10:36:36 UTC (rev 8776) @@ -15,17 +15,19 @@ %% -*- texinfo -*- %% @deftypefn {Function File} { @var{Iz} =} inertiamoment (@var{pp}, @var{m}) -%% @deftypefnx {Function File} { [@var{Iz}, @var{error}] =} inertiamoment (@dots{}) -%% @deftypefnx {Function File} { @dots{} =} inertiamoment (@dots{}, @var{tol}) %% Moment of intertia of a plane shape. %% +%% Calculates the moment of inertia respect to an axis perpendicular to the +%% plane passing through the center of mass of the body. +%% %% The shape is defined with piecewise smooth polynomials. @var{pp} is a %% cell where each elements is a 2-by-(poly_degree+1) matrix containing px(i,:) = %% pp{i}(1,:) and py(i,:) = pp{i}(2,:). %% +%% @seealso{masscenter, principalaxis} %% @end deftypefn -function Iz = inertiamoment (pp, m, tol=sqrt(eps)*[1 1]) +function Iz = inertiamoment (pp, m) Iz = sum(cellfun (@Iint, pp)); A = shapearea(pp); Modified: trunk/octave-forge/main/mechanics/inst/masscenter.m =================================================================== --- trunk/octave-forge/main/mechanics/inst/masscenter.m 2011-10-18 08:57:52 UTC (rev 8775) +++ trunk/octave-forge/main/mechanics/inst/masscenter.m 2011-10-18 10:36:36 UTC (rev 8776) @@ -14,15 +14,14 @@ %% along with this program; if not, see <http://www.gnu.org/licenses/>. %% -*- texinfo -*- -%% @deftypefn {Function File} { @var{cm} =} masscenter (@var{pp}, @var{mass}) -%% @deftypefnx {Function File} { [@var{cm}, @var{error}] =} masscenter (@dots{}) -%% @deftypefnx {Function File} { @dots{} =} masscenter (@dots{}, @var{tol}) +%% @deftypefn {Function File} { @var{cm} =} masscenter (@var{pp}) %% Center of mass of a plane shape. %% %% The shape is defined with piecewise smooth polynomials. @var{pp} is a %% cell where each elements is a 2-by-(poly_degree+1) matrix containing px(i,:) = %% pp{i}(1,:) and py(i,:) = pp{i}(2,:). %% +%% @seealso{inertiamoment} %% @end deftypefn function cm = masscenter (shape) Modified: trunk/octave-forge/main/mechanics/inst/principalaxes.m =================================================================== --- trunk/octave-forge/main/mechanics/inst/principalaxes.m 2011-10-18 08:57:52 UTC (rev 8775) +++ trunk/octave-forge/main/mechanics/inst/principalaxes.m 2011-10-18 10:36:36 UTC (rev 8776) @@ -18,10 +18,10 @@ ## Calculates the principal axes of a shape. ## ## Returns a matrix @var{axes} where each row corresponds to one of the principal -## axes of the shape. @{l} is the second moment of area around to the correspoding axis. -## @var{axes} is order from lower to higher @var{l}. +## axes of the shape. @{l} is the second moment of area around the correspoding +## principal axis. @var{axes} is order from lower to higher @var{l}. ## -## @seealso{second_moment_poly2d} +## @seealso{inertiamoment, masscenter} ## @end deftypefn function [PA l Jm] = principalaxes (shape) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |