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

Norminf refactor #242

Merged
merged 2 commits into from
Jan 5, 2020
Merged

Norminf refactor #242

merged 2 commits into from
Jan 5, 2020

Conversation

olof3
Copy link
Contributor

@olof3 olof3 commented Dec 11, 2019

The algorithms for continuous and discrete time are now closer to the cited papers, more readable, and also works for complex-coefficient systems. Many tests have been added.

It could be considered if it is worth to merge the algorithms for discrete and continuous time into one. One option to simplify this would be to consider actual frequencies and not normalized frequencies in the discrete-time formulation and define something like sigmamax(sys, w). But perhaps better to wait until there is dispatch on continuous and discrete time.

Another thing which could be discussed is the naming. I think L-infinity and H-infinity norms should be distinguished, in particular as the current function computes the L-infinity norm and most people are probably expecting that it is the H-infinity norm. So perhaps renaming the current function to linfnormand defining something like
hinfnorm(sys) = isstable(sys) ? linfnorm(sys) : Inf

Switching the naming of norminf to (h/l)infnorm is consistent with opnorm etc. and seems easier to say and remember.

@coveralls
Copy link

coveralls commented Dec 11, 2019

Coverage Status

Coverage decreased (-0.3%) to 57.767% when pulling e74749d on olof3:norminf_refactor into 090d0ae on JuliaControl:master.

@mfalt mfalt added this to the 0.5.5 milestone Dec 19, 2019
@olof3
Copy link
Contributor Author

olof3 commented Dec 19, 2019

@mfalt was also supportive of having hinfnorm and linfnorm instead of norminf so that has been implemented, and norminf has been deprecated.

Instead of defining hinfnorm(sys) = isstable(sys) ? linfnorm(sys) : Inf
I went with the following solution, again after some discussion with @mfalt

function hinfnorm(sys::AbstractStateSpace; tol=1e-6)
if iscontinuous(sys)
         _infnorm_two_steps_ct(sys, :hinf, tol)
    else
        return _infnorm_two_steps_dt(sys, :hinf, tol)
     end
end
end

and then having _infnorm_two_steps_dt depend on if :hinf or :linf is passed as an argument. This avoids re-computation of poles and that the peak gain for marginally stable systems can be returned without duplicating code. These advantages seem to slightly outweigh the worse separation of functionality.

This was referenced Dec 30, 2019
@mfalt mfalt merged commit e74749d into JuliaControl:master Jan 5, 2020
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.

3 participants