codac 1.5.6
Loading...
Searching...
No Matches
codac::RandTrajectory Class Reference

One dimensional random trajectory \(x(\cdot)\), used to represent noises. More...

#include <codac_RandTrajectory.h>

Inheritance diagram for codac::RandTrajectory:
Collaboration diagram for codac::RandTrajectory:

Public Member Functions

Definition
 RandTrajectory (const Interval &tdomain, double timestep, const Interval &bounds)
 Creates a scalar trajectory \(x(\cdot)\) made of random values.
 
- Public Member Functions inherited from codac::Trajectory
 Trajectory ()
 Creates an empty scalar trajectory \(x(\cdot)\).
 
 Trajectory (const Interval &tdomain, const TFunction &f)
 Creates a scalar trajectory \(x(\cdot)\) from an analytic expression.
 
 Trajectory (const Interval &tdomain, const TFunction &f, double timestep)
 Creates a scalar trajectory \(x(\cdot)\) from an analytic expression, and transforms it as a map of values (sampling procedure)
 
 Trajectory (const std::map< double, double > &m_map_values)
 Creates a scalar trajectory \(x(\cdot)\) from a map of values.
 
 Trajectory (const std::list< double > &list_t, const std::list< double > &list_x)
 Creates a scalar trajectory \(x(\cdot)\) from a list of values.
 
 Trajectory (const Trajectory &traj)
 Creates a copy of a scalar trajectory \(x(\cdot)\).
 
 ~Trajectory ()
 Trajectory destructor.
 
const Trajectoryoperator= (const Trajectory &x)
 Returns a copy of a Trajectory.
 
int size () const
 Returns the dimension of the scalar trajectory (always 1)
 
const Interval tdomain () const
 Returns the temporal definition domain of this trajectory.
 
TrajDefnType definition_type () const
 Returns the definition type of this trajectory.
 
const std::map< double, double > & sampled_map () const
 Returns the map of values, if the object is defined as a map.
 
const TFunction * tfunction () const
 Returns the temporal function, if the object is an analytic trajectory.
 
const Interval codomain () const
 Returns the interval of feasible values.
 
double operator() (double t) const
 Returns the evaluation of this trajectory at \(t\).
 
const Interval operator() (const Interval &t) const
 Returns the interval evaluation of this trajectory over \([t]\).
 
double first_value () const
 Returns the value \(x(t_0)\).
 
double last_value () const
 Returns the value \(x(t_f)\).
 
bool not_defined () const
 Tests whether this trajectory is defined or not.
 
bool operator== (const Trajectory &x) const
 Returns true if this trajectory is equal to \(x(\cdot)\).
 
bool operator!= (const Trajectory &x) const
 Returns true if this trajectory is different from \(x(\cdot)\).
 
void set (double y, double t)
 Sets a value \(y\) at \(t\): \(x(t)=y\).
 
Trajectorytruncate_tdomain (const Interval &tdomain)
 Truncates the tdomain of \(x(\cdot)\).
 
Trajectoryshift_tdomain (double a)
 Shifts the tdomain \([t_0,t_f]\) of \(x(\cdot)\).
 
bool constant_timestep (double &h) const
 Returns true if the same amount of time separates each value.
 
Trajectorysample (double timestep)
 Samples the trajectory by adding new points to the map of values.
 
Trajectorysample (const Trajectory &x)
 Samples this trajectory so that it will share the same sampling of \(x(\cdot)\).
 
Trajectorymake_continuous ()
 Makes a trajectory continuous by avoiding infinite slopes.
 
const Trajectory primitive (double c=0.) const
 Computes an approximative primitive of \(x(\cdot)\).
 
const Trajectory primitive (double c, double timestep) const
 Computes an approximative primitive of \(x(\cdot)\) with some time discretization \(\delta\).
 
const Trajectory diff () const
 Differentiates this trajectory.
 
double finite_diff (double t, double h) const
 Computes the finite difference at \(t\), with an automatic order of accuracy.
 
const Trajectoryoperator+= (double x)
 Operates +=.
 
const Trajectoryoperator+= (const Trajectory &x)
 Operates +=.
 
const Trajectoryoperator-= (double x)
 Operates -=.
 
const Trajectoryoperator-= (const Trajectory &x)
 Operates -=.
 
const Trajectoryoperator*= (double x)
 Operates *=.
 
const Trajectoryoperator*= (const Trajectory &x)
 Operates *=.
 
const Trajectoryoperator/= (double x)
 Operates /=.
 
const Trajectoryoperator/= (const Trajectory &x)
 Operates /=.
 
const std::string class_name () const
 Returns the name of this class.
 
- Public Member Functions inherited from codac::DynamicalItem
virtual ~DynamicalItem ()
 DynamicalItem destructor.
 

Additional Inherited Members

- Static Public Member Functions inherited from codac::DynamicalItem
static bool valid_tdomain (const Interval &tdomain)
 Verifies that this interval is a feasible tdomain.
 
- Protected Member Functions inherited from codac::Trajectory
const IntervalVector codomain_box () const
 Returns the box \(x([t_0,t_f])\).
 
void compute_codomain ()
 Computes the envelope of trajectory values.
 
- Protected Attributes inherited from codac::Trajectory
Interval m_tdomain = Interval::EMPTY_SET
 temporal domain \([t_0,t_f]\) of the trajectory
 
Interval m_codomain = Interval::EMPTY_SET
 envelope of the values of the trajectory
 
TrajDefnType m_traj_def_type = TrajDefnType::MAP_OF_VALUES
 definition type
 
TFunction * m_function = nullptr
 optional pointer to the analytic expression of this trajectory
 
std::map< double, double > m_map_values
 optional map of values <t,y>: \(x(t)=y\)
 

Detailed Description

One dimensional random trajectory \(x(\cdot)\), used to represent noises.

Constructor & Destructor Documentation

◆ RandTrajectory()

codac::RandTrajectory::RandTrajectory ( const Interval & tdomain,
double timestep,
const Interval & bounds )

Creates a scalar trajectory \(x(\cdot)\) made of random values.

Parameters
tdomaintemporal domain \([t_0,t_f]\)
timestepsampling value \(\delta\) for the temporal discretization (double)
boundsinterval range for random values

The documentation for this class was generated from the following file: