00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _EIGENANALYSIS_H_
00021 #define _EIGENANALYSIS_H_
00022
00023 #include "fmatvec/fmatvec.h"
00024 #include "fmatvec/function.h"
00025
00026 namespace MBSim {
00027
00028 class DynamicSystemSolver;
00029
00034 class Eigenanalysis {
00035
00036 class Residuum : public fmatvec::Function<fmatvec::Vec(fmatvec::Vec)> {
00037 public:
00038 Residuum(DynamicSystemSolver *sys_, double t_);
00039 fmatvec::Vec operator()(const fmatvec::Vec &z);
00040 private:
00041 DynamicSystemSolver *sys;
00042 double t;
00043 };
00044
00045 public:
00049 Eigenanalysis() : tStart(0), tEnd(1), dtPlot(1e-2) {}
00050
00054 ~Eigenanalysis() {}
00055
00060 void analyse(DynamicSystemSolver& system);
00061
00066 void setInitialGuess(const fmatvec::Vec &z0_) { z0 = z0_; }
00067
00072 void setInitialDeviation(const fmatvec::Vec &deltaz0_) { deltaz0 = deltaz0_; }
00073
00078 void setStartTime(double tStart_) { tStart=tStart_; }
00079
00084 void setEndTime(double tEnd_) { tEnd = tEnd_; }
00085
00090 void setPlotStepSize(double dtPlot_) { dtPlot = dtPlot_; }
00091
00096 void setEquilibriumState(const fmatvec::Vec &zEq_) { zEq = zEq_; }
00097
00102 const fmatvec::Vector<fmatvec::Ref, std::complex<double> >& getEigenvalues() const { return w; }
00103
00108 const fmatvec::SquareMatrix<fmatvec::Ref, std::complex<double> >& getEigenvectors() const { return V; }
00109
00114 void setOutputFileName(const std::string &fileName_) { fileName = fileName_; }
00115
00116 protected:
00117
00118 static DynamicSystemSolver* system;
00119
00120 fmatvec::Vec z0, deltaz0, zEq;
00121 double tStart, tEnd, dtPlot;
00122
00123 fmatvec::SquareMatrix<fmatvec::Ref, std::complex<double> > V;
00124 fmatvec::Vector<fmatvec::Ref, std::complex<double> > w;
00125
00126 std::string fileName;
00127 };
00128
00129 }
00130
00131 #endif