Skip to content
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

Notify user what vector/matrix size is expected for x0, u #768

Merged
merged 1 commit into from
Nov 4, 2022
Merged

Notify user what vector/matrix size is expected for x0, u #768

merged 1 commit into from
Nov 4, 2022

Conversation

mzaffalon
Copy link
Contributor

No description provided.

@mzaffalon
Copy link
Contributor Author

mzaffalon commented Nov 3, 2022

Replaces #761

Also, when u0 is a scalar, there is the error message reported here: #761 (comment).

One question: I see that u is defined to be an AbstractVecOrMat, but shouldn't u be a vector when there is explicit time dependence and a matrix otherwise? The same holds for x0.

One last thing: some files do not have a newline after the last line and Emacs works very hard to add one: sorry if such a change escaped my attention.

@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Merging #768 (c568888) into master (e82df22) will increase coverage by 0.67%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master     #768      +/-   ##
==========================================
+ Coverage   94.57%   95.25%   +0.67%     
==========================================
  Files           4        4              
  Lines         295      295              
==========================================
+ Hits          279      281       +2     
+ Misses         16       14       -2     
Impacted Files Coverage Δ
src/timeresp.jl 94.93% <66.66%> (+0.92%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@baggepinnen
Copy link
Member

For this method, u should always have time in the second dimension, we allow AbstractVectOrMat simply to be able to provide the error message for a vector telling the user what size of u is expected.

One last thing: some files do not have a newline after the last line and Emacs works very hard to add one: sorry if such a change escaped my attention.

Adding this newline is much less problematic since it doesn't change any existing code, so don't worry about hem :)

@baggepinnen baggepinnen merged commit 7029934 into JuliaControl:master Nov 4, 2022
@baggepinnen
Copy link
Member

Thanks for fixing up the PR, and also for fixing some of the docs :)

@mzaffalon mzaffalon deleted the lsim_error_msg branch November 4, 2022 07:04
@mzaffalon
Copy link
Contributor Author

For this method, u should always have time in the second dimension, we allow AbstractVectOrMat simply to be able to provide the error message for a vector telling the user what size of u is expected.

I assume you mean for discrete systems: continuous systems need a function that returns a vector with dimention nu. I was speaking about continuous systems, in particular https://github.com/JuliaControl/ControlSystems.jl/blob/master/src/timeresp.jl#L29. Would it not be easier to impose u be just a vector?

Why is x0 initialized with zeros(Bool)?

@baggepinnen
Copy link
Member

Would it not be easier to impose u be just a vector?

If it solves #769 then sure, sounds like a good idea.

Why is x0 initialized with zeros(Bool)?

To make sure we do not accidentally promote the state to a larger type than what is used for the system parameters. Nowadays we have ControlSystemsBase.numeric_type which could be used to initialize x0 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants