dymoesco.dynamics.singleintegrator.SingleIntegrator

class dymoesco.dynamics.singleintegrator.SingleIntegrator(dim=1)

Bases: dymoesco.dynamics.dynamic_model.ContinuousDynamicModel, dymoesco.dynamics.statespace_model.Rn

__init__(dim=1)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__([dim])

Initialize self.

animate(traj[, dim1, dim2, tail_len, ax])

discretize(dt)

f(x, u)

General dynamics function which is called in code.

g(x)

General observation function which is called in code.

gui(key_to_u_map, x0[, dim1, dim2])

gui for Rn statespace models.

plot(traj[, attr, ax])

traj needs to be a Trajectory object (or a dictionary with t and the requested attribute (x,y or u)).

plot_phase(traj[, dim1, dim2, ax, color])

plotu(traj[, ax])

plotx(traj[, ax])

ploty(traj[, ax])

simulate(u, t_span, x0[, t_eval])

simulate calls solve_ivp and returns a Trajectory object.

f(x, u)

General dynamics function which is called in code.

f adds some boiletplate around _f(), such as adding the noise to make the dynamical system stochastic: \(\dot{x} = f(x,u) = _f(x,u) + \epsilon\). In most cases only f will not need to be overridden.

g(x)

General observation function which is called in code.

f adds some boiletplate around _f(), such as adding the noise to make the dynamical system stochastic: \(\dot{x} = f(x,u) = _f(x,u) + \epsilon\). In most cases only f will not need to be overridden. In some special cases an observation model implementation might be complicated enough to warranty overriding g. See dymoesco.dynamics.diffdrive.DiffDrive.g() for an example.

gui(key_to_u_map, x0, dim1=0, dim2=1)

gui for Rn statespace models.

Starts an interactive gui for the dynamic_model in self, which is controlled using the arrows (which binding defined by key_to_u_map).

Parameters

key_to_u_map (dict) – key_to_u_map binds ‘up’, ‘down’, ‘right’, ‘left’ to controls.

Examples

key_to_u_map =  {'up': [0,1], 'down': [0,-1], 'right': [1,0], 'left': [-1,0]}

Notes

self needs to be a DiscreteDynamicModel.

plot(traj, attr='x', ax=None)

traj needs to be a Trajectory object (or a dictionary with t and the requested attribute (x,y or u)).

simulate(u, t_span, x0, t_eval=None)

simulate calls solve_ivp and returns a Trajectory object. u in the returned trajectory is the underlying noiseless trajectory. TODO: find a way to return the noisy trajectory? (get the u_noisy out of f).