Plotting

Plotting#

alg_plotter creates plots from an alg_sim_out trajectory (see Simulation).

class simulator.alg_plotter#

ALG_PLOTTER Plot trajectories of an algorithm execution

Constructor Summary
alg_plotter(sim_out)#

ALG_PLOTTER Construct a plotter for a trajectory

Parameters:

sim_out (alg_sim_out) – the trajectory from alg_sim

Property Summary
EQUALITY#

is an equality constraint used?

FS#

fontsize for axis labels

FST#

fontsize for title

sim_out#

data in the simulation

visible#

should the plot be shown?

Method Summary
add_opt_sig(reg_cl, dstar, fstar)#

ADD_OPT_SIG Use the optimal trajectory to define the error signals :param reg_cl: closed-loop regulator equation, output from regulator.check_regulator() :param dstar: properties of optimal solution \((-\beta^*, \hat{w}^*)\)

Return:

obj – the plotter

get_name(sig)#

GET_NAME the name of the signal in latex-formatted strings for use in y-axis labels

Parameters:

sig – the signal that is plotted

Return:

name – the title to use

get_title(sig)#

GET_TITLE get the title for the plot :param sig: the signal that is plotted

Return:

name – the title to use

plot(traces, fignum)#

PLOT multi-pane display

Parameters:
  • traces – signals to plot (e.g. {‘x’, ‘w’, ‘f’})

  • fignum – figure number to display

Returns:

fig – figure environment

plot_3_err(fignum)#

PLOT_3_err plot the error signals/regulated quantities (‘xerr’, ‘uerr’, ‘yerr’) :param fignum: figure number to display

Return:

fig – figure environment

plot_3_sq_err(fignum)#

PLOT_3_sq_err plot the squared error signals/regulated quantities (‘xerr’, ‘uerr’, ‘yerr’) :param fignum: figure number to display

Return:

fig – figure environment

plot_4(fignum)#

PLOT_4 plot the signals (‘w’, ‘res_w’, ‘z’,’res_z’) :param fignum: figure number to display

Return:

fig – figure environment

plot_4_err(fignum)#

PLOT_4_err plot the error signals/regulated quantities (‘xnerr’, ‘uerr’, ‘xcerr’, ‘yerr’) :param fignum: figure number to display

Return:

fig – figure environment

plot_4_sq_err(fignum)#

PLOT_4_sq_err plot the squared error signals/regulated quantities (‘sq_xnerr’, ‘sq_uerr’, ‘sq_xcerr’, ‘sq_yerr’) :param fignum: figure number to display

Return:

fig – figure environment

plot_4f_sq_err(fignum)#

PLOT_4f_sq_err plot the squared error signals/regulated quantities (‘sq_nerr’, ‘sq_uerr’, ‘ferr’, ‘sq_yerr’) :param fignum: figure number to display

Return:

fig – figure environment

plot_6(fignum)#

PLOT_6 plot the signals (‘xn’, ‘w’, ‘res_w’, ‘xc’, ‘z’,’res_z’) :param fignum: figure number to display

Return:

fig – figure environment

plot_6_err(fignum)#

PLOT_6_err plot the error signals/regulated quantities (‘xnerr’, ‘uerr’, ‘xcerr’, ‘yerr’, ‘werr’, ‘zerr’) :param fignum: figure number to display

Return:

fig – figure environment

plot_6_sq_err(fignum)#

PLOT_6_sq_err plot the squared error signals/regulated quantities (‘sq_werr’, ‘sq_xnerr’, ‘sq_uerr’, ‘sq_zerr’, ‘sq_xcerr’, ‘sq_yerr’) :param fignum: figure number to display

Return:

fig – figure environment

plot_6f(fignum)#

PLOT_6f plot the signals (‘x’, ‘w’, ‘res_w’, ‘f’, ‘z’,’res_z’) :param fignum: figure number to display

Return:

fig – figure environment

plot_6f_err(fignum)#

PLOT_6f_err plot the error signals/regulated quantities (‘xerr’, ‘uerr’, ‘ferr’, ‘yerr’, ‘werr’, ‘zerr’) :param fignum: figure number to display

Return:

fig – figure environment

plot_6f_sq_err(fignum)#

PLOT_6f_sq_err plot the squared error signals/regulated quantities (‘sq_werr’, ‘sq_xnerr’, ‘sq_uerr’, ‘sq_zerr’, ‘sq_xcerr’, ‘sq_yerr’) :param fignum: figure number to display

Return:

fig – figure environment

plot_tile(ax, sig)#

PLOT_TILE plot the signal ‘sig’ v.s. time :param ax: axis object in plot :param sig: the signal to use

Returns

ax: axis with the signal