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
Force.m
Go to the documentation of this file.
1 namespace models{
2 namespace golf{
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 Force
20  :public dscomponents.ACoreFun {
39  public:
40 
41 
42 
43  public:
44 
45  Force(sys) {
46  this = this@dscomponents.ACoreFun(sys);
47  this.xDim= 4;
48  this.fDim= 2;
49  this.JSparsityPattern= sparse(true(2,4));
50  }
51 
52 
53  function dv = evaluate(x_v,double t) {
54  m = this.System.Model;
55  mu = this.mu;
56 
57  gr = m.gradgreen(x_v(1:2));
58  /* Normale berechnen */
59  normale = [gr; -1]/norm([gr; -1]);
60  /* Normalenkraft */
61  Fn = normale * -mu(7)*normale(3);
62  /* Hangabtriebskraft */
63  Fb = [0;0;-mu(7)] - Fn;
64  /* Dreht den Fb-Vektror in die x,y-Richtung (kleiner Optimierungsgedanke)
65  *Fb = -gr/norm(gr)*norm(Fb); */
66 
67  /* % MIT Reibung
68  * Reibungskonstante * |F_n| * normierter Geschwindigkeitsvektor * zeiteinheit
69  *Fr = mu*norm([gr;1]) * (v / norm(v)); %ALT */
70  Fr = mu(8)*norm(Fn) * (x_v(3:4) / norm(x_v(3:4)));
71  /* Gesamtkraft; wir lassen die z-Komponente der Hangabtriebskraft
72  * ausser acht, da diese auf einem Putting-Green erwartungsgemäß
73  * klein ist. */
74  dv = Fb([1 2])-Fr;
75 
76  /* % OHNE Reibung
77  *dv = Fb; */
78  }
79 
80 
81  function evaluateCoreFun() {
82  error(" evaluate is overridden directly. ");
83  }
84 
85 
86 
87 };
88 }
89 }
90 
integer fDim
The current output dimension of the function.
Definition: ACoreFun.m:171
Force(sys)
Definition: Force.m:45
Force:
Definition: Force.m:19
Model
The Model this System is attached to.
function dv = evaluate(x_v,double t)
Definition: Force.m:53
Basic interface for all dynamical system's core functions Inherits the AProjectable interface...
Definition: ACoreFun.m:18
integer xDim
The current state space dimension of the function's argument .
Definition: ACoreFun.m:151
System:
Definition: System.m:19
colvec< double > mu
The current model parameter mu for evaluations. Will not be persisted as only valid for runtime durin...
Definition: ACoreFun.m:208
function evaluateCoreFun()
Definition: Force.m:81
sparse< logical > JSparsityPattern
Sparsity pattern for the jacobian matrix.
Definition: ACoreFun.m:127