Biomech-Sim-Toolbox 1
Toolbox for movement simulation and analysis
Loading...
Searching...
No Matches
Macros | Functions | Variables
gait2d_osim.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "mex.h"
#include "gait2d_osim.h"

Macros

#define EXTRACTINERTIAL(S, NUM)
 
#define JACOBIANSIZING   0
 
#define MAXCONTACTS   20
 
#define MAXMUSCLES   18
 
#define MAXPWR   4
 
#define MAXSTATES   (2*NDOF+2*MAXMUSCLES+NCVAR*MAXCONTACTS)
 

Functions

double extract (const mxArray *P, char *fieldname1, unsigned int i1)
 
double extract2 (const mxArray *P, char *fieldname1, unsigned int i1, char *fieldname2, unsigned int i2)
 
void mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
 
double MuscleDynamics (muscleprop *m, double a, double s, double sdot, double Lm, double *df_da, double *df_ds, double *df_dsdot, double *df_dLm, double *force, double *dforce_dLm, double *dforce_ds, double *forceCE, double *dforceCE_da, double *dforceCE_ds, double *dforceCE_dsdot, double *powerCE)
 
void MusclePaths (double q[NDOF], double Lm[MAXMUSCLES], double dLm_dq[MAXMUSCLES][NDOF], double dLm_dqdq[MAXMUSCLES][NDOF][NDOF], int derivatives)
 

Variables

static contactprop contacts [MAXCONTACTS]
 
static int initialized = 0
 
static jointprop joints [NDOF]
 
static muscleprop muscles [MAXMUSCLES]
 
static int ncontacts
 
static int nf
 
static int nmuscles
 
static int nstates
 
static int nstrainterms
 
static param_struct parameters
 
static double straincoeff [MAXPOLTERMS]
 
static int strainexpon [MAXPOLTERMS][NDOF]
 
static double zeros [MAXSTATES]
 

Macro Definition Documentation

◆ EXTRACTINERTIAL

#define EXTRACTINERTIAL (   S,
  NUM 
)
Value:
{ \
parameters.S##_M = extract2(P,"segments",(NUM),"mass",1); \
parameters.S##_CMx = extract2(P,"segments",(NUM),"mass_center",1); \
parameters.S##_CMy = extract2(P,"segments",(NUM),"mass_center",2); \
parameters.S##_Izz = extract2(P,"segments",(NUM),"inertia",9); \
}
static param_struct parameters
Definition: gait2d_osim.c:40
double extract2(const mxArray *P, char *fieldname1, unsigned int i1, char *fieldname2, unsigned int i2)
Definition: gait2d_osim.c:355

◆ JACOBIANSIZING

#define JACOBIANSIZING   0

◆ MAXCONTACTS

#define MAXCONTACTS   20

◆ MAXMUSCLES

#define MAXMUSCLES   18

◆ MAXPWR

#define MAXPWR   4

◆ MAXSTATES

#define MAXSTATES   (2*NDOF+2*MAXMUSCLES+NCVAR*MAXCONTACTS)

Function Documentation

◆ extract()

double extract ( const mxArray *  P,
char *  fieldname1,
unsigned int  i1 
)

◆ extract2()

double extract2 ( const mxArray *  P,
char *  fieldname1,
unsigned int  i1,
char *  fieldname2,
unsigned int  i2 
)

◆ mexFunction()

void mexFunction ( int  nlhs,
mxArray *  plhs[],
int  nrhs,
const mxArray *  prhs[] 
)

◆ MuscleDynamics()

double MuscleDynamics ( muscleprop m,
double  a,
double  s,
double  sdot,
double  Lm,
double *  df_da,
double *  df_ds,
double *  df_dsdot,
double *  df_dLm,
double *  force,
double *  dforce_dLm,
double *  dforce_ds,
double *  forceCE,
double *  dforceCE_da,
double *  dforceCE_ds,
double *  dforceCE_dsdot,
double *  powerCE 
)

◆ MusclePaths()

void MusclePaths ( double  q[NDOF],
double  Lm[MAXMUSCLES],
double  dLm_dq[MAXMUSCLES][NDOF],
double  dLm_dqdq[MAXMUSCLES][NDOF][NDOF],
int  derivatives 
)

Variable Documentation

◆ contacts

contactprop contacts[MAXCONTACTS]
static

◆ initialized

int initialized = 0
static

◆ joints

jointprop joints[NDOF]
static

◆ muscles

muscleprop muscles[MAXMUSCLES]
static

◆ ncontacts

int ncontacts
static

◆ nf

int nf
static

◆ nmuscles

int nmuscles
static

◆ nstates

int nstates
static

◆ nstrainterms

int nstrainterms
static

◆ parameters

param_struct parameters
static

◆ straincoeff

double straincoeff[MAXPOLTERMS]
static

◆ strainexpon

int strainexpon[MAXPOLTERMS][NDOF]
static

◆ zeros

double zeros[MAXSTATES]
static