Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

rdInitialStatesTarget.h

00001 // rdInitialStatesTarget.h 00002 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00003 // Copyright (c) 2006 Stanford University and Realistic Dynamics, Inc. 00004 // Contributors: Frank C. Anderson, Ph.D. 00005 // 00006 // Permission is hereby granted, free of charge, to any person obtaining 00007 // a copy of this software and associated documentation files (the 00008 // "Software"), to deal in the Software without restriction, including 00009 // without limitation the rights to use, copy, modify, merge, publish, 00010 // distribute, sublicense, and/or sell copies of the Software, and to 00011 // permit persons to whom the Software is furnished to do so, subject 00012 // to the following conditions: 00013 // 00014 // The above copyright notice and this permission notice shall be included 00015 // in all copies or substantial portions of the Software. 00016 // 00017 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00018 // EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 00019 // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 00020 // PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, 00021 // CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 00022 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 00023 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH 00024 // THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00025 // 00026 // This software, originally developed by Realistic Dynamics, Inc., was 00027 // transferred to Stanford University on November 1, 2006. 00028 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00029 #ifndef __rdInitialStatesTarget_h__ 00030 #define __rdInitialStatesTarget_h__ 00031 00032 #include "rdCMCDLL.h" 00033 #include <OpenSim/Tools/rdTools.h> 00034 #include <OpenSim/Tools/rdMath.h> 00035 #include <OpenSim/SQP/rdFSQP.h> 00036 #include <OpenSim/SQP/rdOptimizationTarget.h> 00037 #include <OpenSim/Simulation/Model/ModelIntegrandForActuators.h> 00038 #include "rdCMC.h" 00039 00040 00041 //extern template class RDTOOLS_API Array<double>; 00042 00043 00044 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00045 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00053 class RDCMC_API rdInitialStatesTarget : public OpenSim::rdOptimizationTarget 00054 { 00055 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00056 //============================================================================== 00057 // DATA 00058 //============================================================================== 00059 private: 00061 double _ti; 00063 double _tf; 00065 double _tfEqui; 00067 rdCMC *_controller; 00068 /* Integrand for establishing equilibrium values for the initial states. */ 00069 OpenSim::ModelIntegrandForActuators *_equi; 00071 OpenSim::IntegRKF *_integEqui; 00073 OpenSim::ModelIntegrand *_forw; 00075 OpenSim::IntegRKF *_integForw; 00076 00078 OpenSim::Array<double> _yi; 00080 OpenSim::Array<double> _y; 00082 OpenSim::Array<double> _dydt; 00083 00084 //============================================================================== 00085 // METHODS 00086 //============================================================================== 00087 public: 00088 //--------------------------------------------------------------------------- 00089 // CONSTRUCTION 00090 //--------------------------------------------------------------------------- 00091 virtual ~rdInitialStatesTarget(); 00092 rdInitialStatesTarget(int aNX,double aTI,const double *aY, 00093 rdCMC *aController,OpenSim::ModelIntegrandForActuators *aEquilib); 00094 private: 00095 void setNull(); 00096 00097 //--------------------------------------------------------------------------- 00098 // UTILITY 00099 //--------------------------------------------------------------------------- 00100 public: 00101 void generateEquilibriumStates(const double *aX,double *rY); 00102 00103 //-------------------------------------------------------------------------- 00104 // REQUIRED OPTIMIZATION TARGET METHODS 00105 //-------------------------------------------------------------------------- 00106 // PERFORMANCE AND CONSTRAINTS 00107 int compute(double *x,double *p,double *c); 00108 int computeGradients(double *dx,double *x,double *dpdx,double *dcdx); 00109 // PERFORMANCE 00110 int computePerformance(double *x,double *p); 00111 int computePerformanceGradient(double *x,double *dpdx); 00112 // CONSTRAINTS 00113 int computeConstraint(double *x,int i,double *c); 00114 int computeConstraintGradient(double *x,int i,double *dcdx); 00115 00116 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00117 }; // END class rdInitialStatesTarget 00118 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00119 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00120 00121 00122 #endif // #ifndef __rdInitialStatesTarget_h__

Generated on Wed Nov 1 16:04:31 2006 for Computed Muscle Control (CMC) API by doxygen 1.3.8