Switch to unified view

a b/Application/Examples/SeatedHumanFullWithNeck/SeatedHumanFullWithNeck.main.any
1
#include "../libdef.any"
2
3
// --------------------------------------------------------
4
// This is a model comprising the full body model, a chair
5
// and an interface between them.
6
// The interface is made such that the posture of the body
7
// is dependent of the settings if the chair.
8
// The settings of the chair (and thereby the posture of 
9
// the body) are controlled by the parameters in the 
10
// folders DrvPos and DrvVel.
11
// The support between the body and the chair is made with artificial muscles
12
// which also handles friction
13
// --------------------------------------------------------
14
15
Main = {
16
  // ----------------------------------------------------------
17
  // Model parameters: Driver position and support settings
18
  // ----------------------------------------------------------
19
  #include "Model/InputParameters.any"
20
  
21
  // ----------------------------------------------------------
22
  // Path to draw settings
23
  // ----------------------------------------------------------
24
  #include "Model/DrawSettings.any"
25
26
  // ----------------------------------------------------------
27
  // Body Model Configuration
28
  // ----------------------------------------------------------
29
  #include "Model/BodyModelConfiguration.any"
30
  
31
  // The Mannequin file specifies load-time positions for all the segments
32
  // in the HumanModel. This is important for the model's ablity to resolve
33
  // all the kinematic constraints when the model is analyzed.
34
  // The mannequin file also drives those degrees of freedom of the human 
35
  // model that are not governed by problem-specific drivers at run time.    
36
  #include "Model/Mannequin.any" 
37
38
  // Model of the human body to be used for the analysis  
39
  #include "<ANYBODY_PATH_BODY>/HumanModel.any"
40
41
  /// The actual model where all components are assembled  
42
  AnyFolder Model ={
43
    /// Body model without default drivers
44
    AnyFolder &BodyModel=.HumanModel.BodyModel;
45
    /// Reference to the mannequin folder (used by drivers)
46
    AnyFolder &Mannequin =.HumanModel.Mannequin;  
47
 
48
    #include "Model/MannequinValuesFromModel.any"   
49
    
50
    AnyFolder EnvironmentModel = {
51
      #include "Model/Environment.any"
52
    };
53
    
54
    AnyFolder ModelEnvironmentConnection = {
55
      #include "Model/ConnectionSegments.any"
56
      #include "Model/JointsAndDrivers.any"
57
      
58
      AnyFolder &RefPM=Main.Model.EnvironmentModel;
59
      #include "Model/InitialPositionsEnvironment.any" 
60
      #include "Model/Measures.any"
61
      #include "Model/Support.any" 
62
    }; // ModelEnvironmentConnection
63
    
64
    
65
    // -------------------------------------------------------------
66
    
67
  }; // Model
68
  
69
  // --------------------------------------------------------------
70
  // Studies
71
  // --------------------------------------------------------------
72
  AnyBodyStudy Study = {
73
    AnyFolder &Model = .Model;
74
   
75
    
76
    tEnd = 1;
77
    Gravity = {0.0, -9.81, 0.0};
78
    nStep = 1;
79
    
80
    //Output from the Vastus Muscles
81
    #if BM_TRUNK_CERVICAL_MUSCLES == _MUSCLES_SIMPLE_
82
    AnyVar VastiAct = 
83
    max({Main.Model.BodyModel.Right.Leg.Mus.VastusMedialis.Activity,
84
      Main.Model.BodyModel.Right.Leg.Mus.VastusIntermedius.Activity,
85
      Main.Model.BodyModel.Right.Leg.Mus.VastusLateralis.Activity});
86
    
87
    //Size of total force in the L5 Sacrum joint
88
    AnyVar L5SacrumReac = (Main.Model.BodyModel.Trunk.JointsLumbar.L5SacrumJnt.Constraints.Reaction.Fout[0]^2+
89
    Main.Model.BodyModel.Trunk.JointsLumbar.L5SacrumJnt.Constraints.Reaction.Fout[1]^2+
90
    Main.Model.BodyModel.Trunk.JointsLumbar.L5SacrumJnt.Constraints.Reaction.Fout[2]^2)^0.5;
91
    
92
    
93
    AnyOutputFun MaxAct = {
94
      Val = .MaxMuscleActivity;
95
    };    
96
    AnyOutputFun MaxVastiAct = {
97
      Val = .VastiAct;
98
    };
99
    AnyOutputFun L5SacrumR = {
100
      Val = .L5SacrumReac;
101
    }; 
102
    #endif
103
  }; // Study
104
  
105
  // Include an operation sequence to run all required steps of your application (see Operations tab)
106
    #include "<ANYBODY_PATH_MODELUTILS>\Operations\RunAppSequence.any"    
107
    
108
  
109
};// Main
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125