00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #pragma once
00014
00015 #ifndef __NONLINEARSOLUTIONTRAJECTORY__
00016 #define __NONLINEARSOLUTIONTRAJECTORY__
00017
00018
00019 #include "BaseTrajectory.h"
00020 #include "alg_types.h"
00021 #include "NonLinearGroupElement.h"
00022
00023
00025
00026 template <typename my_alg_type_IN, typename my_alg_type_OUT>
00027 class NonLinearSolutionTrajectory :
00028 public BaseTrajectory<my_alg_type_OUT>
00029 {
00030 private:
00032 Path<my_alg_type_IN> & theControl;
00033
00035 const std::vector<POLYLIE<my_alg_type_OUT>> theVectorFields;
00036
00038 const SCA Inf;
00039
00041 const AbstractSolutionPoint Ini;
00042
00043 public:
00045 NonLinearSolutionTrajectory(Path<my_alg_type_IN> & theControlIn, std::vector<POLYLIE<my_alg_type_OUT>> & theVectorFieldsIn, AbstractSolutionPoint & theInitialValue, SCA theStartTime = SCA(0))
00046 : theControl(theControlIn), theVectorFields(theVectorFieldsIn), Inf(theStartTime), Ini(theInitialValue)
00047 {
00048 };
00049
00051 ~NonLinearSolutionTrajectory(void)
00052 {
00053 };
00054
00057 AbstractSolutionPoint Value(const SCA t, const unsigned int Resolution=11) const
00058 {
00059 dyadic_interval Width(t-Inf, Resolution);
00060 dyadic_interval Begin = dyadic_interval::dyadic_bracket(Inf,Width.n);
00061 dyadic_interval End = dyadic_interval::dyadic_bracket(t,Width.n);
00062
00063 unsigned int NoIncrements = End.k - Begin.k;
00064
00065 SPB::NonLinearGroupElement<my_alg_type_IN,my_alg_type_OUT> CurrentGroupElt;
00066
00067 AbstractSolutionPoint CurrentValue;
00068 CurrentValue = Ini;
00069
00070 AbstractSolutionPoint temp;
00071
00072 dyadic_interval CurrentInterval=Begin;
00073
00074 lietovectorfield<my_alg_type_IN,POLYLIE_OUT> l2vf(theVectorFields);
00075
00076 for(unsigned int i=1; i <= NoIncrements; i++)
00077 {
00078 CurrentGroupElt = SPB::NonLinearGroupElement<my_alg_type_IN,my_alg_type_OUT>(theControl.DescribePath(CurrentInterval++), l2vf);
00079
00080 temp = CurrentGroupElt.evaluate(CurrentValue);
00081 CurrentValue = temp;
00082 }
00083
00084 return CurrentValue;
00085 };
00086 };
00087
00088 #endif // __NONLINEARSOLUTIONTRAJECTORY__