I'm trying to use FirstOrderTaylorExpansion to get linearized dynamics for Direct Shooting.
My current code is this: enter image description here
Cropped line:
coeffs = FirstOrderTaylorApproximation(system, context, [drone.get_actuation_input_port(),input_port_index], [drone.get_state_output_port(), output_port_index])
I also tried FirstOrderTaylorApproximation(system, context, input_port_index, output_port_index)
The error I keep getting is: enter image description here
Update: Issue resolved from Russ's previous answer! The new issue I am getting is enter image description here. I'm not sure how to choose a new subsystem context, and I tried using that function with an input of context (as defined in my code), but it did not work.