a b/Application/Examples/BikeSpring/BikeModel.main.any
1
#include "../libdef.any"
2
/* ----------------------------------------------------------------------------------
3
  This is an example of a 2-D bicycle with a spring helping the model over
4
  the dead centers
5
---------------------------------------------------------------------------------- */
6
7
Main = {
8
  
9
  
10
  /**Execute this operation to run the model in the intended operation sequence.  
11
  It is also possible to run operations seperately, by manual selections in the operation tree*/
12
  AnyOperationSequence RunApplication = {
13
    ///This operation is the inverse dynamic analysis
14
    AnyOperation &InvAnal=Main.Study.InverseDynamics;
15
    
16
  };
17
18
  AnyFolder BikeParameters = {
19
    
20
    // Bicycle parameters
21
    AnyVar PedalArmLength =0.17;  //Length of pedal arm
22
    AnyVar PedalArmWidth = 0.106; //Horizontal distance between left and right connecting point between foot and pedal
23
    AnyVar SaddleHeight = 0.60 ;  //Height of hip joint measured vertically from the crank
24
    AnyVar SaddlePos = -0.15;     //Horizontal pos of hipjoint measured from the crank
25
    
26
    #include "Model/anyinc.any"
27
    
28
    // Loading parameters
29
    AnyVar Cadence = 80.0;   //Cadence in RPM 
30
    AnyVar Torque = 30.0;    //Constant crank torque in Nm
31
    
32
    // The function for the crank moment is defined as Moment=Offset-Amp*cos(4*pi*t/T+Phase)
33
    AnyVar T = 60/Cadence; //Cycle time
34
  };
35
  
36
   // Body parameters that the leg model will need a reference to.
37
  AnyFolder BodyParameters = {
38
    AnyVar BodyMass = 75;
39
    AnyVar Density = 1000;
40
  }; //Bodyparameters
41
  
42
  
43
  // These are the attachment positions of the bike frames to the global reference frame
44
  AnyFixedRefFrame GlobalRef = {
45
  };  // Global reference frame  
46
  
47
  
48
  #include "Model/DrawSettings.any"
49
  #include "Model/Scaling.any"
50
  
51
  
52
    
53
    // This folder is a place to assemble all the elements to include in the
54
    // study. The study in this folder is for the 2-D legs, so the Model folder
55
    // herender does not include the bicycle with the 3-D legs.
56
    AnyFolder Model = {
57
      
58
      // Notice the '&'. It means that HumanFolder is just a pointer
59
      AnyFolder &HumanFolder = Leg2D;  
60
      #include "Model/Leg2D.any"
61
      #include "Model/BikeFrameAndWheels.any"
62
      
63
      AnyVar  Dist = 0.0;
64
      #include "Model/BikeLegConnection.any"        
65
      #include "Model/BikeFrameGroundConnection.any"
66
    };
67
    
68
    // The study: Operations to be performed on the model
69
    AnyBodyStudy Study = {
70
      
71
      AnyFolder &Model = .Model;      
72
      
73
     
74
      Gravity = {0.0, -9.81, 0.0};
75
      
76
      tEnd = Main.BikeParameters.T;
77
78
      AnyOutputFile OutFile1 = {
79
        FileName = ANYBODY_PATH_OUTPUT+"/MaxActivity.csv";
80
        AnyVar MaxAct = .MaxMuscleActivity;
81
      };
82
    };
83
84
   
85
  
86
}; // Main