Trajectory¶
In the module pyinduct.trajectory are some trajectory generators defined.
Besides you can find here a trivial (constant) input signal generator as
well as input signal generator for equilibrium to equilibrium transitions for
hyperbolic and parabolic systems.
-
class
ConstantTrajectory(const=0)[source]¶ Bases:
pyinduct.simulation.SimulationInputTrivial trajectory generator for a constant value as simulation input signal.
Parameters: const (numbers.Number) – Desired constant value of the output.
-
class
FlatString(y0, y1, z0, z1, t0, dt, params)[source]¶ Bases:
pyinduct.simulation.SimulationInputClass that implements a flatness based control approach for the “string with mass” model.
-
class
InterpTrajectory(t, u, show_plot=False)[source]¶ Bases:
pyinduct.simulation.SimulationInputProvides a system input through one-dimensional linear interpolation between the given vectors
and
.Parameters: - t (array_like) – Vector
with time steps. - u (array_like) – Vector
with function values, corresponding to the vector
. - show_plot (boolean) – A plot window with plot(t, u) will pop up if it is true.
- t (array_like) – Vector
-
class
RadTrajectory(l, T, param_original, bound_cond_type, actuation_type, n=80, sigma=1.1, K=2.0, show_plot=False)[source]¶ Bases:
pyinduct.trajectory.InterpTrajectoryClass that implements a flatness based control approach for the reaction-advection-diffusion equation

with the boundary condition
bound_cond_type == "dirichlet":
- A transition from
to
is considered. - With
where
is the flat output.
- A transition from
bound_cond_type == "robin":
- A transition from
to
is considered. - With
where
is the flat output.
- A transition from
and the actuation
actuation_type == "dirichlet":
actuation_type == "robin":
.
The flat output
will calculated with gevrey_tanh().
-
class
SignalGenerator(waveform, t, scale=1, offset=0, **kwargs)[source]¶ Bases:
pyinduct.trajectory.InterpTrajectorySignal generator that combines
scipy.signal.waveformsandInterpTrajectory.Parameters: - waveform (str) – A waveform which is provided from
scipy.signal.waveforms. - t (array_like) – Array with time steps or
pyinduct.simulation.Domaininstance. - scale (numbers.Number) – Scale factor: output = waveform_output*scale + offset.
- offset (numbers.Number) – Offset value: output = waveform_output*scale + offset.
- kwargs – The corresponding keyword arguments to the desired
scipy.signalwaveform. In addition to the kwargs of the desired waveform function from scipy.signal (which will simply forwarded) the keyword argumentsfrequency(for waveforms: ‘sawtooth’ and ‘square’) andphase_shift(for all waveforms) provided.
- waveform (str) – A waveform which is provided from
-
class
SmoothTransition(states, interval, method, differential_order=0)[source]¶ Bases:
objectA smooth transition between two given steady-states states on an interval using either: polynomial method trigonometric method
To create smooth transitions.
Parameters: - states (tuple) – States at beginning and end of interval.
- interval (tuple) – Time interval.
- method (str) – Method to use (
polyortanh). - differential_order (int) – Grade of differential flatness
.
-
coefficient_recursion(c0, c1, param)[source]¶ Return to the recursion

with initial values
![c_0 = numpy.array([c_0^{(0)}, ... , c_0^{(N)}]) \\
c_1 = numpy.array([c_1^{(0)}, ... , c_1^{(N)}])](../_images/math/1299856277d293591d1f37009eec60904da350c1.png)
as much as computable subsequent coefficients
![c_2 = numpy.array&([c_2^{(0)}, ... , c_2^{(N-1)}]) \\
c_3 = numpy.array&([c_3^{(0)}, ... , c_3^{(N-1)}]) \\
&\vdots \\
c_{2N-1} = numpy.array&([c_{2N-1}^{(0)}]) \\
c_{2N} = numpy.array&([c_{2N}^{(0)}])](../_images/math/865d1104dc901d9666b26f103bba2774dede85c9.png)
Parameters: - c0 (array_like) –

- c1 (array_like) –

- param (array_like) – (a_2, a_1, a_0, None, None)
Returns: 
Return type: dict
- c0 (array_like) –
-
gevrey_tanh(T, n, sigma=1.1, K=2.0)[source]¶ Provide Gevrey function

with the Gevrey-order
and the derivatives up to order n.Note
For details of the recursive calculation of the derivatives see:
Rudolph, J., J. Winkler und F. Woittennek: Flatness Based Control of Distributed Parameter Systems: Examples and Computer Exercises from Various Technological Domains (Berichte aus der Steuerungs- und Regelungstechnik). Shaker Verlag GmbH, Germany, 2003.Parameters: - T (numbers.Number) – End of the time domain=[0,T].
- n (int) – The derivatives will calculated up to order n.
- sigma (numbers.Number) – Constant
to adjust the Gevrey order
of
. - K (numbers.Number) – Constant to adust the slope of
.
Returns: (numpy.array([[
], ... ,[
]]), numpy.array([0,...,T])Return type: tuple
-
power_series(z, t, C, spatial_der_order=0, temporal_der_order=0)[source]¶ Compute the function values

Parameters: - z (array_like) – Spatial steps to compute.
- t (array like) – Temporal steps to compute.
- C (dict) –
Coeffient dictionary which keys correspond to the coefficient index. The values are 2D numpy.array’s. For example C[1] should provide a 2d-array with the coefficient
and at least
temporal derivatives![\text{np.array}([c_1^{(0)}(t), ... , c_1^{(i)}(t)]).](../_images/math/d3898a6ed5cc4c88bbd036cee583dda6f6cdc9e6.png)
- spatial_der_order (int) – Spatial derivative order
. - temporal_der_order (int) – Temporal derivative order
.
Returns: Array of shape (len(t), len(z)).
Return type: numpy.array
-
temporal_derived_power_series(z, C, up_to_order, series_termination_index, spatial_der_order=0)[source]¶ Compute the temporal derivatives
![q^{(j,i)}(z=z^*,t) = \sum_{k=0}^{N} \underbrace{c_{k+j}^{(i)}}_{\text{C[k+j][i,:]}} \frac{{z^*}^k}{k!}, \qquad i=0,...,n.](../_images/math/98eb9ae85cbfe887e1e6a2238d86fd0088d879d9.png)
Parameters: - z (numbers.Number) – Evaluation point
. - C (dict) –
Coeffient dictionary which keys correspond to the coefficient index. The values are 2D numpy.array’s. For example C[1] should provide a 2d-array with the coefficient
and at least
temporal derivatives![\text{np.array}([c_1^{(0)}(t), ... , c_1^{(i)}(t)]).](../_images/math/d3898a6ed5cc4c88bbd036cee583dda6f6cdc9e6.png)
- up_to_order (int) – Max. temporal derivative order
to compute. - series_termination_index (int) – Series termination index
. - spatial_der_order (int) – Spatial derivativ order
.
Returns: numpy.array( [
] )- z (numbers.Number) – Evaluation point