All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
eigenanalyser.h
1 /* Copyright (C) 2004-2014 MBSim Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Contact: martin.o.foerg@googlemail.com
18  */
19 
20 #ifndef _EIGENANALYSER_H_
21 #define _EIGENANALYSER_H_
22 
23 #include "fmatvec/fmatvec.h"
24 #include "mbsim/functions/function.h"
25 #include "mbsim/solver.h"
26 
27 namespace MBSimAnalyser {
28 
29  const MBXMLUtils::NamespaceURI MBSIMANALYSER("http://www.mbsim-env.de/MBSimAnalyser");
30 
35  class Eigenanalyser : public MBSim::Solver {
36 
37  class Residuum : public MBSim::Function<fmatvec::Vec(fmatvec::Vec)> {
38  public:
39  Residuum(MBSim::DynamicSystemSolver *sys_, double t_);
40  fmatvec::Vec operator()(const fmatvec::Vec &z);
41  private:
43  double t;
44  };
45 
46  public:
47 
48  enum Task { eigenfrequencies, eigenmodes, eigenmode, eigenmotion };
49 
53  Eigenanalyser() : tStart(0), tEnd(1), dtPlot(1e-2), A(1), n(1), compEq(false), task(eigenmode) {}
54 
59 
61 
67 
72  void setInitialDeviation(const fmatvec::Vec &deltaz0_) { deltaz0 = deltaz0_; }
73 
78  void setAmplitude(double A_) { A = A_; }
79 
84  void setMode(int n_) { n = n_; }
85 
90  void setStartTime(double tStart_) { tStart=tStart_; }
91 
96  void setEndTime(double tEnd_) { tEnd = tEnd_; }
97 
102  void setPlotStepSize(double dtPlot_) { dtPlot = dtPlot_; }
103 
108  void setInitialState(const fmatvec::Vec &z0) { zEq = z0; }
109 // void setEquilibriumState(const fmatvec::Vec &zEq_) { zEq = zEq_; }
110 
115  void setDetermineEquilibriumState(bool eq) { compEq = eq; }
116 
117  void setTask(Task task_) { task = task_; }
118 
119  const fmatvec::Vec& getInitialState() const { return zEq; }
120 
126 
132 
137  const fmatvec::Vec& getEigenfrequencies() const { return freq; }
138 
143  void setOutputFileName(const std::string &fileName_) { fileName = fileName_; }
144 
145  void initializeUsingXML(xercesc::DOMElement *element);
146 
147  protected:
148 
149  fmatvec::Vec zEq, deltaz0;
150  double tStart, tEnd, dtPlot, A;
151  int n;
152  bool compEq;
153  Task task;
154 
157  fmatvec::Vec freq;
158  std::vector<std::pair<double,int> > f;
159 
160  std::string fileName;
161 
162  bool saveEigenanalyis(const std::string &fileName);
163  void computeEigenfrequencies();
164  void computeEigenvalues();
165  void computeEigenmodes();
166  void computeEigenmode();
167  void computeEigenmotion();
168  };
169 
170 }
171 
172 #endif
solver-interface for dynamic systems
Definition: solver.h:38
const fmatvec::SquareMatrix< fmatvec::Ref, std::complex< double > > & getEigenvectors() const
Get the eigenvectors.
Definition: eigenanalyser.h:131
void setAmplitude(double A_)
Set the amplitude for the eigemode analysis.
Definition: eigenanalyser.h:78
void analyse(MBSim::DynamicSystemSolver &system)
Perform the eigenanalysis.
Definition: eigenanalyser.cc:65
solver interface for modelling and simulation of dynamic systems
Definition: dynamic_system_solver.h:48
~Eigenanalyser()
Destructor.
Definition: eigenanalyser.h:58
const fmatvec::Vector< fmatvec::Ref, std::complex< double > > & getEigenvalues() const
Get the eigenvalues.
Definition: eigenanalyser.h:125
void setDetermineEquilibriumState(bool eq)
Determine the equilibrium state for the analysis.
Definition: eigenanalyser.h:115
void setInitialDeviation(const fmatvec::Vec &deltaz0_)
Set the initial deviation of the equilibrium.
Definition: eigenanalyser.h:72
void execute(MBSim::DynamicSystemSolver &system)
start solving the dynamic system
Definition: eigenanalyser.h:60
const fmatvec::Vec & getEigenfrequencies() const
Get the eigenfrequencies.
Definition: eigenanalyser.h:137
void setMode(int n_)
Set the mode for the eigemode analysis.
Definition: eigenanalyser.h:84
Eigenanalyser for dynamic systems.
Definition: eigenanalyser.h:35
void setStartTime(double tStart_)
Set the start time for the analysis.
Definition: eigenanalyser.h:90
void setEndTime(double tEnd_)
Set the end time for the analysis.
Definition: eigenanalyser.h:96
void setOutputFileName(const std::string &fileName_)
Set the name of the output file.
Definition: eigenanalyser.h:143
void setInitialState(const fmatvec::Vec &z0)
Set the initital state for the analysis.
Definition: eigenanalyser.h:108
Definition: planar_contour.h:31
void setPlotStepSize(double dtPlot_)
Set the plot step size for the analysis.
Definition: eigenanalyser.h:102
Eigenanalyser()
Standard constructor.
Definition: eigenanalyser.h:53
Definition: eigenanalyser.h:37
static DynamicSystemSolver * system
dynamic system
Definition: solver.h:65

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML