API reference · 11
Jacobian
Sparse rectangular matrices returned by differentiator.
Returned types
| Type | Created by | Layout |
|---|---|---|
firstOrderJacobian |
differentiator.diff1 with a vector-valued source |
Source components form rows; target attributes form columns. |
secondOrderJacobian |
differentiator.diff2 with different target lists |
First target list forms rows; second target list forms columns. |
Both types inherit the public sparse multiplication and storage API from matrix.
compute
compute()Generate any required kernels, assemble sparse coordinates, and update the numeric static and dynamic block values.
Example
previous_position_jacobian.compute()
young_jacobian.compute()
Returns: this jacobian.
spmv
spmv(x, transpose=False)Apply the assembled jacobian or its transpose to a compatible YASPS vector.
| Parameter | Type | Default | Description |
|---|---|---|---|
x |
compatible YASPS vector | required | Input vector matching the selected orientation. |
transpose |
bool |
False |
Apply the transpose when True. |
Example
young_gradient = young_gradient - young_jacobian.spmv(auxiliary, transpose=True)
Returns: compatible YASPS vector.
Addition
left + rightCombine jacobian terms with identical row and column layouts. The result retains every static and dynamic symbolic contribution.
Example
combined_jacobian = inertia_jacobian + friction_jacobian
Returns: combined jacobian of the same type.
Raises: ValueError when the target layouts differ; TypeError when the jacobian types are incompatible.
Properties
| Property | Type | Applies to | Description |
|---|---|---|---|
rows |
int |
both | Numeric row count. |
cols |
int |
both | Numeric column count. |
block_dimensions |
list[int] |
both | Static sparse block dimensions. |
block_counts |
list[int] |
both | Static block count per dimension category. |
block_dimensions_dynamic |
list[int] |
both | Dynamic sparse block dimensions. |
block_counts_dynamic |
list[int] |
both | Dynamic block count per dimension category. |
row_source |
attribute | first order | Vector-valued source whose components form the rows. |
wrt |
list[attribute] |
first order | Ordered column targets. |
row_wrt |
list[attribute] |
second order | Ordered row targets. |
column_wrt |
list[attribute] |
second order | Ordered column targets. |
row_start_indices |
list[int] |
second order | Cumulative row offsets for row_wrt. |
column_start_indices |
list[int] |
second order | Cumulative column offsets for column_wrt. |