Robotran C Documentation
Functions
integrator.c File Reference

specific dirdyn function for the integrators More...

#include "integrator.h"
#include "mbs_dirdyn_struct.h"
#include "mbs_rk4.h"
#include "mbs_dopri5.h"
#include "mbs_euler_explicit.h"
#include "mbs_euler_implicit.h"
#include "mbs_rosenbrock.h"
#include "mbs_custom.h"
#include "mbs_bader.h"
#include "mbs_w_methods.h"
#include "mbs_message.h"

Functions

int mbs_estim_jac_acc (double x, double htry, double y[], double dydx[], int compute_dfdx, double dfdx[], double **dfdy, int n, int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *dd)
 Evaluate the Jacobian of a function accelerations using finite difference. More...
 
int mbs_freeze_jac (int freeze_index, int *next_freeze_index, double x, double h, double y[], double dydx[], int compute_dfdx, double dfdx[], double **dfdy, double dydx_freeze[], double dfdx_freeze[], double **dfdy_freeze, int n, int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), MbsData *s, MbsDirdyn *mbs_dd)
 Freeze the Jacobian of an integrator structure until mbs_dd->options->n_freeze. More...
 
void set_integrator (MbsDirdyn *mbs_dd)
 Set the function pointer in MbsDirdyn. More...
 
void print_warnings_integrator (MbsData *mbs_data, MbsDirdyn *mbs_dd, int type_of_integrator)
 Check the options set by user to warn him when he modified an unused option for the integrator. More...
 
void print_warnings_constant_step_integrator (MbsDirdyn *mbs_dd, char *integrator_name)
 Print the warning message, called by print_warnings_integrator for constant step size dt integrators. More...
 

Detailed Description

specific dirdyn function for the integrators

Creation date: May 2015

Author
Olivier Lantsoght

Modification date: June 2018 \modified by Sebastien Timmermans

(c) Universite catholique de Louvain

Function Documentation

◆ mbs_estim_jac_acc()

int mbs_estim_jac_acc ( double  x,
double  htry,
double  y[],
double  dydx[],
int  compute_dfdx,
double  dfdx[],
double **  dfdy,
int  n,
int(*)(double, double[], double[], MbsData *, MbsDirdyn *)  derivs,
MbsData s,
MbsDirdyn dd 
)

Evaluate the Jacobian of a function accelerations using finite difference.

Modify and do not restore dydx. WARNING: All vector/matrix indexes start at 0! Update the value of dfdx and dfdy.

Parameters
xcurrent time value, at which the function needs to be computed
htrytime step
ystate vector of variable
compute_dfdxflag to ON to compute the dfdx terms, default = 1 ; if compute_dfdx = 0 => dfdx is filled with zeroes
dydxderivative of y by x
dfdxderivative of f by x
dfdyderivative of f by y
nnumber of variables
derivsthe function computing f'
sthe MbsData structure of the model on which dirdyn analysis is computed.
ddthe MbsDirdyn structure related to the integration.
Returns
Error status, <0 in case of failure.

◆ mbs_freeze_jac()

int mbs_freeze_jac ( int  freeze_index,
int *  next_freeze_index,
double  x,
double  h,
double  y[],
double  dydx[],
int  compute_dfdx,
double  dfdx[],
double **  dfdy,
double  dydx_freeze[],
double  dfdx_freeze[],
double **  dfdy_freeze,
int  n,
int(*)(double, double[], double[], MbsData *, MbsDirdyn *)  derivs,
MbsData s,
MbsDirdyn mbs_dd 
)

Freeze the Jacobian of an integrator structure until mbs_dd->options->n_freeze.

WARNING: All vector/matrix indexes start at 0!

Parameters
freeze_indexcurrent count of refreezing steps (if 0, recompute Jac)
next_freeze_index[out] pointor to next refreezing step
xcurrent time value, at which the function needs to be computed
htime step
ystate vector of variable
dydxderivative of y by x
compute_dfdxflag to ON to compute the dfdx terms, default = 1 ; if compute_dfdx = 0 => dfdx is filled with zeroes
dfdxderivative of f by x
dfdyderivative of f by y
dydx_freezepointor to freezed derivative of y by x
dfdx_freezepointor to freezed derivative of f by x
dfdy_freezepointor to freezed derivative of f by y
nnumber of variables
derivsthe function computing f'
sthe MbsData structure of the model on which dirdyn analysis is computed.
mbs_ddthe MbsDirdyn structure related to the integration.
Returns
Error status, <0 in case of failure.

◆ print_warnings_constant_step_integrator()

void print_warnings_constant_step_integrator ( MbsDirdyn mbs_dd,
char *  integrator_name 
)

Print the warning message, called by print_warnings_integrator for constant step size dt integrators.

Parameters
mbs_ddMbsDirdyn structure
integrator_namestring to print in the warning message, corresponding to the integrator (RK4, EulerEx, ...)

◆ print_warnings_integrator()

void print_warnings_integrator ( MbsData mbs_data,
MbsDirdyn mbs_dd,
int  type_of_integrator 
)

Check the options set by user to warn him when he modified an unused option for the integrator.

Parameters
mbs_dataMbsData structure
mbs_ddMbsDirdyn structure
type_of_integratorID if the used integrator (RK4, Dopri5...)

◆ set_integrator()

void set_integrator ( MbsDirdyn dd)

Set the function pointer in MbsDirdyn.

Parameters
ddMbsDirdyn structure to adapt