Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Various docstring edits + fixed plot legends on cruise control example#643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
murrayrm merged 7 commits intopython-control:masterfrombasicmachines:master
Aug 7, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletionscontrol/bdalg.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -263,7 +263,7 @@ def append(*sys):

Parameters
----------
sys1, sys2, ..., sysn: StateSpace orTransferfunction
sys1, sys2, ..., sysn: StateSpace orTransferFunction
LTI systems to combine


Expand All@@ -275,7 +275,7 @@ def append(*sys):

Examples
--------
>>> sys1 = ss([[1., -2], [3., -4]], [[5.], [7]]", [[6., 8]], [[9.]])
>>> sys1 = ss([[1., -2], [3., -4]], [[5.], [7]], [[6., 8]], [[9.]])
>>> sys2 = ss([[-1.]], [[1.]], [[1.]], [[0.]])
>>> sys = append(sys1, sys2)

Expand All@@ -299,7 +299,7 @@ def connect(sys, Q, inputv, outputv):

Parameters
----------
sys : StateSpaceTransferfunction
sys : StateSpaceor TransferFunction
System to be connected
Q : 2D array
Interconnection matrix. First column gives the input to be connected.
Expand Down
12 changes: 6 additions & 6 deletionscontrol/iosys.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -131,7 +131,7 @@ def __init__(self, inputs=None, outputs=None, states=None, params={},
name=None, **kwargs):
"""Create an input/output system.

The InputOutputSystemcontructor is used to create an input/output
The InputOutputSystemconstructor is used to create an input/output
object with the core information required for all input/output
systems. Instances of this class are normally created by one of the
input/output subclasses: :class:`~control.LinearICSystem`,
Expand DownExpand Up@@ -661,7 +661,7 @@ def copy(self, newname=None):
class LinearIOSystem(InputOutputSystem, StateSpace):
"""Input/output representation of a linear (state space) system.

This class is used toimplementat a system that is a linear state
This class is used toimplement a system that is a linear state
space system (defined by the StateSpace system object).

Parameters
Expand DownExpand Up@@ -1675,7 +1675,7 @@ def find_eqpt(sys, x0, u0=[], y0=None, t=0, params={},
return_y=False, return_result=False, **kw):
"""Find the equilibrium point for an input/output system.

Returns the value of anequlibrium point given the initial state and
Returns the value of anequilibrium point given the initial state and
either input value or desired output value for the equilibrium point.

Parameters
Expand DownExpand Up@@ -1926,15 +1926,15 @@ def linearize(sys, xeq, ueq=[], t=0, params={}, **kw):

This function computes the linearization of an input/output system at a
given state and input value and returns a :class:`~control.StateSpace`
object. Theeavaluation point need not be an equilibrium point.
object. Theevaluation point need not be an equilibrium point.

Parameters
----------
sys : InputOutputSystem
The system to be linearized
xeq : array
The state at which the linearization will be evaluated (does not need
to be anequlibrium state).
to be anequilibrium state).
ueq : array
The input at which the linearization will be evaluated (does not need
to correspond to an equlibrium state).
Expand DownExpand Up@@ -2055,7 +2055,7 @@ def interconnect(syslist, connections=None, inplist=[], outlist=[],
('sys', 'sig') are also recognized.

Similarly, each output-spec should describe an output signal from one
of thesusystems. The lowest level representation is a tuple of the
of thesubsystems. The lowest level representation is a tuple of the
form `(subsys_i, out_j, gain)`. The input will be constructed by
summing the listed outputs after multiplying by the gain term. If the
gain term is omitted, it is assumed to be 1. If the system has a
Expand Down
24 changes: 12 additions & 12 deletionscontrol/optimal.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,7 @@ class OptimalControlProblem():
"""Description of a finite horizon, optimal control problem.

The `OptimalControlProblem` class holds all of the information required to
specifyand optimal control problem: the system dynamics, cost function,
specifyan optimal control problem: the system dynamics, cost function,
and constraints. As much as possible, the information used to specify an
optimal control problem matches the notation and terminology of the SciPy
`optimize.minimize` module, with the hope that this makes it easier to
Expand DownExpand Up@@ -94,13 +94,13 @@ class OptimalControlProblem():
The `_cost_function` method takes the information computes the cost of the
trajectory generated by the proposed input. It does this by calling a
user-defined function for the integral_cost given the current states and
inputs at each point along thetrajetory and then adding the value of a
inputs at each point along thetrajectory and then adding the value of a
user-defined terminal cost at the final pint in the trajectory.

The `_constraint_function` method evaluates the constraint functions along
the trajectory generated by the proposed input. As in the case of the
cost function, the constraints are evaluated at the state and input along
each point on thetrjectory. This information is compared against the
each point on thetrajectory. This information is compared against the
constraint upper and lower bounds. The constraint function is processed
in the class initializer, so that it only needs to be computed once.

Expand DownExpand Up@@ -567,7 +567,7 @@ def _process_initial_guess(self, initial_guess):
#
# Initially guesses from the user are passed as input vectors as a
# function of time, but internally we store the guess in terms of the
# basis coefficients. We do this by solving a least squaresprobelm to
# basis coefficients. We do this by solving a least squaresproblem to
# find coefficients that match the input functions at the time points (as
# much as possible, if the problem is under-determined).
#
Expand DownExpand Up@@ -880,7 +880,7 @@ def solve_ocp(
Function that returns the terminal cost given the current state
and input. Called as terminal_cost(x, u).

terminal_constraint : list of tuples, optional
terminal_constraints : list of tuples, optional
List of constraints that should hold at the end of the trajectory.
Same format as `constraints`.

Expand DownExpand Up@@ -914,7 +914,7 @@ def solve_ocp(
res : OptimalControlResult
Bundle object with the results of the optimal control problem.

res.success: bool
res.success: bool
Boolean flag indicating whether the optimization was successful.

res.time : array
Expand DownExpand Up@@ -982,7 +982,7 @@ def create_mpc_iosystem(
Function that returns the terminal cost given the current state
and input. Called as terminal_cost(x, u).

terminal_constraint : list of tuples, optional
terminal_constraints : list of tuples, optional
List of constraints that should hold at the end of the trajectory.
Same format as `constraints`.

Expand All@@ -992,7 +992,7 @@ def create_mpc_iosystem(
Returns
-------
ctrl : InputOutputSystem
An I/O system taking thecurrrent state of the model system and
An I/O system taking thecurrent state of the model system and
returning the current input to be applied that minimizes the cost
function while satisfying the constraints.

Expand DownExpand Up@@ -1039,9 +1039,9 @@ def quadratic_cost(sys, Q, R, x0=0, u0=0):
R : 2D array_like
Weighting matrix for input cost. Dimensions must match system input.
x0 : 1D array
Nomimal value of the system state (for which cost should be zero).
Nominal value of the system state (for which cost should be zero).
u0 : 1D array
Nomimal value of the system input (for which cost should be zero).
Nominal value of the system input (for which cost should be zero).

Returns
-------
Expand DownExpand Up@@ -1082,7 +1082,7 @@ def quadratic_cost(sys, Q, R, x0=0, u0=0):
# As in the cost function evaluation, the main "trick" in creating a constrain
# on the state or input is to properly evaluate the constraint on the stacked
# state and input vector at the current time point. The constraint itself
# will be called at eachpoing along the trajectory (or the endpoint) via the
# will be called at eachpoint along the trajectory (or the endpoint) via the
# constrain_function() method.
#
# Note that these functions to not actually evaluate the constraint, they
Expand DownExpand Up@@ -1250,7 +1250,7 @@ def input_range_constraint(sys, lb, ub):
def output_poly_constraint(sys, A, b):
"""Create output constraint from polytope

Creates a linear constraint on the systemouput of the form A y <= b that
Creates a linear constraint on the systemoutput of the form A y <= b that
can be used as an optimal control constraint (trajectory or terminal).

Parameters
Expand Down
8 changes: 4 additions & 4 deletionscontrol/statefbk.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -277,9 +277,9 @@ def lqe(A, G, C, QN, RN, NN=None):

.. math:: x_e = A x_e + B u + L(y - C x_e - D u)

produces a state estimatethatx_e that minimizes the expected squared
errorusing the sensor measurements y. The noise cross-correlation `NN`
isset to zero when omitted.
produces a state estimate x_e that minimizes the expected squared error
using the sensor measurements y. The noise cross-correlation `NN` is
set to zero when omitted.

Parameters
----------
Expand DownExpand Up@@ -617,7 +617,7 @@ def gram(sys, type):
if type not in ['c', 'o', 'cf', 'of']:
raise ValueError("That type is not supported!")

# TODO: Check forcontinous or discrete, only continuous supported for now
# TODO: Check forcontinuous or discrete, only continuous supported for now
# if isCont():
# dico = 'C'
# elif isDisc():
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp