Robotran C Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
mbs_project_interface.h File Reference

Declaration of functions that are project dependent. More...

#include "mbs_equil_struct.h"

Go to the source code of this file.

Functions

void mbs_get_project_functions (MbsData *mbs_data)
 loads the project function into the pointers defined in MbsData::fct More...
 
void user_load_post (MbsData *MBSdata, MbsLoader *mbs_loader)
 User own initialization operations. More...
 
void user_free (MbsData *MBSdata)
 User own freeing operations. More...
 
void user_call_dirdyn_init (MbsData *MBSdata, MbsDirdyn *mbs_dd)
 Module redirection for user own dirdyn initialization function, see user_dirdyn_init(). More...
 
void user_dirdyn_init (MbsData *MBSdata, MbsDirdyn *mbs_dd)
 user own initialization functions More...
 
void user_call_dirdyn_loop (MbsData *MBSdata, MbsDirdyn *mbs_dd)
 Module redirection for user own dirdyn loop function, see user_dirdyn_loop(). More...
 
void user_dirdyn_loop (MbsData *MBSdata, MbsDirdyn *mbs_dd)
 user own loop functions More...
 
void user_call_dirdyn_finish (MbsData *MBSdata, MbsDirdyn *mbs_dd)
 Module redirection for user own dirdyn finish function, see user_dirdyn_finish(). More...
 
void user_dirdyn_finish (MbsData *MBSdata, MbsDirdyn *mbs_dd)
 user own finishing functions More...
 
void user_call_invdyn_init (MbsData *MBSdata, MbsInvdyn *mbs_invd)
 Module redirection for user own dirdyn initialization function, see user_dirdyn_init(). More...
 
void user_invdyn_init (MbsData *MBSdata, MbsInvdyn *mbs_invd)
 
void user_call_invdyn_loop (MbsData *MBSdata, MbsInvdyn *mbs_invd)
 Module redirection for user own dirdyn loop function, see user_dirdyn_loop(). More...
 
void user_invd_loop (MbsData *MBSdata, MbsInvdyn *mbs_invd)
 
void user_call_invdyn_finish (MbsData *MBSdata, MbsInvdyn *mbs_invd)
 Module redirection for user own dirdyn finish function, see user_dirdyn_finish(). More...
 
void user_invdyn_finish (MbsData *MBSdata, MbsInvdyn *mbs_invd)
 
void user_call_equil_init (MbsData *MBSdata, MbsEquil *mbs_equil)
 Module redirection for user own equilibrium initialization function, see user_equil_init(). More...
 
void user_equil_init (MbsData *MBSdata, MbsEquil *mbs_equil)
 user own initialization functions More...
 
void user_call_equil_loop (MbsData *MBSdata, MbsEquil *mbs_equil)
 Module redirection for user own equil loop function, see user_equil_loop(). More...
 
void user_equil_loop (MbsData *MBSdata, MbsEquil *mbs_equil)
 user own loop functions More...
 
void user_call_equil_finish (MbsData *MBSdata, MbsEquil *mbs_equil)
 Module redirection for user own equil finish function, see user_equil_finish(). More...
 
void user_equil_finish (MbsData *MBSdata, MbsEquil *mbs_equil)
 user own finishing functions More...
 
void user_call_equil_fxe (MbsData *mbs_data, double *f)
 Module redirection for user own equilibrium equations function, see user_equil_fxe(). More...
 
void user_equil_fxe (MbsData *mbs_data, double *f)
 user own implementation of added equilibrium equations Fxe Necessary to express equilibrium f(x)=0 More...
 
void user_cons_hJ (double *h, double **Jac, MbsData *s, double tsim)
 Compute the user-specified constraint vector and Jacobian. More...
 
int user_call_cons_hJ (double *h, double **Jac, MbsData *s, double tsim)
 Module redirection for user joint force function, see user_cons_hJ() however the return differs. More...
 
void user_cons_jdqd (double *jdqd, MbsData *s, double tsim)
 Compute the jdqd term of the user-specified constraints. More...
 
int user_call_cons_jdqd (double *jdqd, MbsData *s, double tsim)
 Module redirection for jdqd term of the user-specified constraints, see user_cons_jdqd() however the return differs. More...
 
void user_Derivative (MbsData *s)
 Compute the time derivative of the user state variables defined in the user model. More...
 
int user_call_Derivative (MbsData *s)
 Module redirection for the time derivative of the user state variables, see user_Derivative() however the return differs. More...
 
void user_DrivenJoints (MbsData *s, double tsim)
 Compute the positions, velocities and acceleration of driven joint. More...
 
int user_call_DrivenJoints (MbsData *s, double tsim)
 Module redirection for the computation of driven joints, see user_DrivenJoints() however the return differs. More...
 
double * user_ExtForces (double PxF[4], double RxF[4][4], double VxF[4], double OMxF[4], double AxF[4], double OMPxF[4], MbsData *s, double tsim, int ixF)
 Compute an user-specified external force. More...
 
double * user_call_ExtForces (double PxF[4], double RxF[4][4], double VxF[4], double OMxF[4], double AxF[4], double OMPxF[4], MbsData *s, double tsim, int ixF)
 Module redirection for the computation of external forces, see user_DrivenJoints(). More...
 
double * user_GenExtForces (double PxF[4], double RxF[4][4], double VxF[4], double OMxF[4], double AxF[4], double OMPxF[4], MbsData *s, double tsim, int iBody)
 
double * user_JointForces (MbsData *s, double tsim)
 Compute the user-specified joint force in all joint. More...
 
double * user_call_JointForces (MbsData *s, double tsim)
 Module redirection for user joint force function, see user_JointForces(). More...
 
double user_LinkForces (double Z, double Zd, MbsData *s, double tsim, int ilnk)
 Compute the value of a link forces. More...
 
double user_call_LinkForces (double Z, double Zd, MbsData *s, double tsim, int ilnk)
 Module redirection for user link force function, see user_LinkForces(). More...
 
double * user_Link3DForces (double PxF[4], double RxF[4][4], double VxF[4], double OMxF[4], double AxF[4], double OMPxF[4], MbsData *s, double tsim, int ixF)
 Compute an user-specified point to point force, with arbitrary line of action. More...
 
double * user_call_Link3DForces (double PxF[4], double RxF[4][4], double VxF[4], double OMxF[4], double AxF[4], double OMPxF[4], MbsData *s, double tsim, int ixF)
 Module redirection for user link 3D function, see user_Link3DForces(). More...
 
int user_cons_J_accelred (MbsData *s, double tsim)
 Close the user-specified constraints and compute the Jacobian of the constraints vector. More...
 
int user_call_cons_J_accelred (MbsData *s, double tsim)
 Module redirection for accelred user-specified constraints function, see user_cons_J_accelred(). More...
 
void user_call_realtime_options (MbsData *mbs_data, Realtime_option *options)
 
void user_call_keyboard (MbsData *mbs_data, Simu_realtime *realtime, int cur_t_usec, const Uint8 *keystates)
 
void user_call_realtime_plot (MbsData *mbs_data)
 
void user_call_joystick_axes (MbsData *mbs_data, Simu_realtime *realtime, int nb_joysticks)
 
void user_call_joystick_buttons (MbsData *mbs_data, int buttonID)
 
void user_call_realtime_visu (MbsData *mbs_data, int nb_models, int *nb_q, double **q_vec)
 Redirection to the user-specified user function of realtime visualization. More...
 
double * user_JointForces_dq (MbsData *mbs_data, double tsim, int ixJ)
 Compute the derivative of the joint forces vector according to a generalized coordinate. More...
 
double * user_call_JointForces_dq (MbsData *mbs_data, double tsim, int ixJ)
 Module redirection for user function, see user_JointForces_dq(). More...
 
double * user_JointForces_dqd (MbsData *mbs_data, double tsim, int ixJ)
 Compute the derivative of the joint forces vector according to a generalized velocity. More...
 
double * user_call_JointForces_dqd (MbsData *mbs_data, double tsim, int ixJ)
 Module redirection for user function, see user_JointForces_dqd(). More...
 
double * user_JointForces_dqdd (MbsData *mbs_data, double tsim, int ixJ)
 Compute the derivative of the joint forces vector according to a generalized acceleartion. More...
 
double * user_call_JointForces_dqdd (MbsData *mbs_data, double tsim, int ixJ)
 Module redirection for user function, see user_call_JointForces_dqdd(). More...
 
double * user_JointForces_dp (MbsData *mbs_data, double tsim)
 Compute the derivative of the joint forces vector according to a specific parameter. More...
 
double * user_call_JointForces_dp (MbsData *mbs_data, double tsim)
 Module redirection for user function, see user_JointForces_dp(). More...
 
double user_LinkForces_dq (double Z, double d_Z, double Zd, double d_Zd, MbsData *mbs_data, double tsim, int i_link, int i_param)
 Compute the partial derivative of a link forces with respect to a generalized coordinate. More...
 
double user_call_LinkForces_dq (double Z, double d_Z, double Zd, double d_Zd, MbsData *mbs_data, double tsim, int i_link, int i_param)
 Module redirection for user function, see user_LinkForces_dq(). More...
 
double user_LinkForces_dqd (double Z, double d_Z, double Zd, double d_Zd, MbsData *mbs_data, double tsim, int i_link, int i_param)
 Compute the partial derivative of a link forces with respect to a generalized velocity. More...
 
double user_call_LinkForces_dqd (double Z, double d_Z, double Zd, double d_Zd, MbsData *mbs_data, double tsim, int i_link, int i_param)
 Module redirection for user function, see user_LinkForces_dqd(). More...
 
double user_LinkForces_dqdd (double Z, double d_Z, double Zd, double d_Zd, MbsData *mbs_data, double tsim, int i_link, int i_param)
 Compute the partial derivative of a link forces with respect to a generalized acceleration. More...
 
double user_call_LinkForces_dqdd (double Z, double d_Z, double Zd, double d_Zd, MbsData *mbs_data, double tsim, int i_link, int i_param)
 Module redirection for user function, see user_LinkForces_dqdd(). More...
 
double user_LinkForces_dp (double Z, double d_Z, double Zd, double d_Zd, MbsData *mbs_data, double tsim, int i_link)
 Compute the partial derivative of a link forces with respect to a specific parameter. More...
 
double user_call_LinkForces_dp (double Z, double d_Z, double Zd, double d_Zd, MbsData *mbs_data, double tsim, int i_link)
 Module redirection for user function, see user_LinkForces_dp(). More...
 
double * user_Link3DForces_dq (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_link3d, int i_param)
 Compute the partial derivative of a link3D forces with respect to a generalized coordinate. More...
 
double * user_call_Link3DForces_dq (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_link3d, int i_param)
 Module redirection for user function, see user_Link3DForces_dq(). More...
 
double * user_Link3DForces_dqd (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_link3d, int i_param)
 Compute the partial derivative of a link3D forces with respect to a generalized velocity. More...
 
double * user_call_Link3DForces_dqd (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_link3d, int i_param)
 Module redirection for user function, see user_Link3DForces_dqd(). More...
 
double * user_Link3DForces_dqdd (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_link3d, int i_param)
 Compute the partial derivative of a link3D forces with respect to a generalized acceleration. More...
 
double * user_call_Link3DForces_dqdd (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_link3d, int i_param)
 Module redirection for user function, see user_Link3DForces_dqdd(). More...
 
double * user_Link3DForces_dp (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_link3d)
 Compute the partial derivative of a link3D forces with respect to a parameter. More...
 
double * user_call_Link3DForces_dp (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_link3d)
 Module redirection for user function, see user_Link3DForces_dp(). More...
 
double * user_ExtForces_dq (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_force, int i_joint)
 Compute the partial derivative of an user-specified external force with respect to a generalized coordinate. More...
 
double * user_call_ExtForces_dq (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_force, int i_joint)
 Module redirection for user function, see user_call_ExtForces_dq(). More...
 
double * user_ExtForces_dqd (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_force, int i_joint)
 Compute the partial derivative of an user-specified external force with respect to a generalized velocity. More...
 
double * user_call_ExtForces_dqd (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_force, int i_joint)
 Module redirection for user function, see user_ExtForces_dqd(). More...
 
double * user_ExtForces_dqdd (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_force, int i_joint)
 Compute the partial derivative of an user-specified external force with respect to a generalized acceleration. More...
 
double * user_call_ExtForces_dqdd (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_force, int i_joint)
 Module redirection for user function, see user_ExtForces_dqdd(). More...
 
double * user_ExtForces_dp (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_force, int i_joint)
 Compute the partial derivative of an user-specified external force with respect to a specific parameter. More...
 
double * user_call_ExtForces_dp (double PxF[4], double d_PxF[4], double RxF[4][4], double d_RxF[4][4], double VxF[4], double d_VxF[4], double OMxF[4], double d_OMxF[4], double AxF[4], double d_AxF[4], double OMPxF[4], double d_OMPxF[4], MbsData *s, double tsim, int i_force)
 Module redirection for user function, see user_ExtForces_dp(). More...
 
int mbs_call_cons_hJ (double *h, double **Jac, MbsData *s, double tsim)
 Symbolic constraints function declaration. More...
 
void mbs_cons_hJ (double *h, double **Jac, MbsData *s, double tsim)
 Symbolic constraints function, see mbs_call_cons_hJ(). More...
 
void mbs_invdyna (double *Qq, MbsData *s, double tsim)
 Symbolic inverse dynamic function, see mbs_call_invdyna(). More...
 
int mbs_call_cons_jdqd (double *Jdqd, MbsData *s, double tsim)
 Symbolic jdqd function declaration. More...
 
void mbs_cons_jdqd (double *Jdqd, MbsData *s, double tsim)
 Symbolic jdqd function, see mbs_call_cons_jdqd(). More...
 
int mbs_call_link (double **frc, double **trq, double *Flnk, double *Z, double *Zd, MbsData *s, double tsim)
 Symbolic link forces function declaration. More...
 
void mbs_link (double **frc, double **trq, double *Flnk, double *Z, double *Zd, MbsData *s, double tsim)
 Symbolic link forces function, see mbs_call_link(). More...
 
int mbs_call_link3D (double **frc, double **trq, MbsData *s, double tsim)
 Symbolic link 3D forces function declaration. More...
 
void mbs_link3D (double **frc, double **trq, MbsData *s, double tsim)
 Symbolic link3D forces function, see mbs_call_link3D(). More...
 
int mbs_call_extforces (double **frc, double **trq, MbsData *s, double tsim)
 Symbolic external forces function declaration. More...
 
void mbs_extforces (double **frc, double **trq, MbsData *s, double tsim)
 Symbolic external forces function, see mbs_call_extforces(). More...
 
int mbs_call_accelred (MbsData *s, double tsim)
 Symbolic reduced acceleration function declaration. More...
 
int mbs_accelred (MbsData *s, double tsim)
 Symbolic reduced acceleration function, see mbs_call_accelred(). More...
 
int mbs_call_gensensor (MbsSensor *sens, MbsData *s, int isens)
 Declaration of the symbolic function computing all fields of a sensor located at a body origin. More...
 
void mbs_gensensor (MbsSensor *sens, MbsData *s, int isens)
 Symbolic sensor computation function, see mbs_call_sensor(). More...
 
int mbs_check_symbolic (MbsData *s)
 Declaration of the generated file checking coherence with the MbsData. More...
 
int mbs_call_check_symbolic (MbsData *s)
 Call the symbolic checking function, see mbs_check_symbolic(). More...
 
int mbs_call_sensor (MbsSensor *sens, MbsData *s, int isens)
 Declaration of the symbolic function computing all fields of a sensor. More...
 
void mbs_sensor (MbsSensor *sens, MbsData *s, int isens)
 Symbolic sensor computation function, see mbs_call_sensor(). More...
 
int mbs_call_invdyna (double *Qq, MbsData *s, double tsim)
 Symbolic inverse dynamic function declaration. More...
 
int mbs_call_invdynared_dq (MbsData *s, double tsim)
 Compute the stiffness matrix of the system. More...
 
int mbs_invdynared_dq (MbsData *s, double tsim)
 Symbolic function, see mbs_call_invdynared_dq(). More...
 
int mbs_call_invdynared_dqd (MbsData *s, double tsim)
 Compute the damping matrix of the system. More...
 
int mbs_invdynared_dqd (MbsData *s, double tsim)
 Symbolic function, see mbs_call_invdynared_dqd(). More...
 
int mbs_call_invdynared_dqdd (MbsData *s, double tsim)
 Compute the reduced mass matrix of the system. More...
 
int mbs_invdynared_dqdd (MbsData *s, double tsim)
 Symbolic function, see mbs_call_invdynared_dqdd(). More...
 
int mbs_call_invdyna_dp (MbsData *s, double tsim)
 Compute the tangeant matrix of the system to arbitrary parameters. More...
 
int mbs_invdynared_dp (MbsData *s, double tsim)
 Symbolic function, see mbs_call_invdynared_dp(). More...
 
int mbs_call_dirdyna (double **M, double *c, MbsData *s, double tsim)
 Symbolic direct dynamic function declaration. More...
 
void mbs_dirdyna (double **M, double *c, MbsData *s, double tsim)
 Symbolic direct dynamic function, see mbs_call_dirdyna(). More...
 

Detailed Description

Declaration of functions that are project dependent.

It consists in user and symbolic functions.

Author
Robotran team

(c) Universite catholique de Louvain

Function Documentation

◆ mbs_accelred()

int mbs_accelred ( MbsData s,
double  tsim 
)

Symbolic reduced acceleration function, see mbs_call_accelred().

◆ mbs_call_accelred()

int mbs_call_accelred ( MbsData s,
double  tsim 
)

Symbolic reduced acceleration function declaration.

The arguments are the same for the module redirection function mbs_call_accelred() and the generated symbolic function mbs_accelred().

Parameters
[in,out]sThe MbsData structure of the model.
[in]tsimThe current time.
Returns
Positive or null for success, negative in case of error.

◆ mbs_call_check_symbolic()

int mbs_call_check_symbolic ( MbsData s)

Call the symbolic checking function, see mbs_check_symbolic().

Only the number of elements are checked, if topology has changed (at constant number of elements) no error is detected.

Parameters
[in,out]sThe MbsData structure of the model, MbsData::flag_stop is raised in case of error.
Returns
Status code (macro):
  • MBS_INFO_SUCCESS: No fatal error detected;
  • MBS_INFO_WARNING: Symbolic function does not exists;
  • MBS_INFO_ERROR: Symbolic files are not compatible;

◆ mbs_call_cons_hJ()

int mbs_call_cons_hJ ( double *  h,
double **  Jac,
MbsData s,
double  tsim 
)

Symbolic constraints function declaration.

The arguments are the same for the module redirection function mbs_call_cons_hJ() and the generated symbolic function mbs_cons_hJ().

Parameters
[out]hThe loops constraint vector, see MbsAux::h.
[out]JacThe Jacobian of loops constraint vector, see MbsAux::Jac.
[in]sThe MbsData structure of the model.
[in]tsimThe current time.
Returns
0 for success, negative in case of error.

◆ mbs_call_cons_jdqd()

int mbs_call_cons_jdqd ( double *  Jdqd,
MbsData s,
double  tsim 
)

Symbolic jdqd function declaration.

The arguments are the same for the module redirection function mbs_call_cons_jdqd() and the generated symbolic function mbs_cons_jdqd(). However the return differs.

Parameters
[out]JdqdThe jdqd term of loops constraint, see MbsAux::jdqd.
[in]sThe MbsData structure of the model.
[in]tsimThe current time.
Returns
0 for success, negative in case of error.

◆ mbs_call_dirdyna()

int mbs_call_dirdyna ( double **  M,
double *  c,
MbsData s,
double  tsim 
)

Symbolic direct dynamic function declaration.

The arguments are the same for the module redirection function mbs_call_dirdyna() and the generated symbolic function mbs_dirdyna(). However the return differs.

Parameters
[out]MThe mass matrix of the model, see MbsAux::M.
[out]cThe non-linear components of the equation of the model, see MbsAux::c.
[in,out]sThe MbsData structure of the model.
[in]tsimThe current time.
Returns
0 if success, -1 in case of error.

◆ mbs_call_extforces()

int mbs_call_extforces ( double **  frc,
double **  trq,
MbsData s,
double  tsim 
)

Symbolic external forces function declaration.

The arguments are the same for the module redirection function mbs_call_extforces() and the generated symbolic function mbs_extforces(). However the return differs.

Parameters
[out]frcComponents of the resultant external forces, see MbsData::frc.
[out]trqComponents of the resultant external torquess, see MbsData::trc.
[in]sThe MbsData structure of the model.
[in]tsimThe current time.
Returns
0 for success, negative in case of error.

◆ mbs_call_gensensor()

int mbs_call_gensensor ( MbsSensor sens,
MbsData s,
int  isens 
)

Declaration of the symbolic function computing all fields of a sensor located at a body origin.

The arguments are the same for the module redirection function mbs_call_gensensor() and the generated symbolic function mbs_gensensor(). However the return differs.

Parameters
[in,out]sensPointer to the MbsSensor structure to compute.
[in]spointer to the MbsData structure of the model related to the sensor.
[in]isensthe ID of the sensor, for Force sensor the id has to be incremented by MbsData::Nsensor.
Returns
0 for success, negative in case of error.

◆ mbs_call_invdyna()

int mbs_call_invdyna ( double *  Qq,
MbsData s,
double  tsim 
)

Symbolic inverse dynamic function declaration.

The arguments are the same for the module redirection function mbs_call_invdyna() and the generated symbolic function mbs_invdyna(). However the return differs.

Parameters
[out]QqThe dynamic vector of the model, see MbsAux::phi.
[in,out]sThe MbsData structure of the model.
[in]tsimThe current time.
Returns
0 if success, -1 in case of error.

◆ mbs_call_invdyna_dp()

int mbs_call_invdyna_dp ( MbsData s,
double  tsim 
)

Compute the tangeant matrix of the system to arbitrary parameters.

The tangeant matrix is stored in MbsData::mbs_dp->P.

Parameters
[in,out]spointer to the MbsData structure of the model
[in]tsimthe current time of the simulation.
Returns
The status, <0 in case of failure.

◆ mbs_call_invdynared_dq()

int mbs_call_invdynared_dq ( MbsData s,
double  tsim 
)

Compute the stiffness matrix of the system.

The stiffness matrix is stored in MbsData::mbs_dp->K.

Parameters
[in,out]spointer to the MbsData structure of the model
[in]tsimthe current time of the simulation.
Returns
The status, <0 in case of failure.

◆ mbs_call_invdynared_dqd()

int mbs_call_invdynared_dqd ( MbsData s,
double  tsim 
)

Compute the damping matrix of the system.

The damping matrix is stored in MbsData::mbs_dp->G.

Parameters
[in,out]spointer to the MbsData structure of the model
[in]tsimthe current time of the simulation.
Returns
The status, <0 in case of failure.

◆ mbs_call_invdynared_dqdd()

int mbs_call_invdynared_dqdd ( MbsData s,
double  tsim 
)

Compute the reduced mass matrix of the system.

The mass matrix is stored in MbsData::mbs_dp->M.

Parameters
[in,out]spointer to the MbsData structure of the model
[in]tsimthe current time of the simulation.
Returns
The status, <0 in case of failure.

◆ mbs_call_link()

int mbs_call_link ( double **  frc,
double **  trq,
double *  Flnk,
double *  Z,
double *  Zd,
MbsData s,
double  tsim 
)

Symbolic link forces function declaration.

The arguments are the same for the module redirection function mbs_call_link() and the generated symbolic function mbs_link(). However the return differs.

Parameters
[out]frcComponents of the resultant external forces, see MbsData::frc.
[out]trqComponents of the resultant external torquess, see MbsData::trc.
[out]FlnkThe forces in the links, see MbsData::Fl
[out]ZThe distances between of the points the links, see MbsData::Z
[out]ZdThe velocities between of the points the links, see MbsData::Zd
[in]sThe MbsData structure of the model.
[in]tsimThe current time.
Returns
0 for success, negative in case of error.

◆ mbs_call_link3D()

int mbs_call_link3D ( double **  frc,
double **  trq,
MbsData s,
double  tsim 
)

Symbolic link 3D forces function declaration.

The arguments are the same for the module redirection function mbs_call_link3D() and the generated symbolic function mbs_link3D(). However the return differs.

Parameters
[out]frcComponents of the resultant external forces, see MbsData::frc.
[out]trqComponents of the resultant external torquess, see MbsData::trc.
[in]sThe MbsData structure of the model.
[in]tsimThe current time.
Returns
0 for success, negative in case of error.

◆ mbs_call_sensor()

int mbs_call_sensor ( MbsSensor sens,
MbsData s,
int  isens 
)

Declaration of the symbolic function computing all fields of a sensor.

The function can be called for both "classical" and "external force" sensors.

The arguments are the same for the module redirection function mbs_call_sensor() and the generated symbolic function mbs_sensor(). However the return differs.

Parameters
[in,out]sensPointer to the MbsSensor structure to compute.
[in]spointer to the MbsData structure of the model related to the sensor.
[in]isensthe ID of the sensor, for Force sensor the id has to be incremented by MbsData::Nsensor.
Returns
0 for success, negative in case of error.

◆ mbs_check_symbolic()

int mbs_check_symbolic ( MbsData s)

Declaration of the generated file checking coherence with the MbsData.

Only the number of elements are checked, if topology has changed (at constant number of elements) no error is detected.

Parameters
[in]sPointer to the loaded mbs to be compare with symbolic files.
Returns
Status code:
  • Zero: SUCCESS;
  • Negative: NULL argument;
  • Positive: INCOMPATIBLE symbolic files;

◆ mbs_cons_hJ()

void mbs_cons_hJ ( double *  h,
double **  Jac,
MbsData s,
double  tsim 
)

Symbolic constraints function, see mbs_call_cons_hJ().

The symbolic function does not return any value.

◆ mbs_cons_jdqd()

void mbs_cons_jdqd ( double *  Jdqd,
MbsData s,
double  tsim 
)

Symbolic jdqd function, see mbs_call_cons_jdqd().

The symbolic function does not return any value.

◆ mbs_dirdyna()

void mbs_dirdyna ( double **  M,
double *  c,
MbsData s,
double  tsim 
)

Symbolic direct dynamic function, see mbs_call_dirdyna().

The symbolic function does not return any value.

◆ mbs_extforces()

void mbs_extforces ( double **  frc,
double **  trq,
MbsData s,
double  tsim 
)

Symbolic external forces function, see mbs_call_extforces().

◆ mbs_gensensor()

void mbs_gensensor ( MbsSensor sens,
MbsData s,
int  isens 
)

Symbolic sensor computation function, see mbs_call_sensor().

The symbolic function does not return any value.

◆ mbs_get_project_functions()

void mbs_get_project_functions ( MbsData mbs_data)

loads the project function into the pointers defined in MbsData::fct

Parameters
[in,out]mbs_datathe MbsData structure of the model

◆ mbs_invdyna()

void mbs_invdyna ( double *  Qq,
MbsData s,
double  tsim 
)

Symbolic inverse dynamic function, see mbs_call_invdyna().

The symbolic function does not return any value.

◆ mbs_invdynared_dp()

int mbs_invdynared_dp ( MbsData s,
double  tsim 
)

Symbolic function, see mbs_call_invdynared_dp().

◆ mbs_invdynared_dq()

int mbs_invdynared_dq ( MbsData s,
double  tsim 
)

Symbolic function, see mbs_call_invdynared_dq().

◆ mbs_invdynared_dqd()

int mbs_invdynared_dqd ( MbsData s,
double  tsim 
)

Symbolic function, see mbs_call_invdynared_dqd().

◆ mbs_invdynared_dqdd()

int mbs_invdynared_dqdd ( MbsData s,
double  tsim 
)

Symbolic function, see mbs_call_invdynared_dqdd().

◆ mbs_link()

void mbs_link ( double **  frc,
double **  trq,
double *  Flnk,
double *  Z,
double *  Zd,
MbsData s,
double  tsim 
)

Symbolic link forces function, see mbs_call_link().

◆ mbs_link3D()

void mbs_link3D ( double **  frc,
double **  trq,
MbsData s,
double  tsim 
)

Symbolic link3D forces function, see mbs_call_link3D().

◆ mbs_sensor()

void mbs_sensor ( MbsSensor sens,
MbsData s,
int  isens 
)

Symbolic sensor computation function, see mbs_call_sensor().

The symbolic function does not return any value.

◆ user_call_cons_hJ()

int user_call_cons_hJ ( double *  h,
double **  Jac,
MbsData s,
double  tsim 
)

Module redirection for user joint force function, see user_cons_hJ() however the return differs.

Returns
0 for success, negative in case of error.

◆ user_call_cons_J_accelred()

int user_call_cons_J_accelred ( MbsData s,
double  tsim 
)

Module redirection for accelred user-specified constraints function, see user_cons_J_accelred().

◆ user_call_cons_jdqd()

int user_call_cons_jdqd ( double *  jdqd,
MbsData s,
double  tsim 
)

Module redirection for jdqd term of the user-specified constraints, see user_cons_jdqd() however the return differs.

Returns
0 for success, negative in case of error.

◆ user_call_Derivative()

int user_call_Derivative ( MbsData s)

Module redirection for the time derivative of the user state variables, see user_Derivative() however the return differs.

Returns
0 for success, negative in case of error.

◆ user_call_dirdyn_finish()

void user_call_dirdyn_finish ( MbsData MBSdata,
MbsDirdyn mbs_dd 
)

Module redirection for user own dirdyn finish function, see user_dirdyn_finish().

◆ user_call_dirdyn_init()

void user_call_dirdyn_init ( MbsData MBSdata,
MbsDirdyn mbs_dd 
)

Module redirection for user own dirdyn initialization function, see user_dirdyn_init().

◆ user_call_dirdyn_loop()

void user_call_dirdyn_loop ( MbsData MBSdata,
MbsDirdyn mbs_dd 
)

Module redirection for user own dirdyn loop function, see user_dirdyn_loop().

◆ user_call_DrivenJoints()

int user_call_DrivenJoints ( MbsData s,
double  tsim 
)

Module redirection for the computation of driven joints, see user_DrivenJoints() however the return differs.

Returns
0 for success, negative in case of error.

◆ user_call_equil_finish()

void user_call_equil_finish ( MbsData MBSdata,
MbsEquil mbs_equil 
)

Module redirection for user own equil finish function, see user_equil_finish().

◆ user_call_equil_fxe()

void user_call_equil_fxe ( MbsData mbs_data,
double *  f 
)

Module redirection for user own equilibrium equations function, see user_equil_fxe().

◆ user_call_equil_init()

void user_call_equil_init ( MbsData MBSdata,
MbsEquil mbs_equil 
)

Module redirection for user own equilibrium initialization function, see user_equil_init().

◆ user_call_equil_loop()

void user_call_equil_loop ( MbsData MBSdata,
MbsEquil mbs_equil 
)

Module redirection for user own equil loop function, see user_equil_loop().

◆ user_call_ExtForces()

double* user_call_ExtForces ( double  PxF[4],
double  RxF[4][4],
double  VxF[4],
double  OMxF[4],
double  AxF[4],
double  OMPxF[4],
MbsData s,
double  tsim,
int  ixF 
)

Module redirection for the computation of external forces, see user_DrivenJoints().

◆ user_call_ExtForces_dp()

double* user_call_ExtForces_dp ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_force 
)

Module redirection for user function, see user_ExtForces_dp().

◆ user_call_ExtForces_dq()

double* user_call_ExtForces_dq ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_force,
int  i_joint 
)

Module redirection for user function, see user_call_ExtForces_dq().

◆ user_call_ExtForces_dqd()

double* user_call_ExtForces_dqd ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_force,
int  i_joint 
)

Module redirection for user function, see user_ExtForces_dqd().

◆ user_call_ExtForces_dqdd()

double* user_call_ExtForces_dqdd ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_force,
int  i_joint 
)

Module redirection for user function, see user_ExtForces_dqdd().

◆ user_call_invdyn_finish()

void user_call_invdyn_finish ( MbsData MBSdata,
MbsInvdyn mbs_invd 
)

Module redirection for user own dirdyn finish function, see user_dirdyn_finish().

◆ user_call_invdyn_init()

void user_call_invdyn_init ( MbsData MBSdata,
MbsInvdyn mbs_invd 
)

Module redirection for user own dirdyn initialization function, see user_dirdyn_init().

◆ user_call_invdyn_loop()

void user_call_invdyn_loop ( MbsData MBSdata,
MbsInvdyn mbs_invd 
)

Module redirection for user own dirdyn loop function, see user_dirdyn_loop().

◆ user_call_JointForces()

double* user_call_JointForces ( MbsData s,
double  tsim 
)

Module redirection for user joint force function, see user_JointForces().

◆ user_call_JointForces_dp()

double* user_call_JointForces_dp ( MbsData mbs_data,
double  tsim 
)

Module redirection for user function, see user_JointForces_dp().

◆ user_call_JointForces_dq()

double* user_call_JointForces_dq ( MbsData mbs_data,
double  tsim,
int  ixJ 
)

Module redirection for user function, see user_JointForces_dq().

◆ user_call_JointForces_dqd()

double* user_call_JointForces_dqd ( MbsData mbs_data,
double  tsim,
int  ixJ 
)

Module redirection for user function, see user_JointForces_dqd().

◆ user_call_JointForces_dqdd()

double* user_call_JointForces_dqdd ( MbsData mbs_data,
double  tsim,
int  ixJ 
)

Module redirection for user function, see user_call_JointForces_dqdd().

◆ user_call_joystick_axes()

void user_call_joystick_axes ( MbsData mbs_data,
Simu_realtime realtime,
int  nb_joysticks 
)

◆ user_call_joystick_buttons()

void user_call_joystick_buttons ( MbsData mbs_data,
int  buttonID 
)

◆ user_call_keyboard()

void user_call_keyboard ( MbsData mbs_data,
Simu_realtime realtime,
int  cur_t_usec,
const Uint8 keystates 
)

◆ user_call_Link3DForces()

double* user_call_Link3DForces ( double  PxF[4],
double  RxF[4][4],
double  VxF[4],
double  OMxF[4],
double  AxF[4],
double  OMPxF[4],
MbsData s,
double  tsim,
int  ixF 
)

Module redirection for user link 3D function, see user_Link3DForces().

◆ user_call_Link3DForces_dp()

double* user_call_Link3DForces_dp ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_link3d 
)

Module redirection for user function, see user_Link3DForces_dp().

◆ user_call_Link3DForces_dq()

double* user_call_Link3DForces_dq ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_link3d,
int  i_param 
)

Module redirection for user function, see user_Link3DForces_dq().

◆ user_call_Link3DForces_dqd()

double* user_call_Link3DForces_dqd ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_link3d,
int  i_param 
)

Module redirection for user function, see user_Link3DForces_dqd().

◆ user_call_Link3DForces_dqdd()

double* user_call_Link3DForces_dqdd ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_link3d,
int  i_param 
)

Module redirection for user function, see user_Link3DForces_dqdd().

◆ user_call_LinkForces()

double user_call_LinkForces ( double  Z,
double  Zd,
MbsData s,
double  tsim,
int  ilnk 
)

Module redirection for user link force function, see user_LinkForces().

Returns
The force in the current link force or NAN if the user linkforce function is missing.

◆ user_call_LinkForces_dp()

double user_call_LinkForces_dp ( double  Z,
double  d_Z,
double  Zd,
double  d_Zd,
MbsData mbs_data,
double  tsim,
int  i_link 
)

Module redirection for user function, see user_LinkForces_dp().

◆ user_call_LinkForces_dq()

double user_call_LinkForces_dq ( double  Z,
double  d_Z,
double  Zd,
double  d_Zd,
MbsData mbs_data,
double  tsim,
int  i_link,
int  i_param 
)

Module redirection for user function, see user_LinkForces_dq().

◆ user_call_LinkForces_dqd()

double user_call_LinkForces_dqd ( double  Z,
double  d_Z,
double  Zd,
double  d_Zd,
MbsData mbs_data,
double  tsim,
int  i_link,
int  i_param 
)

Module redirection for user function, see user_LinkForces_dqd().

◆ user_call_LinkForces_dqdd()

double user_call_LinkForces_dqdd ( double  Z,
double  d_Z,
double  Zd,
double  d_Zd,
MbsData mbs_data,
double  tsim,
int  i_link,
int  i_param 
)

Module redirection for user function, see user_LinkForces_dqdd().

◆ user_call_realtime_options()

void user_call_realtime_options ( MbsData mbs_data,
Realtime_option options 
)

◆ user_call_realtime_plot()

void user_call_realtime_plot ( MbsData mbs_data)

◆ user_call_realtime_visu()

void user_call_realtime_visu ( MbsData mbs_data,
int  nb_models,
int *  nb_q,
double **  q_vec 
)

Redirection to the user-specified user function of realtime visualization.

If the user function is not defined (NULL function pointer) the default behaviour is to set the current joint coordinates to the visualisation pipe. The default behaviour is only called if a single animated model is loaded.

Parameters
[in]mbs_dataThe multibody system related to the visualisation.
[in]nb_modelsThe number of the system in the visualusation.
[in]nb_qNumber of element to be provided for each system.
[in]nb_qvec The pipe containing the value provided to each system.

◆ user_cons_hJ()

void user_cons_hJ ( double *  h,
double **  Jac,
MbsData s,
double  tsim 
)

Compute the user-specified constraint vector and Jacobian.

The arguments are the same for the module redirection function user_call_cons_hJ() and the user filled function user_cons_hJ(). However the return differs.

Parameters
[out]hThe user constraint vector, see MbsAux::huserc.
[out]JacThe Jacobian of user constraint vector, see MbsAux::Juserc.
[in]sThe MbsData structure of the model.
[in]tsimthe current time of the simulation

The only field that should be incremented is the MbsData::Qq at the indexes of MbsData::qc

◆ user_cons_J_accelred()

int user_cons_J_accelred ( MbsData s,
double  tsim 
)

Close the user-specified constraints and compute the Jacobian of the constraints vector.

This function is only required for accelred symbolic file.

The constraints must be solved by the user, inside this function. The constraints are solved by modifying the value MbsData::q located at the indices given by MbsData::qv.

The Jacobian matrix to be filled is MbsData::jac_user (already allocated with index starting at 1). The Jacobian must be computed in the constraint solved configuration.

The arguments are the same for the module redirection function user_call_cons_J_accelred() and the user filled function user_cons_J_accelred().

Parameters
[in,out]sThe MbsData structure of the model. The only values that should be modified are the located in the arrays MbsData::jac_user and MbsData::q.
[in]tsimthe current time of the simulation
Returns
error status, zero if ok, negative in case of failure

◆ user_cons_jdqd()

void user_cons_jdqd ( double *  jdqd,
MbsData s,
double  tsim 
)

Compute the jdqd term of the user-specified constraints.

The arguments are the same for the module redirection function user_call_cons_jdqd() and the user filled function user_cons_jdqd().

Parameters
[out]jdqdThe jdqd term of loops constraint, see MbsAux::jdqduserc.
[in]sThe MbsData structure of the model.
[in]tsimthe current time of the simulation

◆ user_Derivative()

void user_Derivative ( MbsData s)

Compute the time derivative of the user state variables defined in the user model.

The arguments are the same for the module redirection function user_call_Derivative() and the user filled function user_Derivative(). However the return differs.

Parameters
[in,out]sThe MbsData structure of the model. The field MbsData::uxd must be filled with the derivative values.

◆ user_dirdyn_finish()

void user_dirdyn_finish ( MbsData mbs_data,
MbsDirdyn mbs_dd 
)

user own finishing functions

Parameters
[in,out]mbs_datadata structure of the model
[in,out]mbs_ddgeneral structure of the direct dynamic module (for advanced users)

For beginners, it is advised to only use the MbsData structure. The field MbsDirdyn is provided for more advanced users.

◆ user_dirdyn_init()

void user_dirdyn_init ( MbsData mbs_data,
MbsDirdyn mbs_dd 
)

user own initialization functions

Parameters
[in,out]mbs_datadata structure of the model
[in,out]mbs_ddgeneral structure of the direct dynamic module (for advanced users)

For beginners, it is advised to only use the MbsData structure. The field MbsDirdyn is provided for more advanced users.

◆ user_dirdyn_loop()

void user_dirdyn_loop ( MbsData mbs_data,
MbsDirdyn mbs_dd 
)

user own loop functions

This function is called a every time step. Warning: if the used integrator is multi-steps, user_dirdyn_loop is only called once: i.e. at the real time step (and not internal time steps)

Parameters
[in,out]mbs_datadata structure of the model
[in,out]mbs_ddgeneral structure of the direct dynamic module (for advanced users)

For beginners, it is advised to only use the MbsData structure. The field MbsDirdyn is provided for more advanced users.

◆ user_DrivenJoints()

void user_DrivenJoints ( MbsData s,
double  tsim 
)

Compute the positions, velocities and acceleration of driven joint.

The arguments are the same for the module redirection function user_call_DrivenJoints() and the user filled function user_DrivenJoints(). However the return differs.

Parameters
[in,out]sthe MbsData structure of the model on which the driven joint are computed. The only fields that should be updated are MbsData::q, MbsData::qd and MbsData::qdd at the indexes MbsData::qc.
[in]tsimthe current time of the simulation

◆ user_equil_finish()

void user_equil_finish ( MbsData mbs_data,
MbsEquil mbs_equil 
)

user own finishing functions

Parameters
[in,out]mbs_datadata structure of the model
[in,out]mbs_equilgeneral structure of the equilibrium module (for advance users)

For beginners, it is advised to only use the MbsData structure. The field MbsEquil is provided for more advance users.

◆ user_equil_fxe()

void user_equil_fxe ( MbsData mbs_data,
double *  f 
)

user own implementation of added equilibrium equations Fxe Necessary to express equilibrium f(x)=0

Parameters
[in]mbs_datadata structure of the model
[out]fvectors which contains the added equibrium functions : =f(xe, ... )

◆ user_equil_init()

void user_equil_init ( MbsData mbs_data,
MbsEquil mbs_equil 
)

user own initialization functions


Robotran - MBsysC

Template file for equilibrium module

This files enable the user to call custom at specific places in the time simulation. It is a template file that can be edited by the user.

(c) Universite catholique de Louvain

Parameters
[in,out]mbs_datadata structure of the model
[in,out]mbs_equilgeneral structure of the equilibrium module (for advance users)

For beginners, it is advised to only use the MbsData structure. The field MbsEquil is provided for more advance users.

◆ user_equil_loop()

void user_equil_loop ( MbsData mbs_data,
MbsEquil mbs_equil 
)

user own loop functions

Parameters
[in,out]mbs_datadata structure of the model
[in,out]mbs_equilgeneral structure of the equilibrium module (for advance users)

For beginners, it is advised to only use the MbsData structure. The field MbsEquil is provided for more advance users.

◆ user_ExtForces()

double* user_ExtForces ( double  PxF[4],
double  RxF[4][4],
double  VxF[4],
double  OMxF[4],
double  AxF[4],
double  OMPxF[4],
MbsData s,
double  tsim,
int  ixF 
)

Compute an user-specified external force.

Parameters
[in]PxFposition vector (index starting at 1) of the force sensor expressed in the inertial frame: $PxF(1:3)=[P_x; P_y; P_z]$.
[in]RxFrotation matrix (index starting at 1) from the inertial frame to the force sensor frame: $[\hat{\mathbf{X}}^S]=RxF(1:3,1:3).[\hat{\mathbf{X}}^0]$
[in]VxFvelocity vector (index starting at 1) of the force sensor expressed in the inertial frame: $VxF(1:3)=[V_x; V_y; V_z]$.
[in]OMxFangular velocity vector (index starting at 1) of the force sensor expressed in the inertial frame: $OMxF(1:3)=[\omega_x; \omega_y; \omega_z]$.
[in]AxFacceleration vector (index starting at 1) of the force sensor expressed in the inertial frame: $AxF(1:3)=[A_x; A_y; A_z]$.
[in]OMPxFangular acceleration vector (index starting at 1) of the force sensor expressed in the inertial frame: $OMPxF(1:3)=[\dot\omega_x; \dot\omega_y; \dot\omega_z]$.
[in,out]sthe MbsData structure of the model on which the force is computed. Only the values in the array MbsData::SWr at the row ixF should be modified.
[in]tsimthe current time of the simulation
[in]ixFthe ID identifying the computed force sensor.
Returns
A vector (of size 9, index starting at 1) with the content described for MbsData::SWr

The content of the returned vector Swr is [Fx; Fy; Fz; Mx; My; Mz; dxF]:

  • Force components (expressed in the inertial frame) : Fx, Fy, Fz
  • Pure torque components (expressed in the inertial frame) : Mx, My, Mz
  • Application point local coordinates vector (expressed in the body-fixed frame): dxF(1:3,1)

◆ user_ExtForces_dp()

double* user_ExtForces_dp ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_force,
int  i_joint 
)

Compute the partial derivative of an user-specified external force with respect to a specific parameter.

Parameters
[in]PxFposition vector (index starting at 1) of the force sensor expressed in the inertial frame: $PxF(1:3)=[P_x; P_y; P_z]$.
[in]d_PxFthe partial derivative of PxF with respect to the parameter i_param: $d\_PxF = \frac{\partial PxF}{\partial i\_param}$.
[in]RxFrotation matrix (index starting at 1) from the inertial frame to the force sensor frame: $[\hat{\mathbf{X}}^S]=RxF(1:3,1:3).[\hat{\mathbf{X}}^0]$
[in]d_RxFthe partial derivative of matrix RxF with respect to the parameter i_param: $d\_RxF = \frac{\partial RxF}{\partial i\_param}$.
[in]VxFvelocity vector (index starting at 1) of the force sensor expressed in the inertial frame: $VxF(1:3)=[V_x; V_y; V_z]$.
[in]d_VxFthe partial derivative of VxF with respect to the parameter i_param: $d\_VxF = \frac{\partial VxF}{\partial i\_param}$.
[in]OMxFangular velocity vector (index starting at 1) of the force sensor expressed in the inertial frame: $OMxF(1:3)=[\omega_x; \omega_y; \omega_z]$.
[in]d_OMxFthe partial derivative of OMxF with respect to the parameter i_param: $d\_OMxF = \frac{\partial OMxF}{\partial i\_param}$.
[in]AxFacceleration vector (index starting at 1) of the force sensor expressed in the inertial frame: $AxF(1:3)=[A_x; A_y; A_z]$.
[in]d_AxFthe partial derivative of AxF with respect to the parameter i_param: $d\_AxF = \frac{\partial AxF}{\partial i\_param}$.
[in]OMPxFangular acceleration vector (index starting at 1) of the force sensor expressed in the inertial frame: $OMPxF(1:3)=[\dot\omega_x; \dot\omega_y; \dot\omega_z]$.
[in]d_OMPxFthe partial derivative of OMPxF with respect to the parameter i_param: $d\_OMPxF = \frac{\partial OMPxF}{\partial i\_param}$.
[in,out]sthe MbsData structure of the model on which the force is computed.
[in]tsimthe current time of the simulation
[in]i_forcethe ID identifying the computed force sensor.
Returns
A vector (of size 9, index starting at 0) with the content described for MbsData::mbs_dp->dSWr_dp

The content of the returned vector dSWr_dp is [dF_dp; dMx_dp; ddxF_dp]:

  • Partial derivative of the force components (expressed in the inertial frame): dF_dp = $\left[\frac{\partial Fx}{\partial i\_param} ; \frac{\partial Fy}{\partial i\_param} ; \frac{\partial Fz}{\partial i\_param}\right]$
  • Partial derivative of the pure torque components (expressed in the inertial frame): dM_dp = $\left[\frac{\partial Mx}{\partial i\_param} ; \frac{\partial My}{\partial i\_param} ; \frac{\partial Mz}{\partial i\_param}\right]$
  • Partial derivative of the application point local coordinates vector (expressed in the body-fixed frame): ddxF_dp = $\left[\frac{\partial dxF}{\partial i\_param} ; \frac{\partial dxF}{\partial i\_param} ; \frac{\partial dxF}{\partial i\_param}\right]$

◆ user_ExtForces_dq()

double* user_ExtForces_dq ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_force,
int  i_joint 
)

Compute the partial derivative of an user-specified external force with respect to a generalized coordinate.

Parameters
[in]PxFposition vector (index starting at 1) of the force sensor expressed in the inertial frame: $PxF(1:3)=[P_x; P_y; P_z]$.
[in]d_PxFthe partial derivative of PxF with respect to the generalized coordinate of joint i_joint: $d\_PxF = \frac{\partial PxF}{\partial q_{i\_joint}}$.
[in]RxFrotation matrix (index starting at 1) from the inertial frame to the force sensor frame: $[\hat{\mathbf{X}}^S]=RxF(1:3,1:3).[\hat{\mathbf{X}}^0]$
[in]d_RxFthe partial derivative of matrix RxF with respect to the generalized coordinate of joint i_joint: $d\_RxF = \frac{\partial RxF}{\partial q_{i\_joint}}$.
[in]VxFvelocity vector (index starting at 1) of the force sensor expressed in the inertial frame: $VxF(1:3)=[V_x; V_y; V_z]$.
[in]d_VxFthe partial derivative of VxF with respect to the generalized coordinate of joint i_joint: $d\_VxF = \frac{\partial VxF}{\partial q_{i\_joint}}$.
[in]OMxFangular velocity vector (index starting at 1) of the force sensor expressed in the inertial frame: $OMxF(1:3)=[\omega_x; \omega_y; \omega_z]$.
[in]d_OMxFthe partial derivative of OMxF with respect to the generalized coordinate of joint i_joint: $d\_OMxF = \frac{\partial OMxF}{\partial q_{i\_joint}}$.
[in]AxFacceleration vector (index starting at 1) of the force sensor expressed in the inertial frame: $AxF(1:3)=[A_x; A_y; A_z]$.
[in]d_AxFthe partial derivative of AxF with respect to the generalized coordinate of joint i_joint: $d\_AxF = \frac{\partial AxF}{\partial q_{i\_joint}}$.
[in]OMPxFangular acceleration vector (index starting at 1) of the force sensor expressed in the inertial frame: $OMPxF(1:3)=[\dot\omega_x; \dot\omega_y; \dot\omega_z]$.
[in]d_OMPxFthe partial derivative of OMPxF with respect to the generalized coordinate of joint i_joint: $d\_OMPxF = \frac{\partial OMPxF}{\partial q_{i\_joint}}$.
[in,out]sthe MbsData structure of the model on which the force is computed.
[in]tsimthe current time of the simulation
[in]i_forcethe ID identifying the computed force sensor.
[in]i_jointthe index of the generalized coordinate.
Returns
A vector (of size 9, index starting at 0) with the content described for MbsData::mbs_dp->dSWr_dq

The content of the returned vector dSWr_dq is [dF_dq; dMx_dq; ddxF_dq]:

  • Partial derivative of the force components (expressed in the inertial frame): dF_dq = $\left[\frac{\partial Fx}{\partial q_{i\_joint}} ; \frac{\partial Fy}{\partial q_{i\_joint}} ; \frac{\partial Fz}{\partial q_{i\_joint}}\right]$
  • Partial derivative of the pure torque components (expressed in the inertial frame): dM_dq = $\left[\frac{\partial Mx}{\partial q_{i\_joint}} ; \frac{\partial My}{\partial q_{i\_joint}} ; \frac{\partial Mz}{\partial q_{i\_joint}}\right]$
  • Partial derivative of the application point local coordinates vector (expressed in the body-fixed frame): ddxF_dq = $\left[\frac{\partial dxF}{\partial q_{i\_joint}} ; \frac{\partial dxF}{\partial q_{i\_joint}} ; \frac{\partial dxF}{\partial q_{i\_joint}}\right]$

◆ user_ExtForces_dqd()

double* user_ExtForces_dqd ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_force,
int  i_joint 
)

Compute the partial derivative of an user-specified external force with respect to a generalized velocity.

Parameters
[in]PxFposition vector (index starting at 1) of the force sensor expressed in the inertial frame: $PxF(1:3)=[P_x; P_y; P_z]$.
[in]d_PxFthe partial derivative of PxF with respect to the generalized velocity of joint i_joint: $d\_PxF = \frac{\partial PxF}{\partial \dot{q}_{i\_joint}}$.
[in]RxFrotation matrix (index starting at 1) from the inertial frame to the force sensor frame: $[\hat{\mathbf{X}}^S]=RxF(1:3,1:3).[\hat{\mathbf{X}}^0]$
[in]d_RxFthe partial derivative of matrix RxF with respect to the generalized velocity of joint i_joint: $d\_RxF = \frac{\partial RxF}{\partial \dot{q}_{i\_joint}}$.
[in]VxFvelocity vector (index starting at 1) of the force sensor expressed in the inertial frame: $VxF(1:3)=[V_x; V_y; V_z]$.
[in]d_VxFthe partial derivative of VxF with respect to the generalized velocity of joint i_joint: $d\_VxF = \frac{\partial VxF}{\partial \dot{q}_{i\_joint}}$.
[in]OMxFangular velocity vector (index starting at 1) of the force sensor expressed in the inertial frame: $OMxF(1:3)=[\omega_x; \omega_y; \omega_z]$.
[in]d_OMxFthe partial derivative of OMxF with respect to the generalized velocity of joint i_joint: $d\_OMxF = \frac{\partial OMxF}{\partial \dot{q}_{i\_joint}}$.
[in]AxFacceleration vector (index starting at 1) of the force sensor expressed in the inertial frame: $AxF(1:3)=[A_x; A_y; A_z]$.
[in]d_AxFthe partial derivative of AxF with respect to the generalized velocity of joint i_joint: $d\_AxF = \frac{\partial AxF}{\partial \dot{q}_{i\_joint}}$.
[in]OMPxFangular acceleration vector (index starting at 1) of the force sensor expressed in the inertial frame: $OMPxF(1:3)=[\dot\omega_x; \dot\omega_y; \dot\omega_z]$.
[in]d_OMPxFthe partial derivative of OMPxF with respect to the generalized velocity of joint i_joint: $d\_OMPxF = \frac{\partial OMPxF}{\partial \dot{q}_{i\_joint}}$.
[in,out]sthe MbsData structure of the model on which the force is computed.
[in]tsimthe current time of the simulation
[in]i_forcethe ID identifying the computed force sensor.
[in]i_jointthe index of the generalized velocity.
Returns
A vector (of size 9, index starting at 0) with the content described for MbsData::mbs_dp->dSWr_dqd

The content of the returned vector dSWr_dqd is [dF_dqd; dMx_dqd; ddxF_dqd]:

  • Partial derivative of the force components (expressed in the inertial frame): dF_dqd = $\left[\frac{\partial Fx}{\partial \dot{q}_{i\_joint}} ; \frac{\partial Fy}{\partial \dot{q}_{i\_joint}} ; \frac{\partial Fz}{\partial \dot{q}_{i\_joint}}\right]$
  • Partial derivative of the pure torque components (expressed in the inertial frame): dM_dqd = $\left[\frac{\partial Mx}{\partial \dot{q}_{i\_joint}} ; \frac{\partial My}{\partial \dot{q}_{i\_joint}} ; \frac{\partial Mz}{\partial \dot{q}_{i\_joint}}\right]$
  • Partial derivative of the application point local coordinates vector (expressed in the body-fixed frame): ddxF_dqd = $\left[\frac{\partial dxF}{\partial \dot{q}_{i\_joint}} ; \frac{\partial dxF}{\partial \dot{q}_{i\_joint}} ; \frac{\partial dxF}{\partial \dot{q}_{i\_joint}}\right]$

◆ user_ExtForces_dqdd()

double* user_ExtForces_dqdd ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_force,
int  i_joint 
)

Compute the partial derivative of an user-specified external force with respect to a generalized acceleration.

Parameters
[in]PxFposition vector (index starting at 1) of the force sensor expressed in the inertial frame: $PxF(1:3)=[P_x; P_y; P_z]$.
[in]d_PxFthe partial derivative of PxF with respect to the generalized velocity of joint i_joint: $d\_PxF = \frac{\partial PxF}{\partial \dot{q}_{i\_joint}}$.
[in]RxFrotation matrix (index starting at 1) from the inertial frame to the force sensor frame: $[\hat{\mathbf{X}}^S]=RxF(1:3,1:3).[\hat{\mathbf{X}}^0]$
[in]d_RxFthe partial derivative of matrix RxF with respect to the generalized velocity of joint i_joint: $d\_RxF = \frac{\partial RxF}{\partial \dot{q}_{i\_joint}}$.
[in]VxFvelocity vector (index starting at 1) of the force sensor expressed in the inertial frame: $VxF(1:3)=[V_x; V_y; V_z]$.
[in]d_VxFthe partial derivative of VxF with respect to the generalized velocity of joint i_joint: $d\_VxF = \frac{\partial VxF}{\partial \dot{q}_{i\_joint}}$.
[in]OMxFangular velocity vector (index starting at 1) of the force sensor expressed in the inertial frame: $OMxF(1:3)=[\omega_x; \omega_y; \omega_z]$.
[in]d_OMxFthe partial derivative of OMxF with respect to the generalized velocity of joint i_joint: $d\_OMxF = \frac{\partial OMxF}{\partial \dot{q}_{i\_joint}}$.
[in]AxFacceleration vector (index starting at 1) of the force sensor expressed in the inertial frame: $AxF(1:3)=[A_x; A_y; A_z]$.
[in]d_AxFthe partial derivative of AxF with respect to the generalized velocity of joint i_joint: $d\_AxF = \frac{\partial AxF}{\partial \dot{q}_{i\_joint}}$.
[in]OMPxFangular acceleration vector (index starting at 1) of the force sensor expressed in the inertial frame: $OMPxF(1:3)=[\dot\omega_x; \dot\omega_y; \dot\omega_z]$.
[in]d_OMPxFthe partial derivative of OMPxF with respect to the generalized velocity of joint i_joint: $d\_OMPxF = \frac{\partial OMPxF}{\partial \dot{q}_{i\_joint}}$.
[in,out]sthe MbsData structure of the model on which the force is computed.
[in]tsimthe current time of the simulation
[in]i_forcethe ID identifying the computed force sensor.
[in]i_jointthe index of the generalized velocity.
Returns
A vector (of size 9, index starting at 0) with the content described for MbsData::mbs_dp->dSWr_dqdd

The content of the returned vector dSWr_dqdd is [dF_dqdd; dMx_dqdd; ddxF_dqdd]:

  • Partial derivative of the force components (expressed in the inertial frame): dF_dqdd = $\left[\frac{\partial Fx}{\partial \ddot{q}_{i\_joint}} ; \frac{\partial Fy}{\partial \ddot{q}_{i\_joint}} ; \frac{\partial Fz}{\partial \ddot{q}_{i\_joint}}\right]$
  • Partial derivative of the pure torque components (expressed in the inertial frame): dM_dqdd = $\left[\frac{\partial Mx}{\partial \ddot{q}_{i\_joint}} ; \frac{\partial My}{\partial \ddot{q}_{i\_joint}} ; \frac{\partial Mz}{\partial \ddot{q}_{i\_joint}}\right]$
  • Partial derivative of the application point local coordinates vector (expressed in the body-fixed frame): ddxF_dqdd = $\left[\frac{\partial dxF}{\partial \ddot{q}_{i\_joint}} ; \frac{\partial dxF}{\partial \ddot{q}_{i\_joint}} ; \frac{\partial dxF}{\partial \ddot{q}_{i\_joint}}\right]$

◆ user_free()

void user_free ( MbsData mbs_data)

User own freeing operations.

This function will automatically be called at the project freeing by mbs_delete_data() function. All memory allocated by the user (ie. in a user model) should be properly freed. Such memory may have been allocated in the user_load_post() function.

Parameters
[in,out]mbs_datadata structure of the model

◆ user_GenExtForces()

double* user_GenExtForces ( double  PxF[4],
double  RxF[4][4],
double  VxF[4],
double  OMxF[4],
double  AxF[4],
double  OMPxF[4],
MbsData s,
double  tsim,
int  iBody 
)

◆ user_invd_loop()

void user_invd_loop ( MbsData MBSdata,
MbsInvdyn mbs_invd 
)

◆ user_invdyn_finish()

void user_invdyn_finish ( MbsData MBSdata,
MbsInvdyn mbs_invd 
)

◆ user_invdyn_init()

void user_invdyn_init ( MbsData MBSdata,
MbsInvdyn mbs_invd 
)

◆ user_JointForces()

double* user_JointForces ( MbsData s,
double  tsim 
)

Compute the user-specified joint force in all joint.

The arguments are the same for the module redirection function user_call_JointForces() and the user filled function user_JointForces().

Parameters
[in,out]TheMbsData structure of the model. The only values that should be modified are located MbsData::Qq.
[in]tsimthe current time of the simulation
Returns
The joint internal force/torque vector, see MbsData::Qq

◆ user_JointForces_dp()

double* user_JointForces_dp ( MbsData mbs_data,
double  tsim 
)

Compute the derivative of the joint forces vector according to a specific parameter.

The only field that should be modified is the MbsData::derivative->dQq_dp at the row of ixP:

\[dQq_dp[ixP] = \frac{\partial Qq}{\partial p_{ixP}}\]

.

Parameters
[in,out]mbs_datathe MbsData structure of the model.
[in]tsimthe current time of the simulation
Returns
The pointer to MbsData::derivative->dQq_dp[ixP]

◆ user_JointForces_dq()

double* user_JointForces_dq ( MbsData mbs_data,
double  tsim,
int  ixJ 
)

Compute the derivative of the joint forces vector according to a generalized coordinate.

The only field that should be modified is the MbsData::derivative->dQq_dq at the row of ixJ:

\[dQq_dq[ixJ] = \frac{\partial Qq}{\partial q_{ixJ}}\]

.

Parameters
[in,out]mbs_datathe MbsData structure of the model.
[in]tsimthe current time of the simulation
[in]ixJThe id of the generalized coordinate.
Returns
The pointer to MbsData::derivative->dQq_dq[ixJ]

◆ user_JointForces_dqd()

double* user_JointForces_dqd ( MbsData mbs_data,
double  tsim,
int  ixJ 
)

Compute the derivative of the joint forces vector according to a generalized velocity.

The only field that should be modified is the MbsData::derivative->dQq_dqd at the row of ixJ:

\[dQq_dqd[ixJ] = \frac{\partial Qq}{\partial qd_{ixJ}}\]

.

Parameters
[in,out]mbs_datathe MbsData structure of the model.
[in]tsimthe current time of the simulation
[in]ixJThe id of the generalized coordinate.
Returns
The pointer to MbsData::derivative->dQq_dqd[ixJ]

◆ user_JointForces_dqdd()

double* user_JointForces_dqdd ( MbsData mbs_data,
double  tsim,
int  ixJ 
)

Compute the derivative of the joint forces vector according to a generalized acceleartion.

The only field that should be modified is the MbsData::derivative->dQq_dqdd at the row of ixJ:

\[dQq_dqdd[ixJ] = \frac{\partial Qq}{\partial qdd_{ixJ}}\]

.

Parameters
[in,out]mbs_datathe MbsData structure of the model.
[in]tsimthe current time of the simulation
[in]ixJThe id of the generalized coordinate.
Returns
The pointer to MbsData::derivative->dQq_dqdd[ixJ]

◆ user_Link3DForces()

double* user_Link3DForces ( double  PxF[4],
double  RxF[4][4],
double  VxF[4],
double  OMxF[4],
double  AxF[4],
double  OMPxF[4],
MbsData s,
double  tsim,
int  ixF 
)

Compute an user-specified point to point force, with arbitrary line of action.

A 3D link force is attached from a body (called the parent body) to a second body (called children body). The parent and children bodies cannot be inverted as it change the definition of both the inputs arguments and outputs results.

For the documentation below, let:

  • point "A" be the anchor point on the parent body;
  • point "B" the anchor point on the children body;
  • point "M" the mid-point between "A" and "B";
  • frame [P], the frame attached to the parent body
  • frame [C], the frame attached to the children body

The returned force/torque component are expressed in the frame [P] and applied on both parent and children body at the location of point "B".

Parameters
[in]PxFThe vector "AB" (index starting at 1) with components expressed in frame [P].
[in]RxFThe rotation matrix (index starting at 1) such as [C] = RxF*[P].
[in]VxFThe differential velocity vector (index starting at 1) with components expressed in frame [P]. The velocities are computed at the coordinates of point "M" linked to parent (Md_p), then linked to children (Md_c) body. The differential velocity vector is : Md_c - Md_p.
[in]OMxFThe differential angular velocity vector (index starting at 1) with components expressed in frame [P]. It is the difference between the parent angular velocity and the children angular velocity.
[in]AxFThe differential acceleration vector (index starting at 1) with components expressed in frame [P]. The accelerations are computed at the coordinates of point "M" linked to parent (Mdd_p), then linked to children (Mdd_c) body. The differential acceleration vector is : Mdd_c - Mdd_p.
[in]OMPxFThe differential angular acceleration vector (index starting at 1) with components expressed in frame [P]. It is the difference between the parent angular acceleration and the children angular acceleration.
[in,out]sThe MbsData structure of the model on which the force is computed.
[in]tsimThe current time of the simulation
[in]ixFThe ID identifying the computed link3D force.
Returns
A vector (of size 6, index starting at 1) with the content described for MbsData::l3DW The content of the returned vector Swr is [Fx; Fy; Fz; Mx; My; Mz]:
  • Force components (expressed in frame [P]) : Fx, Fy, Fz
  • Pure torque components (expressed in frame [P]) : Mx, My, Mz

◆ user_Link3DForces_dp()

double* user_Link3DForces_dp ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_link3d 
)

Compute the partial derivative of a link3D forces with respect to a parameter.

Parameters
[in]PxFThe vector "AB" (index starting at 1) with components expressed in frame [P].
[in]d_PxFthe partial derivative of PxF with respect to the generalized coordinate of joint i_joint: $d\_PxF = \frac{\partial PxF}{\partial q_{i\_joint}}$.
[in]RxFThe rotation matrix (index starting at 1) such as [C] = Rxf*[P].
[in]d_RxFthe partial derivative of matrix RxF with respect to the generalized coordinate of joint i_joint: $d\_RxF = \frac{\partial RxF}{\partial q_{i\_joint}}$.
[in]VxFThe differential velocity vector (index starting at 1) with components expressed in frame [P]. The velocities are computed at the coordinates of point "M" linked to parent (Md_p), then linked to children (Md_c) body. The differential velocity vector is : Md_c - Md_p.
[in]d_VxFthe partial derivative of VxF with respect to the generalized coordinate of joint i_joint: $d\_VxF = \frac{\partial VxF}{\partial q_{i\_joint}}$.
[in]OMxFThe differential angular velocity vector (index starting at 1) with components expressed in frame [P]. It is the difference between the parent angular velocity and the children angular velocity.
[in]d_OMxFthe partial derivative of OMxF with respect to the generalized coordinate of joint i_joint: $d\_OMxF = \frac{\partial OMxF}{\partial q_{i\_joint}}$.
[in]AxFThe differential acceleration vector (index starting at 1) with components expressed in frame [P]. The accelerations are computed at the coordinates of point "M" linked to parent (Mdd_p), then linked to children (Mdd_c) body. The differential acceleration vector is : Mdd_c - Mdd_p.
[in]d_AxFthe partial derivative of AxF with respect to the generalized coordinate of joint i_joint: $d\_AxF = \frac{\partial AxF}{\partial q_{i\_joint}}$.
[in]OMPxFThe differential angular acceleration vector (index starting at 1) with components expressed in frame [P]. It is the difference between the parent angular acceleration and the children angular acceleration.
[in]d_OMPxFthe partial derivative of OMPxF with respect to the generalized coordinate of joint i_joint: $d\_OMPxF = \frac{\partial OMPxF}{\partial q_{i\_joint}}$.
[in,out]sThe MbsData structure of the model on which the force is computed.
[in]tsimThe current time of the simulation
[in]i_link3dThe ID identifying the computed link3D force.
Returns
The partial derivative of the link3D force with respect to generalized parameter i_joint: The content of the returned vector dSWr_link3d_dp is [dF_dq; dMx_dq; ddxF_dq]:
  • Partial derivative of the link3d components (expressed in the inertial frame): dF_dq = $\left[\frac{\partial Fx}{\partial q_{i\_joint}} ; \frac{\partial Fy}{\partial q_{i\_joint}} ; \frac{\partial Fz}{\partial q_{i\_joint}}\right]$
  • Partial derivative of the pure torque components (expressed in the inertial frame): dM_dq = $\left[\frac{\partial Mx}{\partial q_{i\_joint}} ; \frac{\partial My}{\partial q_{i\_joint}} ; \frac{\partial Mz}{\partial q_{i\_joint}}\right]$
  • Partial derivative of the application point local coordinates vector (expressed in the body-fixed frame): ddxF_dq = $\left[\frac{\partial dxF}{\partial q_{i\_joint}} ; \frac{\partial dxF}{\partial q_{i\_joint}} ; \frac{\partial dxF}{\partial q_{i\_joint}}\right]$

    In 1D, it gives:

    \[d\_Flink3D_{i\_link3D} = \frac{\partial Flink3D_{i\_link3D}}{\partial q_{i\_joint}}\]

    .

◆ user_Link3DForces_dq()

double* user_Link3DForces_dq ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_link3d,
int  i_param 
)

Compute the partial derivative of a link3D forces with respect to a generalized coordinate.

Parameters
[in]PxFThe vector "AB" (index starting at 1) with components expressed in frame [P].
[in]d_PxFthe partial derivative of PxF with respect to the generalized coordinate of joint i_joint: $d\_PxF = \frac{\partial PxF}{\partial q_{i\_joint}}$.
[in]RxFThe rotation matrix (index starting at 1) such as [C] = Rxf*[P].
[in]d_RxFthe partial derivative of matrix RxF with respect to the generalized coordinate of joint i_joint: $d\_RxF = \frac{\partial RxF}{\partial q_{i\_joint}}$.
[in]VxFThe differential velocity vector (index starting at 1) with components expressed in frame [P]. The velocities are computed at the coordinates of point "M" linked to parent (Md_p), then linked to children (Md_c) body. The differential velocity vector is : Md_c - Md_p.
[in]d_VxFthe partial derivative of VxF with respect to the generalized coordinate of joint i_joint: $d\_VxF = \frac{\partial VxF}{\partial q_{i\_joint}}$.
[in]OMxFThe differential angular velocity vector (index starting at 1) with components expressed in frame [P]. It is the difference between the parent angular velocity and the children angular velocity.
[in]d_OMxFthe partial derivative of OMxF with respect to the generalized coordinate of joint i_joint: $d\_OMxF = \frac{\partial OMxF}{\partial q_{i\_joint}}$.
[in]AxFThe differential acceleration vector (index starting at 1) with components expressed in frame [P]. The accelerations are computed at the coordinates of point "M" linked to parent (Mdd_p), then linked to children (Mdd_c) body. The differential acceleration vector is : Mdd_c - Mdd_p.
[in]d_AxFthe partial derivative of AxF with respect to the generalized coordinate of joint i_joint: $d\_AxF = \frac{\partial AxF}{\partial q_{i\_joint}}$.
[in]OMPxFThe differential angular acceleration vector (index starting at 1) with components expressed in frame [P]. It is the difference between the parent angular acceleration and the children angular acceleration.
[in]d_OMPxFthe partial derivative of OMPxF with respect to the generalized coordinate of joint i_joint: $d\_OMPxF = \frac{\partial OMPxF}{\partial q_{i\_joint}}$.
[in,out]sThe MbsData structure of the model on which the force is computed.
[in]tsimThe current time of the simulation
[in]i_link3dThe ID identifying the computed link3D force
[in]i_paramThe id of the parameter.
Returns
The partial derivative of the link3D force with respect to generalized coordinate i_joint: The content of the returned vector dSWr_link3d_dq is [dF_dq; dMx_dq; ddxF_dq]:
  • Partial derivative of the link3d components (expressed in the inertial frame): dF_dq = $\left[\frac{\partial Fx}{\partial q_{i\_joint}} ; \frac{\partial Fy}{\partial q_{i\_joint}} ; \frac{\partial Fz}{\partial q_{i\_joint}}\right]$
  • Partial derivative of the pure torque components (expressed in the inertial frame): dM_dq = $\left[\frac{\partial Mx}{\partial q_{i\_joint}} ; \frac{\partial My}{\partial q_{i\_joint}} ; \frac{\partial Mz}{\partial q_{i\_joint}}\right]$
  • Partial derivative of the application point local coordinates vector (expressed in the body-fixed frame): ddxF_dq = $\left[\frac{\partial dxF}{\partial q_{i\_joint}} ; \frac{\partial dxF}{\partial q_{i\_joint}} ; \frac{\partial dxF}{\partial q_{i\_joint}}\right]$

    In 1D, it gives:

    \[d\_Flink3D_{i\_link3D} = \frac{\partial Flink3D_{i\_link3D}}{\partial q_{i\_joint}}\]

    .

◆ user_Link3DForces_dqd()

double* user_Link3DForces_dqd ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_link3d,
int  i_param 
)

Compute the partial derivative of a link3D forces with respect to a generalized velocity.

Parameters
[in]PxFThe vector "AB" (index starting at 1) with components expressed in frame [P].
[in]d_PxFthe partial derivative of PxF with respect to the generalized coordinate of joint i_joint: $d\_PxF = \frac{\partial PxF}{\partial q_{i\_joint}}$.
[in]RxFThe rotation matrix (index starting at 1) such as [C] = Rxf*[P].
[in]d_RxFthe partial derivative of matrix RxF with respect to the generalized coordinate of joint i_joint: $d\_RxF = \frac{\partial RxF}{\partial q_{i\_joint}}$.
[in]VxFThe differential velocity vector (index starting at 1) with components expressed in frame [P]. The velocities are computed at the coordinates of point "M" linked to parent (Md_p), then linked to children (Md_c) body. The differential velocity vector is : Md_c - Md_p.
[in]d_VxFthe partial derivative of VxF with respect to the generalized coordinate of joint i_joint: $d\_VxF = \frac{\partial VxF}{\partial q_{i\_joint}}$.
[in]OMxFThe differential angular velocity vector (index starting at 1) with components expressed in frame [P]. It is the difference between the parent angular velocity and the children angular velocity.
[in]d_OMxFthe partial derivative of OMxF with respect to the generalized coordinate of joint i_joint: $d\_OMxF = \frac{\partial OMxF}{\partial q_{i\_joint}}$.
[in]AxFThe differential acceleration vector (index starting at 1) with components expressed in frame [P]. The accelerations are computed at the coordinates of point "M" linked to parent (Mdd_p), then linked to children (Mdd_c) body. The differential acceleration vector is : Mdd_c - Mdd_p.
[in]d_AxFthe partial derivative of AxF with respect to the generalized coordinate of joint i_joint: $d\_AxF = \frac{\partial AxF}{\partial q_{i\_joint}}$.
[in]OMPxFThe differential angular acceleration vector (index starting at 1) with components expressed in frame [P]. It is the difference between the parent angular acceleration and the children angular acceleration.
[in]d_OMPxFthe partial derivative of OMPxF with respect to the generalized coordinate of joint i_joint: $d\_OMPxF = \frac{\partial OMPxF}{\partial q_{i\_joint}}$.
[in,out]sThe MbsData structure of the model on which the force is computed.
[in]tsimThe current time of the simulation
[in]i_link3dThe ID identifying the computed link3D force.
[in]i_paramThe id of the parameter.
Returns
A vector (of size 9, index starting at 0) with the content described for MbsData::mbs_dp->dSWr_link3d_dqd

The content of the returned vector dSWr_dqd is [dF_dqd; dMx_dqd; ddxF_dqd]:

  • Partial derivative of the force components (expressed in the inertial frame): dF_dqd = $\left[\frac{\partial Fx}{\partial \dot{q}_{i\_joint}} ; \frac{\partial Fy}{\partial \dot{q}_{i\_joint}} ; \frac{\partial Fz}{\partial \dot{q}_{i\_joint}}\right]$
  • Partial derivative of the pure torque components (expressed in the inertial frame): dM_dqd = $\left[\frac{\partial Mx}{\partial \dot{q}_{i\_joint}} ; \frac{\partial My}{\partial \dot{q}_{i\_joint}} ; \frac{\partial Mz}{\partial \dot{q}_{i\_joint}}\right]$
  • Partial derivative of the application point local coordinates vector (expressed in the body-fixed frame): ddxF_dqd = $\left[\frac{\partial dxF}{\partial \dot{q}_{i\_joint}} ; \frac{\partial dxF}{\partial \dot{q}_{i\_joint}} ; \frac{\partial dxF}{\partial \dot{q}_{i\_joint}}\right]$

◆ user_Link3DForces_dqdd()

double* user_Link3DForces_dqdd ( double  PxF[4],
double  d_PxF[4],
double  RxF[4][4],
double  d_RxF[4][4],
double  VxF[4],
double  d_VxF[4],
double  OMxF[4],
double  d_OMxF[4],
double  AxF[4],
double  d_AxF[4],
double  OMPxF[4],
double  d_OMPxF[4],
MbsData s,
double  tsim,
int  i_link3d,
int  i_param 
)

Compute the partial derivative of a link3D forces with respect to a generalized acceleration.

Parameters
[in]PxFThe vector "AB" (index starting at 1) with components expressed in frame [P].
[in]d_PxFthe partial derivative of PxF with respect to the generalized coordinate of joint i_joint: $d\_PxF = \frac{\partial PxF}{\partial q_{i\_joint}}$.
[in]RxFThe rotation matrix (index starting at 1) such as [C] = Rxf*[P].
[in]d_RxFthe partial derivative of matrix RxF with respect to the generalized coordinate of joint i_joint: $d\_RxF = \frac{\partial RxF}{\partial q_{i\_joint}}$.
[in]VxFThe differential velocity vector (index starting at 1) with components expressed in frame [P]. The velocities are computed at the coordinates of point "M" linked to parent (Md_p), then linked to children (Md_c) body. The differential velocity vector is : Md_c - Md_p.
[in]d_VxFthe partial derivative of VxF with respect to the generalized coordinate of joint i_joint: $d\_VxF = \frac{\partial VxF}{\partial q_{i\_joint}}$.
[in]OMxFThe differential angular velocity vector (index starting at 1) with components expressed in frame [P]. It is the difference between the parent angular velocity and the children angular velocity.
[in]d_OMxFthe partial derivative of OMxF with respect to the generalized coordinate of joint i_joint: $d\_OMxF = \frac{\partial OMxF}{\partial q_{i\_joint}}$.
[in]AxFThe differential acceleration vector (index starting at 1) with components expressed in frame [P]. The accelerations are computed at the coordinates of point "M" linked to parent (Mdd_p), then linked to children (Mdd_c) body. The differential acceleration vector is : Mdd_c - Mdd_p.
[in]d_AxFthe partial derivative of AxF with respect to the generalized coordinate of joint i_joint: $d\_AxF = \frac{\partial AxF}{\partial q_{i\_joint}}$.
[in]OMPxFThe differential angular acceleration vector (index starting at 1) with components expressed in frame [P]. It is the difference between the parent angular acceleration and the children angular acceleration.
[in]d_OMPxFthe partial derivative of OMPxF with respect to the generalized coordinate of joint i_joint: $d\_OMPxF = \frac{\partial OMPxF}{\partial q_{i\_joint}}$.
[in,out]sThe MbsData structure of the model on which the force is computed.
[in]tsimThe current time of the simulation
[in]i_link3dThe ID identifying the computed link3D force.
[in]i_paramThe id of the parameter.
Returns
The partial derivative of the link3D force with respect to generalized acceleration i_joint: The content of the returned vector dSWr_link3d_dqdd is [dF_dq; dMx_dq; ddxF_dq]:
  • Partial derivative of the link3d components (expressed in the inertial frame): dF_dq = $\left[\frac{\partial Fx}{\partial q_{i\_joint}} ; \frac{\partial Fy}{\partial q_{i\_joint}} ; \frac{\partial Fz}{\partial q_{i\_joint}}\right]$
  • Partial derivative of the pure torque components (expressed in the inertial frame): dM_dq = $\left[\frac{\partial Mx}{\partial q_{i\_joint}} ; \frac{\partial My}{\partial q_{i\_joint}} ; \frac{\partial Mz}{\partial q_{i\_joint}}\right]$
  • Partial derivative of the application point local coordinates vector (expressed in the body-fixed frame): ddxF_dq = $\left[\frac{\partial dxF}{\partial q_{i\_joint}} ; \frac{\partial dxF}{\partial q_{i\_joint}} ; \frac{\partial dxF}{\partial q_{i\_joint}}\right]$

    In 1D, it gives:

    \[d\_Flink3D_{i\_link3D} = \frac{\partial Flink3D_{i\_link3D}}{\partial q_{i\_joint}}\]

    .

◆ user_LinkForces()

double user_LinkForces ( double  Z,
double  Zd,
MbsData s,
double  tsim,
int  ilnk 
)

Compute the value of a link forces.

Parameters
[in]ZThe distance (>0) between the extremities of the link force.
[in]ZdThe relative velocity between the extremities of the link force. A negative value means that the points get closer.
[in]sThe MbsData structure of the model on which the driven joint are computed.
[in]tsimthe current time of the simulation.
[in]ilnkthe ID identifying the computed link force.
Returns
The value of the link force. A positive value is a repelling force. A negative force value is an attractive effect.

◆ user_LinkForces_dp()

double user_LinkForces_dp ( double  Z,
double  d_Z,
double  Zd,
double  d_Zd,
MbsData mbs_data,
double  tsim,
int  i_link 
)

Compute the partial derivative of a link forces with respect to a specific parameter.

Parameters
[in]Zthe distance (>0) between the extremities of the link force.
[in]d_Zthe partial derivative of Z with respect to the parameter i_param: $d\_Z = \frac{\partial Z}{\partial i\_param}$.
[in]Zdthe relative velocity between the extremities of the link force, negative if the points get closer.
[in]d_Zdthe partial derivative of Zd with respect to the parameter i_param: $d\_Zd = \frac{\partial Zd}{\partial i\_param}$.
[in]mbs_datathe MbsData structure of the model.
[in]tsimthe current time of the simulation.
[in]i_linkthe ID identifying the computed link force.
Returns
The partial derivative of the link force with respect to the parameter i_param:

\[d\_Flink_{i\_link} = \frac{\partial Flink_{i\_link}}{\partial i\_param}\]

.

◆ user_LinkForces_dq()

double user_LinkForces_dq ( double  Z,
double  d_Z,
double  Zd,
double  d_Zd,
MbsData mbs_data,
double  tsim,
int  i_link,
int  i_param 
)

Compute the partial derivative of a link forces with respect to a generalized coordinate.

Parameters
[in]Zthe distance (>0) between the extremities of the link force.
[in]d_Zthe partial derivative of Z with respect to generalized coordinate of joint i_joint: $d\_Z = \frac{\partial Z}{\partial q_{i\_joint}}$.
[in]Zdthe relative velocity between the extremities of the link force, negative if the points get closer.
[in]d_Zdthe partial derivative of Zd with respect to generalized coordinate of joint i_joint: $d\_Zd = \frac{\partial Zd}{\partial q_{i\_joint}}$.
[in]mbs_datathe MbsData structure of the model.
[in]tsimthe current time of the simulation.
[in]i_linkthe ID identifying the computed link force.
[in]i_paramthe ID identifying the current joint the derivative is computed for. This parameter should bun unused.
Returns
The partial derivative of the link force with respect to generalized coordinate i_joint:

\[d\_Flink_{i\_link} = \frac{\partial Flink_{i\_link}}{\partial q_{i\_joint}}\]

.

◆ user_LinkForces_dqd()

double user_LinkForces_dqd ( double  Z,
double  d_Z,
double  Zd,
double  d_Zd,
MbsData mbs_data,
double  tsim,
int  i_link,
int  i_param 
)

Compute the partial derivative of a link forces with respect to a generalized velocity.

Parameters
[in]Zthe distance (>0) between the extremities of the link force.
[in]d_Zthe partial derivative of Z with respect to generalized velocity of joint i_joint: $d\_Z = \frac{\partial Z}{\partial \dot{q}_{i\_joint}}$.
[in]Zdthe relative velocity between the extremities of the link force, negative if the points get closer.
[in]d_Zdthe partial derivative of Zd with respect to generalized velocity of joint i_joint: $d\_Zd = \frac{\partial Zd}{\partial \dot{q}_{i\_joint}}$.
[in]mbs_datathe MbsData structure of the model.
[in]tsimthe current time of the simulation.
[in]i_linkthe ID identifying the computed link force.
[in]i_paramthe ID identifying the current joint the derivative is computed for. This parameter should bun unused.
Returns
The partial derivative of the link force with respect to generalized velocity i_joint:

\[d\_Flink_{i\_link} = \frac{\partial Flink_{i\_link}}{\partial \dot{q}_{i\_joint}}\]

.

◆ user_LinkForces_dqdd()

double user_LinkForces_dqdd ( double  Z,
double  d_Z,
double  Zd,
double  d_Zd,
MbsData mbs_data,
double  tsim,
int  i_link,
int  i_param 
)

Compute the partial derivative of a link forces with respect to a generalized acceleration.

Parameters
[in]Zthe distance (>0) between the extremities of the link force.
[in]d_Zthe partial derivative of Z with respect to generalized velocity of joint i_joint: $d\_Z = \frac{\partial Z}{\partial \dot{q}_{i\_joint}}$.
[in]Zdthe relative velocity between the extremities of the link force, negative if the points get closer.
[in]d_Zdthe partial derivative of Zd with respect to generalized velocity of joint i_joint: $d\_Zd = \frac{\partial Zd}{\partial \dot{q}_{i\_joint}}$.
[in]mbs_datathe MbsData structure of the model.
[in]tsimthe current time of the simulation.
[in]i_linkthe ID identifying the computed link force.
[in]i_paramthe ID identifying the current joint the derivative is computed for. This parameter should bun unused.
Returns
The partial derivative of the link force with respect to generalized acceleration i_joint:

\[d\_Flink_{i\_link} = \frac{\partial Flink_{i\_link}}{\partial \ddot{q}_{i\_joint}}\]

.

◆ user_load_post()

void user_load_post ( MbsData mbs_data,
MbsLoader mbs_loader 
)

User own initialization operations.

This function will automatically be called at the project loading by mbs_load() function. The user can define in this function various initialization, allocation or configuration steps required by the project (ie. allocating and configuring user model of type being structure).

Parameters
[in,out]mbs_dataData structure of the model.
[in]mbs_loaderPointer to the mbs_loader structure as filled in mbs_load_with_loader function