KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Pool.m
Go to the documentation of this file.
1 namespace models{
2 namespace motorunit{
3 
4 
5 /* (Autoinserted by mtoc++)
6  * This source code has been filtered by the mtoc++ executable,
7  * which generates code that can be processed by the doxygen documentation tool.
8  *
9  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
10  * Except for the comments, the function bodies of your M-file functions are untouched.
11  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
12  * attached source files that are highly readable by humans.
13  *
14  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
15  * the correct locations in the source code browser.
16  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
17  */
18 
19 class Pool
20  :public handle {
38  public:
39 
41 
43 
44  ShortenInput = @("t")3;
45 
46 
47  public:
48 
50 
52 
54 
55 
56  public:
57 
58 
59  Pool(version) {
60  if nargin < 1
61  version = 1;
62  end
63  this.Version= version;
64  this.fugle= models.motorunit.Fuglevand;
65  this.shorten= models.motorunit.Shorten;
66  }
67 
68 
69  function prepareSimulation(T,meancurrent) {
70  ft = this.FibreTypes;
71  nf = length(ft);
72  a = zeros(nf,T+300);
73  this.fugle.Seed= 1;
74  if this.Version == 1
75  for fidx = 1:nf
76  a(fidx,:) = this.fugle.getForces([ft(fidx); meancurrent],T+300);
77  end
78  startpos = find(sum(a,1),1)-10;
79  if startpos > 0
80  a(:,1:startpos) = [];
81  a(:,end-300+startpos+1:end) = [];
82  end
83  elseif this.Version == 2
84  m = this.shorten;
85  m.T= T;
86  m.System.Inputs[1] = this.ShortenInput;
87  for fidx = 1:nf
88  a(fidx,:) = this.shorten.simulate([ft(fidx); meancurrent],1);
89  end
90  end
91  this.alpha= a;
92  mval = max(a(:));
93  if mval > 0
94  this.alpha= a/mval;
95  end
96  }
97 
98 
99  function alpha = getActivation(double t) {
100  a = this.alpha;
101  alpha = a(:,min(size(a,2),round(t+1)));
102  }
103 
104 
105 
106 };
107 }
108 }
109 
Pool(version)
Definition: Pool.m:59
function prepareSimulation(T, meancurrent)
Definition: Pool.m:69
Matlab's base handle class (documentation generation substitute)
function alpha = getActivation(double t)
Definition: Pool.m:99
Pool: A motorunit pool with either Fuglevand or Shorten model for force generation.
Definition: Pool.m:19