Skip to content

Commit

Permalink
Used another method to obtain the jacobian
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Dafarra committed Apr 19, 2024
1 parent 6eb0ae1 commit 71caa29
Showing 1 changed file with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -647,23 +647,20 @@ def get_full_output_function(
[(yz - average_com_yz) ** 2 for yz in com_yz_positions]
) / len(com_yz_positions)

com_yz_variability_function = cs.Function(
"com_yz_variability",
[link_length_multipliers_symbolic, link_densities_symbolic],
[com_yz_variability],
["link_length_multipliers", "link_densities"],
["com_yz_variability_length_sensitivity"],
com_yz_variability_jacobian = cs.jacobian(
com_yz_variability,
cs.vertcat(link_length_multipliers_symbolic, link_densities_symbolic),
)

jac = com_yz_variability_function.jacobian()
com_yz_variability_jacobian_function = cs.Function(
"com_yz_variability_jacobian",
[link_length_multipliers_symbolic, link_densities_symbolic],
[com_yz_variability_jacobian],
{"error_on_fail": False},
)

test = jac(
parametric_link_length_multipliers,
parametric_link_densities,
com_yz_variability_function(
parametric_link_length_multipliers,
parametric_link_densities,
),
test = com_yz_variability_jacobian_function(
parametric_link_length_multipliers, parametric_link_densities
)

print(test)

0 comments on commit 71caa29

Please sign in to comment.