-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linear Model Type #7
Conversation
…ab/RobotDynamics.jl into linear_model new changes from master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is really close. I'd like to clean up the linearization/discretization methods.
I think it may also be a good idea to have a simple AbstractLinearModel
that both LinearizedModel
and LinearModel
inherit from, just so you can easily cover both with a single dispatch, since they are nearly identical in practice.
src/linearization.jl
Outdated
@assert is_timevarying(model.linmodel) == true | ||
@assert get_times(trajectory) == (model.linmodel.times) | ||
|
||
if is_timevarying(model.linmodel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is redundant given your previous assertion that it is time-varying
src/linearization.jl
Outdated
|
||
Linearize `nonlinear_model` about `trajectory` and discretize with given integration type `Q`. Returns a [`LinearizedModel`](@ref) | ||
""" | ||
function linearize_and_discretize(::Type{Q}, nonlinear_model::AbstractModel, trajectory::AbstractTrajectory; is_affine=false) where {Q<:Explicit} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simplify these methods to an interface similar to LinearModel
? I think it would make sense to have a powerful LinearizedModel
constructor that handles continuous/discrete, affine/non-affine, and then have an update_reference!(model, Z)
that re-linearized the model about the updated reference trajectory Z
(could be a single KnotPoint
).
I agree that it could be nice to have an |
This PR adds the
LinearModel
type, as well as aLinearizedModel
type useful for linearizing a nonlinear model.