Biomech-Sim-Toolbox 1
Toolbox for movement simulation and analysis
Loading...
Searching...
No Matches
gait3d_pelvis213_torque_multibody.h
Go to the documentation of this file.
1// gait3d_pelvis213_torque_multibody.h
2// This file defines the data structures that are needed in Autolev multibody model
3
4#define NDOF 33 // number of kinematic degrees of freedom
5#define NFKSEG 20 // number of Opensim body segments (excluding ground)
6#define NFK 12*NFKSEG // number of forward kinematic outputs: 12 for each segment: Ox,Oy,Oz,R11,R12,R13,R21,R22,R23,R31,R32,R33
7#define NGRFSEG 4 // number of body segments that have contact points attached to them (Rcalc, Rtoes, Lcalc, Ltoes)
8#define NGRF 6*NGRFSEG // number of GRF inputs to equation of motion (3D force and moment on each segment that has contact points)
9
10// macro to declare inertial properties of a segment S
11#define INERTIAL(S) double S##_M, S##_CMx, S##_CMy, S##_CMz, S##_Ixx, S##_Iyy, S##_Izz, S##_Ixy, S##_Iyz, S##_Ixz
12
13typedef struct {
14 // Gravity and body weight
15 double gravity_x, gravity_y, gravity_z;
16 double bodyweight;
17
18 // Air drag
19 double airdrag; // drag coefficient, N/(m/s)^2
20 double wind; // wind speed, m/s (positive value is a tailwind)
21
22 // Body segment parameters
23 INERTIAL(pelvis);
24 INERTIAL(torso);
25
26 INERTIAL(Rfemur);
27 INERTIAL(Rtibia);
28 INERTIAL(Rcalcaneus);
29 INERTIAL(Rtoes);
30 INERTIAL(Rhumerus);
31 INERTIAL(Rulna);
32 INERTIAL(Rradius);
33 INERTIAL(Rhand);
34
35 INERTIAL(Lfemur);
36 INERTIAL(Ltibia);
37 INERTIAL(Lcalcaneus);
38 INERTIAL(Ltoes);
39 INERTIAL(Lhumerus);
40 INERTIAL(Lulna);
41 INERTIAL(Lradius);
42 INERTIAL(Lhand);
43
44 // Joint axis orientations (are assumed to be the same left and right, with mirroring relative to local XY plane)
45 double Rankle1, Rankle2, Rankle3;
46 double Rsubtalar1, Rsubtalar2, Rsubtalar3;
47 double Rmtp1, Rmtp3; // mtp2 is hard zero (as coded in addleg function in gait3d_pelvis213_torquemake.m)
48 double Relbow1, Relbow2, Relbow3;
49 double Rraduln1, Rraduln2, Rraduln3;
50
51 double Lankle1, Lankle2, Lankle3;
52 double Lsubtalar1, Lsubtalar2, Lsubtalar3;
53 double Lmtp1, Lmtp3; // mtp2 is hard zero (as coded in addleg function in gait3d_pelvis213_torquemake.m)
54 double Lelbow1, Lelbow2, Lelbow3;
55 double Lraduln1, Lraduln2, Lraduln3;
56
57 // Alignment parameters for BKA study
58 double trans, flex, rot, add;
59
60 // Joint axis positions (parameters that were coded as hard zeros in gait3d_pelvis213_torquemake.m are not included here)
61 double back_x, back_y;
62
63 double Rhip_x, Rhip_y, Rhip_z;
64 double Rknee_x1, Rknee_x2, Rknee_x3, Rknee_x4, Rknee_x5; // polynomial coefficients for knee x as function of knee angle
65 double Rknee_y1, Rknee_y2, Rknee_y3, Rknee_y4, Rknee_y5; // polynomial coefficients for knee y as function of knee angle
66 double Rankle_y;
67 double Rsubtalar_x, Rsubtalar_y, Rsubtalar_z;
68 double Rmtp_x, Rmtp_y, Rmtp_z;
69 double Racromial_x, Racromial_y, Racromial_z;
70 double Relbow_x, Relbow_y, Relbow_z;
71 double Rraduln_x, Rraduln_y, Rraduln_z;
72 double Rwrist_x, Rwrist_y, Rwrist_z;
73
74 double Lhip_x, Lhip_y, Lhip_z;
75 double Lknee_x1, Lknee_x2, Lknee_x3, Lknee_x4, Lknee_x5; // polynomial coefficients for knee x as function of knee angle
76 double Lknee_y1, Lknee_y2, Lknee_y3, Lknee_y4, Lknee_y5; // polynomial coefficients for knee y as function of knee angle
77 double Lankle_y;
78 double Lsubtalar_x, Lsubtalar_y, Lsubtalar_z;
79 double Lmtp_x, Lmtp_y, Lmtp_z;
80 double Lacromial_x, Lacromial_y, Lacromial_z;
81 double Lelbow_x, Lelbow_y, Lelbow_z;
82 double Lraduln_x, Lraduln_y, Lraduln_z;
83 double Lwrist_x, Lwrist_y, Lwrist_z;
84
86
87// prototype for the Autolev C function for multibody dynamics
89 double q[NDOF],
90 double qd[NDOF],
91 double qdd[NDOF],
92 double G[NGRF],
93 double f[NDOF],
94 double df_dq[NDOF][NDOF],
95 double df_dqd[NDOF][NDOF],
96 double df_dqdd[NDOF][NDOF],
97 double df_dG[NDOF][NGRF],
98 double fk[NFK],
99 double dfk_dq[NFK][NDOF],
100 double fkdot[NFK],
101 double dfkdot_dq[NFK][NDOF]);
102
104 double q[NDOF],
105 double qd[NDOF],
106 double qdd[NDOF],
107 double G[NGRF],
108 double f[NDOF],
109 double fk[NFK],
110 double dfk_dq[NFK][NDOF],
111 double fkdot[NFK],
112 double dfkdot_dq[NFK][NDOF]);
113
115 double q[NDOF],
116 double qd[NDOF],
117 double qdd[NDOF],
118 double fk[NFK],
119 double dfk_dq[NFK][NDOF],
120 double fkdot[NFK],
121 double dfkdot_dq[NFK][NDOF]);
double f[4]
Definition: contact_2d_raw.c:20
double fkdot[48]
Definition: gait10dof18musc_FK_raw.c:24
double dfk_dq[48][10]
Definition: gait10dof18musc_FK_raw.c:24
double fk[48]
Definition: gait10dof18musc_FK_raw.c:24
double dfkdot_dq[48][10]
Definition: gait10dof18musc_FK_raw.c:25
double df_dqd[10][10]
Definition: gait10dof18musc_raw.c:34
double df_dG[10][6]
Definition: gait10dof18musc_raw.c:34
double df_dq[10][10]
Definition: gait10dof18musc_raw.c:34
double df_dqdd[10][10]
Definition: gait10dof18musc_raw.c:34
#define NGRF
Definition: gait3d_pelvis213_torque_multibody.h:8
void gait3d_pelvis213_torque_NoDer_al(param_struct *par, double q[NDOF], double qd[NDOF], double qdd[NDOF], double G[NGRF], double f[NDOF], double fk[NFK], double dfk_dq[NFK][NDOF], double fkdot[NFK], double dfkdot_dq[NFK][NDOF])
void gait3d_pelvis213_torque_al(param_struct *par, double q[NDOF], double qd[NDOF], double qdd[NDOF], double G[NGRF], double f[NDOF], double df_dq[NDOF][NDOF], double df_dqd[NDOF][NDOF], double df_dqdd[NDOF][NDOF], double df_dG[NDOF][NGRF], double fk[NFK], double dfk_dq[NFK][NDOF], double fkdot[NFK], double dfkdot_dq[NFK][NDOF])
#define NFK
Definition: gait3d_pelvis213_torque_multibody.h:6
#define NDOF
Definition: gait3d_pelvis213_torque_multibody.h:4
void gait3d_pelvis213_torque_FK_al(param_struct *par, double q[NDOF], double qd[NDOF], double qdd[NDOF], double fk[NFK], double dfk_dq[NFK][NDOF], double fkdot[NFK], double dfkdot_dq[NFK][NDOF])
Definition: gait10dof18musc_multibody.h:13
INERTIAL(pelvis)
INERTIAL(Lradius)
INERTIAL(torso)
INERTIAL(Rtibia)
INERTIAL(Lhumerus)
INERTIAL(Ltibia)
INERTIAL(Rfemur)
INERTIAL(Rtoes)
INERTIAL(Lcalcaneus)
INERTIAL(Rhumerus)
INERTIAL(Lulna)
INERTIAL(Rradius)
INERTIAL(Rulna)
double add
Definition: gait3d_pelvis213_torque_multibody.h:58
INERTIAL(Lfemur)
INERTIAL(Lhand)
INERTIAL(Rcalcaneus)
INERTIAL(Rhand)
INERTIAL(Ltoes)