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

Commit6b7a9c7

Browse files
authored
Merge pull request#643 from basicmachines/master
Various docstring edits + fixed plot legends on cruise control example
2 parentsda27d35 +cc97f4b commit6b7a9c7

File tree

7 files changed

+157
-142
lines changed

7 files changed

+157
-142
lines changed

‎control/bdalg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def append(*sys):
263263
264264
Parameters
265265
----------
266-
sys1, sys2, ..., sysn: StateSpace orTransferfunction
266+
sys1, sys2, ..., sysn: StateSpace orTransferFunction
267267
LTI systems to combine
268268
269269
@@ -275,7 +275,7 @@ def append(*sys):
275275
276276
Examples
277277
--------
278-
>>> sys1 = ss([[1., -2], [3., -4]], [[5.], [7]]", [[6., 8]], [[9.]])
278+
>>> sys1 = ss([[1., -2], [3., -4]], [[5.], [7]], [[6., 8]], [[9.]])
279279
>>> sys2 = ss([[-1.]], [[1.]], [[1.]], [[0.]])
280280
>>> sys = append(sys1, sys2)
281281
@@ -299,7 +299,7 @@ def connect(sys, Q, inputv, outputv):
299299
300300
Parameters
301301
----------
302-
sys : StateSpaceTransferfunction
302+
sys : StateSpaceor TransferFunction
303303
System to be connected
304304
Q : 2D array
305305
Interconnection matrix. First column gives the input to be connected.

‎control/iosys.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def __init__(self, inputs=None, outputs=None, states=None, params={},
131131
name=None,**kwargs):
132132
"""Create an input/output system.
133133
134-
The InputOutputSystemcontructor is used to create an input/output
134+
The InputOutputSystemconstructor is used to create an input/output
135135
object with the core information required for all input/output
136136
systems. Instances of this class are normally created by one of the
137137
input/output subclasses: :class:`~control.LinearICSystem`,
@@ -661,7 +661,7 @@ def copy(self, newname=None):
661661
classLinearIOSystem(InputOutputSystem,StateSpace):
662662
"""Input/output representation of a linear (state space) system.
663663
664-
This class is used toimplementat a system that is a linear state
664+
This class is used toimplement a system that is a linear state
665665
space system (defined by the StateSpace system object).
666666
667667
Parameters
@@ -1675,7 +1675,7 @@ def find_eqpt(sys, x0, u0=[], y0=None, t=0, params={},
16751675
return_y=False,return_result=False,**kw):
16761676
"""Find the equilibrium point for an input/output system.
16771677
1678-
Returns the value of anequlibrium point given the initial state and
1678+
Returns the value of anequilibrium point given the initial state and
16791679
either input value or desired output value for the equilibrium point.
16801680
16811681
Parameters
@@ -1926,15 +1926,15 @@ def linearize(sys, xeq, ueq=[], t=0, params={}, **kw):
19261926
19271927
This function computes the linearization of an input/output system at a
19281928
given state and input value and returns a :class:`~control.StateSpace`
1929-
object. Theeavaluation point need not be an equilibrium point.
1929+
object. Theevaluation point need not be an equilibrium point.
19301930
19311931
Parameters
19321932
----------
19331933
sys : InputOutputSystem
19341934
The system to be linearized
19351935
xeq : array
19361936
The state at which the linearization will be evaluated (does not need
1937-
to be anequlibrium state).
1937+
to be anequilibrium state).
19381938
ueq : array
19391939
The input at which the linearization will be evaluated (does not need
19401940
to correspond to an equlibrium state).
@@ -2055,7 +2055,7 @@ def interconnect(syslist, connections=None, inplist=[], outlist=[],
20552055
('sys', 'sig') are also recognized.
20562056
20572057
Similarly, each output-spec should describe an output signal from one
2058-
of thesusystems. The lowest level representation is a tuple of the
2058+
of thesubsystems. The lowest level representation is a tuple of the
20592059
form `(subsys_i, out_j, gain)`. The input will be constructed by
20602060
summing the listed outputs after multiplying by the gain term. If the
20612061
gain term is omitted, it is assumed to be 1. If the system has a

‎control/optimal.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class OptimalControlProblem():
2525
"""Description of a finite horizon, optimal control problem.
2626
2727
The `OptimalControlProblem` class holds all of the information required to
28-
specifyand optimal control problem: the system dynamics, cost function,
28+
specifyan optimal control problem: the system dynamics, cost function,
2929
and constraints. As much as possible, the information used to specify an
3030
optimal control problem matches the notation and terminology of the SciPy
3131
`optimize.minimize` module, with the hope that this makes it easier to
@@ -94,13 +94,13 @@ class OptimalControlProblem():
9494
The `_cost_function` method takes the information computes the cost of the
9595
trajectory generated by the proposed input. It does this by calling a
9696
user-defined function for the integral_cost given the current states and
97-
inputs at each point along thetrajetory and then adding the value of a
97+
inputs at each point along thetrajectory and then adding the value of a
9898
user-defined terminal cost at the final pint in the trajectory.
9999
100100
The `_constraint_function` method evaluates the constraint functions along
101101
the trajectory generated by the proposed input. As in the case of the
102102
cost function, the constraints are evaluated at the state and input along
103-
each point on thetrjectory. This information is compared against the
103+
each point on thetrajectory. This information is compared against the
104104
constraint upper and lower bounds. The constraint function is processed
105105
in the class initializer, so that it only needs to be computed once.
106106
@@ -567,7 +567,7 @@ def _process_initial_guess(self, initial_guess):
567567
#
568568
# Initially guesses from the user are passed as input vectors as a
569569
# function of time, but internally we store the guess in terms of the
570-
# basis coefficients. We do this by solving a least squaresprobelm to
570+
# basis coefficients. We do this by solving a least squaresproblem to
571571
# find coefficients that match the input functions at the time points (as
572572
# much as possible, if the problem is under-determined).
573573
#
@@ -880,7 +880,7 @@ def solve_ocp(
880880
Function that returns the terminal cost given the current state
881881
and input. Called as terminal_cost(x, u).
882882
883-
terminal_constraint : list of tuples, optional
883+
terminal_constraints : list of tuples, optional
884884
List of constraints that should hold at the end of the trajectory.
885885
Same format as `constraints`.
886886
@@ -914,7 +914,7 @@ def solve_ocp(
914914
res : OptimalControlResult
915915
Bundle object with the results of the optimal control problem.
916916
917-
res.success: bool
917+
res.success: bool
918918
Boolean flag indicating whether the optimization was successful.
919919
920920
res.time : array
@@ -982,7 +982,7 @@ def create_mpc_iosystem(
982982
Function that returns the terminal cost given the current state
983983
and input. Called as terminal_cost(x, u).
984984
985-
terminal_constraint : list of tuples, optional
985+
terminal_constraints : list of tuples, optional
986986
List of constraints that should hold at the end of the trajectory.
987987
Same format as `constraints`.
988988
@@ -992,7 +992,7 @@ def create_mpc_iosystem(
992992
Returns
993993
-------
994994
ctrl : InputOutputSystem
995-
An I/O system taking thecurrrent state of the model system and
995+
An I/O system taking thecurrent state of the model system and
996996
returning the current input to be applied that minimizes the cost
997997
function while satisfying the constraints.
998998
@@ -1039,9 +1039,9 @@ def quadratic_cost(sys, Q, R, x0=0, u0=0):
10391039
R : 2D array_like
10401040
Weighting matrix for input cost. Dimensions must match system input.
10411041
x0 : 1D array
1042-
Nomimal value of the system state (for which cost should be zero).
1042+
Nominal value of the system state (for which cost should be zero).
10431043
u0 : 1D array
1044-
Nomimal value of the system input (for which cost should be zero).
1044+
Nominal value of the system input (for which cost should be zero).
10451045
10461046
Returns
10471047
-------
@@ -1082,7 +1082,7 @@ def quadratic_cost(sys, Q, R, x0=0, u0=0):
10821082
# As in the cost function evaluation, the main "trick" in creating a constrain
10831083
# on the state or input is to properly evaluate the constraint on the stacked
10841084
# state and input vector at the current time point. The constraint itself
1085-
# will be called at eachpoing along the trajectory (or the endpoint) via the
1085+
# will be called at eachpoint along the trajectory (or the endpoint) via the
10861086
# constrain_function() method.
10871087
#
10881088
# Note that these functions to not actually evaluate the constraint, they
@@ -1250,7 +1250,7 @@ def input_range_constraint(sys, lb, ub):
12501250
defoutput_poly_constraint(sys,A,b):
12511251
"""Create output constraint from polytope
12521252
1253-
Creates a linear constraint on the systemouput of the form A y <= b that
1253+
Creates a linear constraint on the systemoutput of the form A y <= b that
12541254
can be used as an optimal control constraint (trajectory or terminal).
12551255
12561256
Parameters

‎control/statefbk.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ def lqe(A, G, C, QN, RN, NN=None):
277277
278278
.. math:: x_e = A x_e + B u + L(y - C x_e - D u)
279279
280-
produces a state estimatethatx_e that minimizes the expected squared
281-
errorusing the sensor measurements y. The noise cross-correlation `NN`
282-
isset to zero when omitted.
280+
produces a state estimate x_e that minimizes the expected squared error
281+
using the sensor measurements y. The noise cross-correlation `NN` is
282+
set to zero when omitted.
283283
284284
Parameters
285285
----------
@@ -617,7 +617,7 @@ def gram(sys, type):
617617
iftypenotin ['c','o','cf','of']:
618618
raiseValueError("That type is not supported!")
619619

620-
# TODO: Check forcontinous or discrete, only continuous supported for now
620+
# TODO: Check forcontinuous or discrete, only continuous supported for now
621621
# if isCont():
622622
# dico = 'C'
623623
# elif isDisc():

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp