-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBikeModel2D.main.any
More file actions
120 lines (97 loc) · 4.19 KB
/
BikeModel2D.main.any
File metadata and controls
120 lines (97 loc) · 4.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#include "libdef.any"
/**2-D bicyle model.
Although this model can be rotated in 3-D space it really is just a saggital
plane pedaling model with only a few muscles in each leg. The beauty of
pedaling is that it is one of the few cases of biomechanics that can be modeled
reasonably on two dimensions only.
The 2-D legs are supplemented with models of the bike frame, crank, and
wheels.
You can do lots of interesting stuff with this model:
- Investigate the influence of the bicycle design
- Change riding parameters sich as cadence and output power
- Separate internal work for acceleraton of body segments
from external work on the crank.*/
Main = {
/// Various parameters for setting up the bicycle and the riding characteristics.
AnyFolder BikeParameters = {
// Geometry parameters
AnyVar PedalArmLength = 0.17; //Length of pedal arm
AnyVar PedalArmWidth = 0.106; //Horizontal distance between left and right connecting point between foot and pedal
AnyVar SaddleHeight = 0.66 ; //Height of hip joint measured vertically from the crank
AnyVar SaddlePos = -0.16; //Horizontal pos of hipjoint measured from the crank
// Loading parameters
AnyVar Cadence = 80.0; //Cadence in RPM
AnyVar MechOutput = 165; //Average Mechanical output over a cycle in Watt
AnyVar PhaseShift = atan(SaddlePos/SaddleHeight); // Phase shift for different seat positions
// The function for the crank moment is defined as Moment=Offset-Amp*cos(4*pi*t/T+Phase)
AnyVar T = 60/Cadence; //Cycle time
AnyVar CrankMomentTopDeadCenter = 3.0; // This is the moment which can be applied by the rider in the top dead center point
AnyVar CrankMomentOffset = (MechOutput*T)/(2*pi);
AnyVar CrankMomentAmp = CrankMomentOffset-CrankMomentTopDeadCenter;
AnyVar CrankMomentPhase = -PhaseShift;
};
/// These are the attachment positions of the bike frames to the global
/// reference frame
AnyFixedRefFrame GlobalRef = {
AnyRefNode Bike2DGround = { sRel = {0.0, 0.0, 0.0}; };
AnyRefNode Bike3DGround = { sRel = {0.0, 0.0, 0.0}; };
}; // Global reference frame
/// Body parameters that the leg model will need a reference to.
AnyFolder BodyParameters = {
AnyVar BodyMass = 75;
AnyVar Density = 1000;
}; //Bodyparameters
#include "Model/DrawSettings.any"
#include "Model/Scaling.any"
/// This folder is a place to assemble all the elements to include in the
/// study.
AnyFolder Model = {
// Notice the '&'. It means that HumanFolder is just a pointer
AnyFolder &HumanFolder = Leg2D;
#include "Model/Leg2D.any"
#include "Model/BikeFrameAndWheels.any"
#include "Model/BikeLegConnection.any"
AnyRefNode& GroundNode = Main.GlobalRef.Bike2DGround;
#include "Model/BikeFrameGroundConnection.any"
};
// The study: Operations to be performed on the model
AnyBodyStudy Study = {
AnyFolder &Model = .Model;
Gravity = {0.0, -9.81, 0.0};
tEnd = Main.BikeParameters.T;
// Useful variables for the optimization
AnyFolder &r = Main.Model.Leg2D.Right.Mus;
AnyFolder &l = Main.Model.Leg2D.Left.Mus;
AnyVar Pmet_total = r.Ham.Pmet+r.BiFemSh.Pmet+r.GlutMax.Pmet+r.RectFem.Pmet+r.Vasti.Pmet+r.Gas.Pmet+r.Sol.Pmet+r.TibAnt.Pmet+l.Ham.Pmet+l.BiFemSh.Pmet+l.GlutMax.Pmet+l.RectFem.Pmet+l.Vasti.Pmet+l.Gas.Pmet+l.Sol.Pmet+l.TibAnt.Pmet;
AnyOutputFun MaxAct = {
Val = .MaxMuscleActivity;
};
AnyOutputFun Metabolism = {
Val = .Pmet_total;
};
};
AnyParamStudy ParamStudy = {
Analysis = {
AnyOperation &Operation = ..Study.InverseDynamics;
};
nStep = {10,10};
AnyDesVar SaddleHeight = {
Val = Main.BikeParameters.SaddleHeight;
Min = 0.61;
Max = 0.69 /*+ 0.02*/;
};
AnyDesVar SaddlePos = {
Val = Main.BikeParameters.SaddlePos;
Min = -0.20 /*- 0.03*/;
Max = -0.05;
};
AnyDesMeasure MaxAct = {
Val = max(..Study.MaxAct());
};
AnyDesMeasure Metab = {
Val = secint(..Study.Metabolism(),..Study.tArray);
};
};
// Include an operation sequence to run all required steps of your application (see Operations tab)
#include "Model\RunAppSequence.any"
}; // Main