Modeling

Summary
Modeling
Functions
CreateManipulatorConstructs a data structure of type Manipulator.
SubsPlusSubstitute coherently angles in a system.
SubsParametersSpecify parameter values in a Manipulator
UnassignParametersRelease parameters in a Manipulator

Functions

CreateManipulator

CreateManipulator := proc (
   sys ::list({algebraic, algebraic=algebraic, algebraic<algebraic}),  
   cart ::list(name),  
   arti ::list(name) := [op(indets(sys,name) minus {op(vars)} minus map(lhs,{op(spec)}))],
   passive ::list(name) := [],
   geompars ::list(name) := [op(indets(sys,name) minus {op(cart)} minus {op(arti)} minus {op(passive)})],
   spec ::{list,set}(name=algebraic) := [],
   plotrange ::list(name=range) := [],
   points ::list(name=list(algebraic)) := [],
   loops ::list(list(name)) := [],
   chains ::list(list(name)) := [],
   actuators ::list({list(name),name}) := [],
   model ::string := "No name",
   precision ::integer := 4,
   {   
   noradical ::truefalse := false
   }   
      
)

Constructs a data structure of type Manipulator.

Parameters

syslist of polynomials, polynomial equalities and polynomial inequalities with rational coefficients: the implicit equations and constraints of the considered manipulator
cartlist of names: the pose variables
arti (optional)list of names: the control parameters; default value: the names of sys not in vars
passive (optional)list of names: the passive variables; default value: []
geompars (optional)list of names: the geometric parameters; default value: the names of sys not in cart, nor in arti
spec (optional)a list of equations of the form name=formula where name is a parameter name and formula a polynom with trigonometric function; the new variables in a formula are handled in the same way as the replaced variable. default value: []
points (optional)list of name=list: the points of the robot with their coordinates; default value: []
loops (optional)list of list of names: the frame loops of the robot default value: []
chains (optional)list of list of names: the frame chains of the robot default value: []
actuators (optional)list of names or list of names : the robot actuators; a list of name is for a leg actuator, a name is for an angle actuator; default value: []
model (optional)string: the name of the model; default value: “No name”
precision (optional)an integer: the number of significative digits; default value: 4

Returns

A data structure of type Manipulator containing the fields:

Equationsa list of polynomials [p1, ..., pk]: the modelling equations
Constraintsa list of strict inequalities: the constraint inequalities
PoseVariablesa list of names: the variables defining the pose
ArticularVariablesa list of names: the control parameters
PassiveVariablesa list of names: the remaining variables
GeometricParametersa list of names: the geometric parameters
GenericEquationsa list of polynomials: the modelling equations with symbolic geometric parameters
GenericConstraintsa list of strict inequalities: the constraint inequalities appearing in sys
Precisionan integer: the number of correct digits
PoseValuesthe pose values substituted in the GenericEquations to get the Equations
ArticularValuesthe articular values substituted in the GenericEquations to get the Equations
PassiveValuesthe passive values substituted in the GenericEquations to get the Equations
GeometricValuesthe geometric values substituted in the GenericEquations to get the Equations
DefaultPlotRangesranges used by default for plotting if provided
Pointsthe points coordinate of the robot
Loopsthe frame loops of the robot
Chainsthe frame chain of the robot
Actuatorsthe actuators of the robot
Modela string: the name of the modelling

Remark

  • Polynomials p appearing in sys, Equations, GenericEquations are considered implicitly as p=0.
  • When a control parameter value is specified in spec, the parameter name is removed from the ControlParemeters field.  This is not the case for the geometric parameters that appears in the field GeometricParameters even if they are specified.

Example

> CreateManipulator ( [x=t,y=t, -1<t, t<1], [x,y], [t], "Dummy" );
Record(Equations = [x - t, y - t], Constraints = [-1 < t, t < 1],

    Variables = [x, y], ControlParameters = [t], GeometricParameters = [],

    GenericEquations = [x - t, y - t], GenericConstraints = [-1 < t, t < 1],

    ParameterValues = [], Model = "Dummy")

SubsPlus

SubsPlus := proc (
   spec ::seq (name=algebraic),  
   formula ::{algebraic, algebraic<algebraic, list({algebraic,algebraic=algebraic, algebraic<algebraic})},  
   precision ::integer := 4
)

Substitute coherently angles in a system.

Parameters

specsequence of equalities var=value where var is a name and value a numerical value.
formulaequation, inequation, polynomial or list of those, with trigonometric and algebraic expressions.
precision (optional)integer: the number of digits that must be kept when modifying the values in spec.

Returns

The input formula where the name in spec have been replaced by the corresponding values; the algebraic relations satisfied by cos and sin are still valid with the chosen numerical values.

Example

> SubsPlus(a=3, cos(a)^2+sin(a)^2);
                                       1

SubsParameters

SubsParameters := proc (spec ::seq (name=algebraic),  
robot ::Manipulator,  
precision ::integer := 4)

Specify parameter values in a Manipulator

Parameters

speca sequence of equations of the form name=formula where name is a parameter name and formula a polynom with trigonometric functions
robota Manipulator object
precision = integer (optional)the precision, where integer is the number of significative digits; default value: 4.

Returns A Manipulator object, equivalent to the input Manipulator where some parameter have been specified by a numerical value

Example

> robot := CreateManipulator ( [x=t,y=t, -1<t, t<1], [x,y], [t], "Dummy" );
> SubsParameters (t=0.7, robot);
Record(Equations = [x - 7/10, y - 7/10], Constraints = [-1 < 7/10, 7/10 < 1],

    Variables = [x, y], ControlParameters = [], GeometricParameters = [],

    GenericEquations = [x - t, y - t], GenericConstraints = [-1 < t, t < 1],

    ParameterValues = [t = 0.7], Model = "Dummy")

UnassignParameters

UnassignParameters := proc (pars ::seq (And(name,Not(Manipulator))),
robot ::Manipulator)

Release parameters in a Manipulator

Parameters

parsa sequence of equations of the form name=value where name is a parameter name and value its numerical value
robota Manipulator object

Returns A Manipulator object, equivalent to the input Manipulator where some parameter have been unassigned.

Example

> robot := CreateManipulator ( [x=t,y=t,-1<t,t<1],[x,y],[t],[t=0.7],"Dummy" );
robot := Record(Equations = [x - 7/10, y - 7/10],

    Constraints = [-1 < 7/10, 7/10 < 1], Variables = [x, y],

    ControlParameters = [], GeometricParameters = [],

    GenericEquations = [x - t, y - t], GenericConstraints = [-1 < t, t < 1],

    ParameterValues = [t = 0.7], Model = "Dummy")

> UnassignParameters(t,%);
Record(Equations = [x - t, y - t], Constraints = [-1 < t, t < 1],

    Variables = [x, y], ControlParameters = [t], GeometricParameters = [],

    GenericEquations = [x - t, y - t], GenericConstraints = [-1 < t, t < 1],

    ParameterValues = [], Model = "No name")
CreateManipulator := proc (
   sys ::list({algebraic, algebraic=algebraic, algebraic<algebraic}),  
   cart ::list(name),  
   arti ::list(name) := [op(indets(sys,name) minus {op(vars)} minus map(lhs,{op(spec)}))],
   passive ::list(name) := [],
   geompars ::list(name) := [op(indets(sys,name) minus {op(cart)} minus {op(arti)} minus {op(passive)})],
   spec ::{list,set}(name=algebraic) := [],
   plotrange ::list(name=range) := [],
   points ::list(name=list(algebraic)) := [],
   loops ::list(list(name)) := [],
   chains ::list(list(name)) := [],
   actuators ::list({list(name),name}) := [],
   model ::string := "No name",
   precision ::integer := 4,
   {   
   noradical ::truefalse := false
   }   
      
)
Constructs a data structure of type Manipulator.
SubsPlus := proc (
   spec ::seq (name=algebraic),  
   formula ::{algebraic, algebraic<algebraic, list({algebraic,algebraic=algebraic, algebraic<algebraic})},  
   precision ::integer := 4
)
Substitute coherently angles in a system.
SubsParameters := proc (spec ::seq (name=algebraic),  
robot ::Manipulator,  
precision ::integer := 4)
Specify parameter values in a Manipulator
UnassignParameters := proc (pars ::seq (And(name,Not(Manipulator))),
robot ::Manipulator)
Release parameters in a Manipulator
Close