Switch to unified view

a b/Tools/AnyMocap/OptimizeAnthropometricsOnOff.any
1
#ifndef _ANYMOCAP_OPTIMIZE_ANTHROPOMETRICS_ON_OFF_ANY_
2
#define _ANYMOCAP_OPTIMIZE_ANTHROPOMETRICS_ON_OFF_ANY_
3
/*
4
---
5
group: MoCap
6
topic: Parameter Identification
7
descr: |
8
  Class template for making design variables and optimizing the anthropometric
9
  of the model. I.e. adding different segment length to the parameter identification 
10
  study.
11
---
12
13
To use these drivers import the file:
14
#include "<AMMR_TOOLS>/AnyMoCap/OptimizeAnthropometricsOnOff.any"
15
16
See the individual classes for more information.
17
18
*/
19
  
20
21
// Creates design variables based on anthropometrics of the model and 
22
// adds them to the parameter identification study. 
23
//
24
// In the example below the rhythm constrains two DOFs of the arm to move in a 1:4 ratio.
25
//
26
// :::{rubric} Example
27
// :::
28
//
29
// :::{code-block} AnyScriptDoc
30
//
31
// OptimizeAnthropometricsOnOff OptAnthropometrics (
32
//   PELVIS_WIDTH = ON , 
33
//   HEAD_HEIGHT = OFF, 
34
//   TRUNK_HEIGHT= ON, 
35
// ) ={};
36
//
37
//:::
38
//
39
#class_template OptimizeAnthropometricsOnOff (
40
  PELVIS_WIDTH=0,
41
  PELVIS_HEIGHT=0,
42
  PELVIS_DEPTH=0,
43
  HEAD_HEIGHT =0,
44
  HEAD_WIDTH=0,
45
  HEAD_DEPTH=0,
46
  TRUNK_HEIGHT = 0,
47
  TRUNK_WIDTH=0,
48
  TRUNK_DEPTH=0,
49
  NECK_LENGTH=0,
50
  RIGHT_THIGH_LENGTH =0,
51
  LEFT_THIGH_LENGTH =0,
52
  RIGHT_SHANK_LENGTH =0,
53
  LEFT_SHANK_LENGTH =0,
54
  RIGHT_FOOT_LENGTH =0,
55
  LEFT_FOOT_LENGTH =0,
56
  RIGHT_UPPERARM_LENGTH =0,
57
  LEFT_UPPERARM_LENGTH =0,
58
  RIGHT_LOWERARM_LENGTH =0,
59
  LEFT_LOWERARM_LENGTH =0,
60
  RIGHT_HAND_LENGTH = 0,
61
  LEFT_HAND_LENGTH = 0,
62
  RIGHT_HAND_BREADTH = 0,
63
  LEFT_HAND_BREADTH = 0,
64
  RIGHT_VARUS_VALGUS = 0,
65
  LEFT_VARUS_VALGUS = 0,
66
  RIGHT_TIBIAL_TORSION = 0,
67
  LEFT_TIBIAL_TORSION = 0,
68
  LEFT_RIGHT_SYMMETRY = 0,
69
  PARAMETER_OPT_STUDY = Main.Studies.ParameterIdentification,
70
  SEGMENTS_LENGTHS = Main.HumanModel.Anthropometrics.SegmentDimensions,
71
  HUMAN_MODEL_FOLDER = Main.HumanModel,
72
  CREATE_ALL_DESVARS=0
73
  ){
74
  
75
// Arguments
76
// OptimizeAnthropometricsOnOff#PELVIS_WIDTH
77
//   If set to ON, the pelvis width is added as a design variable to the parameter identification study.
78
// OptimizeAnthropometricsOnOff#PELVIS_HEIGHT
79
//   If set to ON, the pelvis height is added as a design variable to the parameter identification study.
80
// OptimizeAnthropometricsOnOff#PELVIS_DEPTH
81
//   If set to ON, the pelvis depth is added as a design variable to the parameter identification study.
82
// OptimizeAnthropometricsOnOff#HEAD_HEIGHT
83
//   If set to ON, the head height is added as a design variable to the parameter identification study.
84
// OptimizeAnthropometricsOnOff#HEAD_WIDTH
85
//   If set to ON, the head width is added as a design variable to the parameter identification study.
86
// OptimizeAnthropometricsOnOff#HEAD_DEPTH
87
//   If set to ON, the head depth is added as a design variable to the parameter identification study.
88
// OptimizeAnthropometricsOnOff#TRUNK_HEIGHT
89
//   If set to ON, the trunk height is added as a design variable to the parameter identification study.
90
// OptimizeAnthropometricsOnOff#TRUNK_WIDTH
91
//   If set to ON, the trunk width is added as a design variable to the parameter identification study.
92
// OptimizeAnthropometricsOnOff#TRUNK_DEPTH
93
//   If set to ON, the trunk depth is added as a design variable to the parameter identification study.
94
// OptimizeAnthropometricsOnOff#NECK_LENGTH
95
//   If set to ON, the neck length is added as a design variable to the parameter identification study.
96
// OptimizeAnthropometricsOnOff#RIGHT_THIGH_LENGTH
97
//   If set to ON, the right thigh length is added as a design variable to the parameter identification study.
98
// OptimizeAnthropometricsOnOff#LEFT_THIGH_LENGTH
99
//   If set to ON, the left thigh length is added as a design variable to the parameter identification study.
100
// OptimizeAnthropometricsOnOff#RIGHT_SHANK_LENGTH
101
//   If set to ON, the right shank length is added as a design variable to the parameter identification study.
102
// OptimizeAnthropometricsOnOff#LEFT_SHANK_LENGTH
103
//   If set to ON, the left shank length is added as a design variable to the parameter identification study.
104
// OptimizeAnthropometricsOnOff#RIGHT_FOOT_LENGTH
105
//   If set to ON, the right foot length is added as a design variable to the parameter identification study.
106
// OptimizeAnthropometricsOnOff#LEFT_FOOT_LENGTH
107
//   If set to ON, the left foot length is added as a design variable to the parameter identification study.
108
// OptimizeAnthropometricsOnOff#RIGHT_UPPERARM_LENGTH
109
//   If set to ON, the right upper arm length is added as a design variable to the parameter identification study.
110
// OptimizeAnthropometricsOnOff#LEFT_UPPERARM_LENGTH
111
//   If set to ON, the left upper arm length is added as a design variable to the parameter identification study.
112
// OptimizeAnthropometricsOnOff#RIGHT_LOWERARM_LENGTH
113
//   If set to ON, the right lower arm length is added as a design variable to the parameter identification study.
114
// OptimizeAnthropometricsOnOff#LEFT_LOWERARM_LENGTH
115
//   If set to ON, the left lower arm length is added as a design variable to the parameter identification study.
116
// OptimizeAnthropometricsOnOff#RIGHT_HAND_LENGTH
117
//   If set to ON, the right hand length is added as a design variable to the parameter identification study.
118
// OptimizeAnthropometricsOnOff#LEFT_HAND_LENGTH
119
//   If set to ON, the left hand length is added as a design variable to the parameter identification study.
120
// OptimizeAnthropometricsOnOff#RIGHT_HAND_BREADTH
121
//   If set to ON, the right hand breadth is added as a design variable to the parameter identification study.
122
// OptimizeAnthropometricsOnOff#LEFT_HAND_BREADTH
123
//   If set to ON, the left hand breadth is added as a design variable to the parameter identification study.
124
// OptimizeAnthropometricsOnOff#RIGHT_VARUS_VALGUS
125
//   If set to ON, the right varus valgus is added as a design variable to the parameter identification study.
126
// OptimizeAnthropometricsOnOff#LEFT_VARUS_VALGUS
127
//   If set to ON, the left varus valgus is added as a design variable to the parameter identification study.
128
// OptimizeAnthropometricsOnOff#RIGHT_TIBIAL_TORSION
129
//   If set to ON, the right tibial torsion is added as a design variable to the parameter identification study.
130
// OptimizeAnthropometricsOnOff#LEFT_TIBIAL_TORSION
131
//   If set to ON, the left tibial torsion is added as a design variable to the parameter identification study.
132
// OptimizeAnthropometricsOnOff#LEFT_RIGHT_SYMMETRY
133
//   If set to On, constraints are added to the parameter identification study to ensure that the left and right
134
//   side of the body are symmetric.
135
// OptimizeAnthropometricsOnOff#PARAMETER_OPT_STUDY
136
//   The name of the parameter identification study. Can be used in advanced cases with
137
//   multiple parameter identification studies.
138
// OptimizeAnthropometricsOnOff#SEGMENTS_LENGTHS
139
//   The name of the folder containing the segment lengths. Can be used in advanced cases with
140
//   multiple Human Models.
141
// OptimizeAnthropometricsOnOff#HUMAN_MODEL_FOLDER
142
//   The name of the folder containing the Human Model. Can be used in advanced cases with
143
//   multiple Human Models.
144
// OptimizeAnthropometricsOnOff#CREATE_ALL_DESVARS
145
//   If set to ON, all the desvars are created. Design vars are still only added 
146
//   to the parameter identification study if the corresponding arguments are set to ON.
147
148
149
  // These should be set as default values in the argument to the template                                              
150
  Main.ModelSetup.ParameterIdentification =
151
  {    
152
    #if CREATE_ALL_DESVARS | PELVIS_WIDTH
153
    AnyDesVar PelvisWidth = {
154
      Val = SEGMENTS_LENGTHS.PelvisWidth;
155
      Min = 0.05;
156
      Max = 0.5;
157
    };
158
    #endif
159
    #if PELVIS_WIDTH
160
    PARAMETER_OPT_STUDY = { AnyDesVar& PelvisWidth = Main.ModelSetup.ParameterIdentification.PelvisWidth; };
161
    #endif
162
       
163
    #if CREATE_ALL_DESVARS | PELVIS_HEIGHT
164
    AnyDesVar PelvisHeight = {
165
      Val = SEGMENTS_LENGTHS.PelvisHeight;
166
      Min = 0.05;
167
      Max = 0.5;
168
    };
169
    #endif
170
    #if PELVIS_HEIGHT
171
    PARAMETER_OPT_STUDY = { AnyDesVar& PelvisHeight = Main.ModelSetup.ParameterIdentification.PelvisHeight; };
172
    #endif    
173
    
174
    #if CREATE_ALL_DESVARS | PELVIS_DEPTH
175
    AnyDesVar PelvisDepth = {
176
      Val = SEGMENTS_LENGTHS.PelvisDepth;
177
      Min = 0.05;
178
      Max = 0.5;
179
    };
180
    #endif
181
    #if PELVIS_DEPTH
182
    PARAMETER_OPT_STUDY = { AnyDesVar& PelvisDepth = Main.ModelSetup.ParameterIdentification.PelvisDepth; };
183
    #endif       
184
    
185
    #if CREATE_ALL_DESVARS | HEAD_HEIGHT
186
    AnyDesVar HeadHeight = {
187
      Val = SEGMENTS_LENGTHS.HeadHeight;
188
      Min = 0.05;
189
      Max = 0.5;
190
    };
191
    #endif
192
    #if HEAD_HEIGHT
193
    PARAMETER_OPT_STUDY = { AnyDesVar& HeadHeight = Main.ModelSetup.ParameterIdentification.HeadHeight; };
194
    #endif
195
    
196
    #if CREATE_ALL_DESVARS | HEAD_WIDTH
197
    AnyDesVar HeadWidth = {
198
      Val = SEGMENTS_LENGTHS.HeadWidth;
199
      Min = 0.05;
200
      Max = 0.5;
201
    };
202
    #endif
203
    #if HEAD_WIDTH
204
    PARAMETER_OPT_STUDY = { AnyDesVar& HeadWidth = Main.ModelSetup.ParameterIdentification.HeadWidth; };
205
    #endif
206
    
207
    #if CREATE_ALL_DESVARS | HEAD_DEPTH
208
    AnyDesVar HeadDepth = {
209
      Val = SEGMENTS_LENGTHS.HeadDepth;
210
      Min = 0.05;
211
      Max = 0.5;
212
    };
213
    #endif
214
    #if HEAD_DEPTH
215
    PARAMETER_OPT_STUDY = { AnyDesVar& HeadDepth = Main.ModelSetup.ParameterIdentification.HeadDepth; };
216
    #endif    
217
    
218
    #if CREATE_ALL_DESVARS | NECK_LENGTH
219
    AnyDesVar NeckLength = {
220
      Val = SEGMENTS_LENGTHS.NeckLength;
221
      Min = 0.05;
222
      Max = 0.5;
223
    };
224
    #endif
225
    #if NECK_LENGTH
226
    PARAMETER_OPT_STUDY = { AnyDesVar& NeckLength = Main.ModelSetup.ParameterIdentification.NeckLength; };
227
    #endif        
228
    
229
    
230
    #if CREATE_ALL_DESVARS | TRUNK_HEIGHT
231
    AnyDesVar TrunkHeight = {
232
      Val = SEGMENTS_LENGTHS.TrunkHeight;
233
      Min = 0.1;
234
      Max = 1.5;
235
    };
236
    #endif
237
    #if TRUNK_HEIGHT
238
    PARAMETER_OPT_STUDY = { AnyDesVar& TrunkHeight = Main.ModelSetup.ParameterIdentification.TrunkHeight; };
239
    #endif
240
    
241
    #if CREATE_ALL_DESVARS | TRUNK_WIDTH
242
    AnyDesVar TrunkWidth = {
243
      Val = SEGMENTS_LENGTHS.TrunkWidth;
244
      Min = 0.1;
245
      Max = 1.5;
246
    };
247
    #endif
248
    #if TRUNK_WIDTH
249
    PARAMETER_OPT_STUDY = { AnyDesVar& TrunkWidth = Main.ModelSetup.ParameterIdentification.TrunkWidth; };
250
    #endif     
251
    
252
    #if CREATE_ALL_DESVARS | TRUNK_DEPTH
253
    AnyDesVar TrunkDepth = {
254
      Val = SEGMENTS_LENGTHS.TrunkDepth;
255
      Min = 0.1;
256
      Max = 1.5;
257
    };
258
    #endif
259
    #if TRUNK_DEPTH
260
    PARAMETER_OPT_STUDY = { AnyDesVar& TrunkDepth = Main.ModelSetup.ParameterIdentification.TrunkDepth; };
261
    #endif       
262
    
263
    #if CREATE_ALL_DESVARS | RIGHT_THIGH_LENGTH
264
    AnyDesVar RightThighLength = {
265
      Val = SEGMENTS_LENGTHS.Right.ThighLength;
266
      Min = 0.1;
267
      Max = 1;
268
    };
269
    #endif
270
    #if RIGHT_THIGH_LENGTH
271
    PARAMETER_OPT_STUDY = { AnyDesVar& RightThighLength = Main.ModelSetup.ParameterIdentification.RightThighLength; };
272
    #endif
273
    
274
    #if CREATE_ALL_DESVARS | LEFT_THIGH_LENGTH
275
    AnyDesVar LeftThighLength = {
276
      Val = SEGMENTS_LENGTHS.Left.ThighLength;
277
      Min = 0.1;
278
      Max = 1;
279
    };
280
    #endif
281
    #if LEFT_THIGH_LENGTH
282
    PARAMETER_OPT_STUDY = { AnyDesVar& LeftThighLength = Main.ModelSetup.ParameterIdentification.LeftThighLength; };
283
    #endif
284
    
285
    #if CREATE_ALL_DESVARS | (RIGHT_THIGH_LENGTH & LEFT_THIGH_LENGTH & LEFT_RIGHT_SYMMETRY)
286
    AnyDesMeasure ThighLengthSymmetry = {
287
      Val = .LeftThighLength.Val - .RightThighLength.Val;
288
      Type = EqualToZero;
289
    };
290
    #endif
291
    #if RIGHT_THIGH_LENGTH & LEFT_THIGH_LENGTH & LEFT_RIGHT_SYMMETRY
292
    PARAMETER_OPT_STUDY = { AnyDesMeasure& ThighLengthSymmetry = Main.ModelSetup.ParameterIdentification.ThighLengthSymmetry; };
293
    #endif
294
    
295
    #if CREATE_ALL_DESVARS | RIGHT_SHANK_LENGTH
296
    AnyDesVar RightShankLength = {
297
      Val = SEGMENTS_LENGTHS.Right.ShankLength;
298
      Min = 0.1;
299
      Max = 1;
300
    };
301
    #endif
302
    #if RIGHT_SHANK_LENGTH
303
    PARAMETER_OPT_STUDY = { AnyDesVar& RightShankLength = Main.ModelSetup.ParameterIdentification.RightShankLength; };
304
    #endif
305
    
306
    #if CREATE_ALL_DESVARS | LEFT_SHANK_LENGTH
307
    AnyDesVar LeftShankLength = {
308
      Val = SEGMENTS_LENGTHS.Left.ShankLength;
309
      Min = 0.1;
310
      Max = 1;
311
    };
312
    #endif
313
    #if LEFT_SHANK_LENGTH
314
    PARAMETER_OPT_STUDY = { AnyDesVar& LeftShankLength = Main.ModelSetup.ParameterIdentification.LeftShankLength; };
315
    #endif
316
    
317
    #if CREATE_ALL_DESVARS | (RIGHT_SHANK_LENGTH & LEFT_SHANK_LENGTH & LEFT_RIGHT_SYMMETRY)
318
    AnyDesMeasure ShankLengthSymmetry = {
319
      Val = .LeftShankLength.Val - .RightShankLength.Val;
320
      Type = EqualToZero;
321
    };
322
    #endif
323
    #if RIGHT_SHANK_LENGTH & LEFT_SHANK_LENGTH & LEFT_RIGHT_SYMMETRY
324
    PARAMETER_OPT_STUDY = { AnyDesMeasure& ShankLengthSymmetry = Main.ModelSetup.ParameterIdentification.ShankLengthSymmetry; };
325
    #endif
326
    
327
    
328
    #if CREATE_ALL_DESVARS | RIGHT_FOOT_LENGTH
329
    AnyDesVar RightFootLength = {
330
      Val = SEGMENTS_LENGTHS.Right.FootLength;
331
      Min = 0.05;
332
      Max = 0.5;
333
    };
334
    #endif
335
    #if RIGHT_FOOT_LENGTH
336
    PARAMETER_OPT_STUDY = { AnyDesVar& RightFootLength = Main.ModelSetup.ParameterIdentification.RightFootLength; };
337
    #endif
338
    
339
    #if CREATE_ALL_DESVARS | LEFT_FOOT_LENGTH
340
    AnyDesVar LeftFootLength = {
341
      Val = SEGMENTS_LENGTHS.Left.FootLength;
342
      Min = 0.05;
343
      Max = 0.5;
344
    };
345
    #endif
346
    #if LEFT_FOOT_LENGTH
347
    PARAMETER_OPT_STUDY = { AnyDesVar& LeftFootLength = Main.ModelSetup.ParameterIdentification.LeftFootLength; };
348
    #endif
349
    
350
    #if CREATE_ALL_DESVARS | (RIGHT_FOOT_LENGTH & LEFT_FOOT_LENGTH & LEFT_RIGHT_SYMMETRY)
351
    AnyDesMeasure FootLengthSymmetry = {
352
      Val = .LeftFootLength.Val - .RightFootLength.Val;
353
      Type = EqualToZero;
354
    };
355
    #endif
356
    #if RIGHT_FOOT_LENGTH & LEFT_FOOT_LENGTH & LEFT_RIGHT_SYMMETRY
357
    PARAMETER_OPT_STUDY = { AnyDesMeasure& FootLengthSymmetry = Main.ModelSetup.ParameterIdentification.FootLengthSymmetry; };
358
    #endif    
359
    
360
    
361
    
362
    #if CREATE_ALL_DESVARS | RIGHT_UPPERARM_LENGTH
363
    AnyDesVar RightUpperArmLength = {
364
      Val = SEGMENTS_LENGTHS.Right.UpperArmLength;
365
      Min = 0.01;
366
      Max = 1;
367
    };
368
    #endif
369
    #if RIGHT_UPPERARM_LENGTH
370
    PARAMETER_OPT_STUDY = { AnyDesVar& RightUpperArmLength = Main.ModelSetup.ParameterIdentification.RightUpperArmLength; };
371
    #endif
372
    
373
    #if CREATE_ALL_DESVARS | LEFT_UPPERARM_LENGTH
374
    AnyDesVar LeftUpperArmLength = {
375
      Val = SEGMENTS_LENGTHS.Left.UpperArmLength;
376
      Min = 0.1;
377
      Max = 1;
378
    };
379
    #endif
380
    #if LEFT_UPPERARM_LENGTH
381
    PARAMETER_OPT_STUDY = { AnyDesVar& LeftUpperArmLength = Main.ModelSetup.ParameterIdentification.LeftUpperArmLength; };
382
    #endif
383
    
384
    #if CREATE_ALL_DESVARS | (RIGHT_UPPERARM_LENGTH & LEFT_UPPERARM_LENGTH & LEFT_RIGHT_SYMMETRY)
385
    AnyDesMeasure UpperArmLengthSymmetry = {
386
      Val = .LeftUpperArmLength.Val - .RightUpperArmLength.Val;
387
      Type = EqualToZero;
388
    };
389
    #endif
390
    #if RIGHT_UPPERARM_LENGTH & LEFT_UPPERARM_LENGTH & LEFT_RIGHT_SYMMETRY
391
    PARAMETER_OPT_STUDY = { AnyDesMeasure& UpperArmLengthSymmetry = Main.ModelSetup.ParameterIdentification.UpperArmLengthSymmetry; };
392
    #endif    
393
        
394
    
395
    #if CREATE_ALL_DESVARS | RIGHT_LOWERARM_LENGTH
396
    AnyDesVar RightLowerArmLength = {
397
      Val = SEGMENTS_LENGTHS.Right.LowerArmLength;
398
      Min = 0.1;
399
      Max = 1;
400
    };
401
    #endif
402
    #if RIGHT_LOWERARM_LENGTH
403
    PARAMETER_OPT_STUDY = { AnyDesVar& RightLowerArmLength = Main.ModelSetup.ParameterIdentification.RightLowerArmLength; };
404
    #endif
405
    
406
    #if CREATE_ALL_DESVARS | LEFT_LOWERARM_LENGTH
407
    AnyDesVar LeftLowerArmLength = {
408
      Val = SEGMENTS_LENGTHS.Left.LowerArmLength;
409
      Min = 0.1;
410
      Max = 1;
411
    };
412
    #endif
413
    #if LEFT_LOWERARM_LENGTH
414
    PARAMETER_OPT_STUDY = { AnyDesVar& LeftLowerArmLength = Main.ModelSetup.ParameterIdentification.LeftLowerArmLength; };
415
    #endif
416
    
417
    #if CREATE_ALL_DESVARS | (RIGHT_LOWERARM_LENGTH & LEFT_LOWERARM_LENGTH & LEFT_RIGHT_SYMMETRY)
418
    AnyDesMeasure LowerArmLengthSymmetry = {
419
      Val = .LeftLowerArmLength.Val - .RightLowerArmLength.Val;
420
      Type = EqualToZero;
421
    };
422
    #endif
423
    #if RIGHT_LOWERARM_LENGTH & LEFT_LOWERARM_LENGTH & LEFT_RIGHT_SYMMETRY
424
    PARAMETER_OPT_STUDY = { AnyDesMeasure& LowerArmLengthSymmetry = Main.ModelSetup.ParameterIdentification.LowerArmLengthSymmetry; };
425
    #endif    
426
        
427
   
428
    #if CREATE_ALL_DESVARS | RIGHT_HAND_LENGTH
429
    AnyDesVar RightHandLength = {
430
      Val = SEGMENTS_LENGTHS.Right.HandLength;
431
      Min = 0.05;
432
      Max = 0.5;
433
    };
434
    #endif
435
    #if RIGHT_HAND_LENGTH
436
    PARAMETER_OPT_STUDY = { AnyDesVar& RightHandLength = Main.ModelSetup.ParameterIdentification.RightHandLength; };
437
    #endif
438
    
439
    #if CREATE_ALL_DESVARS | LEFT_HAND_LENGTH
440
    AnyDesVar LeftHandLength = {
441
      Val = SEGMENTS_LENGTHS.Left.HandLength;
442
      Min = 0.05;
443
      Max = 0.5;
444
    };
445
    #endif
446
    #if LEFT_HAND_LENGTH
447
    PARAMETER_OPT_STUDY = { AnyDesVar& LeftHandLength = Main.ModelSetup.ParameterIdentification.LeftHandLength; };
448
    #endif
449
    
450
    #if CREATE_ALL_DESVARS | (RIGHT_HAND_LENGTH & LEFT_HAND_LENGTH & LEFT_RIGHT_SYMMETRY)
451
    AnyDesMeasure HandLengthSymmetry = {
452
      Val = .LeftHandLength.Val - .RightHandLength.Val;
453
      Type = EqualToZero;
454
    };
455
    #endif
456
    #if RIGHT_HAND_LENGTH & LEFT_HAND_LENGTH & LEFT_RIGHT_SYMMETRY
457
    PARAMETER_OPT_STUDY = { AnyDesMeasure& HandLengthSymmetry = Main.ModelSetup.ParameterIdentification.HandLengthSymmetry; };
458
    #endif    
459
    
460
    
461
    
462
    #if CREATE_ALL_DESVARS | RIGHT_HAND_BREADTH
463
    AnyDesVar RightHandBreadth = {
464
      Val = SEGMENTS_LENGTHS.Right.HandBreadth;
465
      Min = 0.05;
466
      Max = 0.5;
467
    };
468
    #endif
469
    #if RIGHT_HAND_BREADTH
470
    PARAMETER_OPT_STUDY = { AnyDesVar& RightHandBreadth = Main.ModelSetup.ParameterIdentification.RightHandBreadth; };
471
    #endif
472
    
473
    
474
    #if CREATE_ALL_DESVARS | LEFT_HAND_BREADTH
475
    AnyDesVar LeftHandBreadth = {
476
      Val = SEGMENTS_LENGTHS.Left.HandBreadth;
477
      Min = 0.05;
478
      Max = 0.5;
479
    };
480
    #endif
481
    #if LEFT_HAND_BREADTH
482
    PARAMETER_OPT_STUDY = { AnyDesVar& LeftHandBreadth = Main.ModelSetup.ParameterIdentification.LeftHandBreadth; };
483
    #endif
484
    
485
    #if CREATE_ALL_DESVARS | (RIGHT_HAND_BREADTH & LEFT_HAND_BREADTH & LEFT_RIGHT_SYMMETRY)
486
    AnyDesMeasure HandBreadthSymmetry = {
487
      Val = .LeftHandBreadth.Val - .RightHandBreadth.Val;
488
      Type = EqualToZero;
489
    };
490
    #endif
491
    #if RIGHT_HAND_BREADTH & LEFT_HAND_BREADTH & LEFT_RIGHT_SYMMETRY
492
    PARAMETER_OPT_STUDY = { AnyDesMeasure& HandBreadthSymmetry = Main.ModelSetup.ParameterIdentification.HandBreadthSymmetry; };
493
    #endif  
494
    
495
    
496
    #if CREATE_ALL_DESVARS | RIGHT_TIBIAL_TORSION 
497
    AnyDesVar RightTibialTorsionOffset = {
498
      Val = HUMAN_MODEL_FOLDER.BodyModel.Right.Leg.Seg.Shank.AnkleJoint.TibialTorsionOffset;
499
      Min = -pi/4;
500
      Max = pi/4;
501
    };
502
    #endif
503
    #if RIGHT_TIBIAL_TORSION
504
    PARAMETER_OPT_STUDY = { AnyDesVar& RightTibialTorsionOffset = Main.ModelSetup.ParameterIdentification.RightTibialTorsionOffset; };
505
    #endif
506
    
507
    #if CREATE_ALL_DESVARS | LEFT_TIBIAL_TORSION 
508
    AnyDesVar LeftTibialTorsionOffset = {
509
      Val = HUMAN_MODEL_FOLDER.BodyModel.Left.Leg.Seg.Shank.AnkleJoint.TibialTorsionOffset;
510
      Min = -pi/4;
511
      Max = pi/4;
512
    };
513
    #endif
514
    #if LEFT_TIBIAL_TORSION
515
    PARAMETER_OPT_STUDY = { AnyDesVar& LeftTibialTorsionOffset = Main.ModelSetup.ParameterIdentification.LeftTibialTorsionOffset; };
516
    #endif
517
    
518
    #if CREATE_ALL_DESVARS | (RIGHT_TIBIAL_TORSION & LEFT_TIBIAL_TORSION & LEFT_RIGHT_SYMMETRY) 
519
    AnyDesMeasure TibialTorsionSymmetry = {
520
      Val = .LeftTibialTorsionOffset.Val + .RightTibialTorsionOffset.Val;
521
      Type = EqualToZero;
522
    };
523
    #endif
524
    #if RIGHT_TIBIAL_TORSION & LEFT_TIBIAL_TORSION & LEFT_RIGHT_SYMMETRY
525
    PARAMETER_OPT_STUDY = { AnyDesMeasure& TibialTorsionSymmetry = Main.ModelSetup.ParameterIdentification.TibialTorsionSymmetry; };
526
    #endif      
527
    
528
    
529
    #if CREATE_ALL_DESVARS | RIGHT_VARUS_VALGUS
530
    AnyDesVar RightVarusValgusOffset = {
531
      Val = HUMAN_MODEL_FOLDER.BodyModel.Right.Leg.Seg.Thigh.KneeJoint.VarusValgusRotation;
532
      Min = -pi/4;
533
      Max = pi/4;
534
    };
535
    #endif
536
    #if RIGHT_VARUS_VALGUS
537
    PARAMETER_OPT_STUDY = { AnyDesVar& RightVarusValgusOffset = Main.ModelSetup.ParameterIdentification.RightVarusValgusOffset; };
538
    #endif
539
    
540
    #if CREATE_ALL_DESVARS | LEFT_VARUS_VALGUS
541
    AnyDesVar LeftVarusValgusOffset = {
542
      Val = HUMAN_MODEL_FOLDER.BodyModel.Left.Leg.Seg.Thigh.KneeJoint.VarusValgusRotation;
543
      Min = -pi/4;
544
      Max = pi/4;
545
    };
546
    #endif
547
    #if LEFT_VARUS_VALGUS
548
    PARAMETER_OPT_STUDY = { AnyDesVar& LeftVarusValgusOffset = Main.ModelSetup.ParameterIdentification.LeftVarusValgusOffset; };
549
    #endif
550
551
    #if CREATE_ALL_DESVARS | (RIGHT_VARUS_VALGUS & LEFT_VARUS_VALGUS & LEFT_RIGHT_SYMMETRY)
552
    AnyDesMeasure VarusValgusSymmetry = {
553
      Val = .RightVarusValgusOffset.Val + .LeftVarusValgusOffset.Val;
554
      Type = EqualToZero;
555
    };
556
    #endif
557
    #if RIGHT_VARUS_VALGUS & LEFT_VARUS_VALGUS & LEFT_RIGHT_SYMMETRY
558
    PARAMETER_OPT_STUDY = { AnyDesMeasure& VarusValgusSymmetry = Main.ModelSetup.ParameterIdentification.VarusValgusSymmetry; };
559
    #endif      
560
        
561
    
562
 };
563
  
564
  
565
  
566
  
567
  
568
  
569
  
570
}; // End of InsertSegmentClass
571
572
573
574
#class_template CreateDesVar (
575
    NAME,
576
    PARAMETER,
577
    ENABLE=1, 
578
    PARAMETER_OPT_STUDY = Main.Studies.ParameterIdentification
579
    )
580
{
581
   Main.ModelSetup.ParameterIdentification = 
582
   {
583
     AnyDesVar NAME = {
584
       Val = .....PARAMETER;
585
       #var Min = 0.01;
586
       #var Max = 1;
587
     };
588
   };
589
   #if ENABLE
590
   PARAMETER_OPT_STUDY = 
591
   {
592
      AnyDesVar& NAME = Main.ModelSetup.ParameterIdentification.NAME;
593
   };
594
   #endif
595
};
596
597
598
#endif