线性化(Docstrings)#

class sympy.physics.mechanics.linearize.Linearizer(f_0, f_1, f_2, f_3, f_4, f_c, f_v, f_a, q, u, q_i=None, q_d=None, u_i=None, u_d=None, r=None, lams=None, linear_solver='LU')[源代码]#

This object holds the general model form for a dynamic system. This model is used for computing the linearized form of the system, while properly dealing with constraints leading to dependent coordinates and speeds. The notation and method is described in [R739].

工具书类

[R739] (1,2)

D. L. Peterson, G. Gede, and M. Hubbard, "Symbolic linearization of equations of motion of constrained multibody systems," Multibody Syst Dyn, vol. 33, no. 2, pp. 143-161, Feb. 2015, doi: 10.1007/s11044-014-9436-5.

属性

f_0、f_1、f_2、f_3、f_4、f_c、f_v、f_a

(矩阵)保持一般系统形式的矩阵。

q、 u,r

(矩阵)保存广义坐标、速度和输入向量的矩阵。

我,你,我

(矩阵)独立广义坐标和速度的矩阵。

你,你

(矩阵)相关广义坐标和速度的矩阵。

perm_mat

(矩阵)排列矩阵使得 [q_ind, u_ind] ^T=烫发垫* [q, u] ^T

__init__(f_0, f_1, f_2, f_3, f_4, f_c, f_v, f_a, q, u, q_i=None, q_d=None, u_i=None, u_d=None, r=None, lams=None, linear_solver='LU')[源代码]#
参数:

f_0, f_1, f_2, f_3, f_4, f_c, f_v, f_a : array_like

System of equations holding the general system form. Supply empty array or Matrix if the parameter does not exist.

q : array_like

The generalized coordinates.

u : array_like

The generalized speeds

q_i, u_i : array_like, optional

独立的广义坐标和速度。

q_d, u_d : array_like, optional

相关的广义坐标和速度。

r : array_like, optional

The input variables.

lams : array_like, optional

The lagrange multipliers

linear_solver : str, callable

Method used to solve the several symbolic linear systems of the form A*x=b in the linearization process. If a string is supplied, it should be a valid method that can be used with the sympy.matrices.matrixbase.MatrixBase.solve(). If a callable is supplied, it should have the format x = f(A, b), where it solves the equations and returns the solution. The default is 'LU' which corresponds to SymPy's A.LUsolve(b). LUsolve() is fast to compute but will often result in divide-by-zero and thus nan results.

linearize(op_point=None, A_and_B=False, simplify=False)[源代码]#

将系统线性化,使其与工作点有关。注意,q_uop,u_uop,qd_uop,ud_uop必须满足运动方程。这些可能是符号或数字。

参数:

op_point :dict或iterable of dicts,可选

Dictionary or iterable of dictionaries containing the operating point conditions for all or a subset of the generalized coordinates, generalized speeds, and time derivatives of the generalized speeds. These will be substituted into the linearized system before the linearization is complete. Leave set to None if you want the operating point to be an arbitrary set of symbols. Note that any reduction in symbols (whether substituted for numbers or expressions with a common parameter) will result in faster runtime.

A_and_B :bool,可选

If A_and_B=False (default), (M, A, B) is returned and of A_and_B=True, (A, B) is returned. See below.

简化 :bool,可选

确定是否在返回之前简化返回值。对于大型表达式,这可能很耗时。默认值为False。

返回:

M, A, B : Matrices, A_and_B=False

Matrices from the implicit form:

[M]*[q', u']^T = [A]*[q_ind, u_ind]^T + [B]*r

A, B : Matrices, A_and_B=True

Matrices from the explicit form:

[q_ind', u_ind']^T = [A]*[q_ind, u_ind]^T + [B]*r

笔记

注意,如果有许多符号参数,用A_和_B=True求解的过程是计算密集型的。出于这个原因,使用默认的A_和_B=False,返回M、A和B可能更可取。随后可以在这些矩阵中替换更多的值。状态空间形式可以找到A=P.T M.LUsolve(A), B = P.T M、 LUsolve(B),其中P=线性化器.