#include "mbs_dirdyn.h"
#include <stdlib.h>
#include <stdio.h>
#include "integrator.h"
#include "mbs_project_interface.h"
#include "user_realtime_visu.h"
#include "string.h"
#include "realtime.h"
#include "set_output.h"
#include "MBSfun.h"
#include "mbs_check.h"
#include "mbs_errors_names.h"
#include "mbs_trigo.h"
#include "mbs_message.h"
Functions | |
MbsDirdyn * | mbs_new_dirdyn (MbsData *mbs_data) |
Create a new direct dynamic structure. More... | |
MbsDirdyn * | mbs_new_dirdyn_aux (MbsData *mbs_data, MbsAux *mbs_aux) |
Create MbsDirdyn strucure and fill it with auxiliary structure. More... | |
int | check_user_dirdyn_options (MbsDirdyn *dd, MbsData *mbs_data) |
check that the dirdyn options performed by the user are correct More... | |
void | mbs_delete_dirdyn (MbsDirdyn *dirdyn, MbsData *mbs_data) |
Free memory of the direct dynamic structure The options (MbsDirdynOptions) and MbsAux structures are also freed. More... | |
int | mbs_run_dirdyn (MbsDirdyn *dd, MbsData *mbs_data) |
Run the direct dynamic simulation. More... | |
int | mbs_dirdyn_save (MbsDirdyn *dd, MbsData *mbs_data, double t) |
int | mbs_dirdyn_init (MbsDirdyn *dd, MbsData *mbs_data) |
Run the startup operations of the run_dirdyn function. More... | |
int | mbs_dirdyn_loop (MbsDirdyn *dd, MbsData *mbs_data) |
Time loop of the run_dirdyn function: More... | |
int | mbs_dirdyn_finish (MbsDirdyn *dd, MbsData *mbs_data) |
Run the finalization operations of the run_dirdyn function. More... | |
int | mbs_dirdyn_write_buffers (MbsDirdyn *dd) |
Compute the derivatives of the system (1st derivatives to be given to the ODE integrator) More... | |
int | mbs_fct_dirdyn (double tsim, double y[], double dydt[], MbsData *s, MbsDirdyn *dd) |
direct dynamics derivative computation More... | |
int | save_realtime_update (MbsDirdyn *dd, MbsData *mbs_data) |
update the real-time and saving modules if requested More... | |
This file implements the functions of the dirdyn module in C.
Creation date: 19/11/2014
(c) Universite catholique de Louvain
check that the dirdyn options performed by the user are correct
[in] | dd | direct dynamics module |
[in] | mbs_data | Robotran main structure |
Free memory of the direct dynamic structure The options (MbsDirdynOptions) and MbsAux structures are also freed.
Run the finalization operations of the run_dirdyn function.
Run the startup operations of the run_dirdyn function.
Time loop of the run_dirdyn function:
The sequence of one iteration is:
[in,out] | dirdyn | the MbsDirdyn to be run |
[in,out] | mbs_data | the MbsData structure of the model for which the direct dynamic is computed |
int mbs_dirdyn_write_buffers | ( | MbsDirdyn * | dd | ) |
Compute the derivatives of the system (1st derivatives to be given to the ODE integrator)
t
the integration variable (time in the case of MBS time integration) y
the state vector for which the derivative must be computed dydt
the state derivative vector in which the derivative must be returned s
the MbsData of the system mbs_aux
the local data structure Write the content of buffer associated to the given MbsDirdyn to disk. This is usefull for writing simulation results at the end of the simulation. This sepcific function is written to be able to ask for writing buffer from python.
dd
the MbsDirdyn struct for which the buffers must be written
direct dynamics derivative computation
[in] | t | current simulation time [s] |
[in] | y | state vector of size n |
[out] | dydt | derivative |
[in,out] | s | Robotran main structure |
[in,out] | dd | direct dynamic main module structure |
Create a new direct dynamic structure.
This function also initialize the options structures and the MbsAux for storing computational info during simulation.
Fields are allocated to default value.
mbs_data | the data structure of the model for which the time integration will be computed. |
Create MbsDirdyn strucure and fill it with auxiliary structure.
This function also initialize the options structures. A pointer to the given MbsAux structure is kept by the returned structure.
The field of MbsDirdyn are set to default values.
mbs_data
the data structure of the model for which the time integration will be computed mbs_aux
the MbsAux structure related to the model for which the time integration will be computed.