From 5360a25f972a94fb92ce2d038224a541553601cb Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Fri, 15 Dec 2023 06:23:57 +0100 Subject: [PATCH 01/13] Fix Bode plot with zero magnitude Closes #438 --- lib/ControlSystemsBase/src/plotting.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ControlSystemsBase/src/plotting.jl b/lib/ControlSystemsBase/src/plotting.jl index e4f62ea0c..667567266 100644 --- a/lib/ControlSystemsBase/src/plotting.jl +++ b/lib/ControlSystemsBase/src/plotting.jl @@ -292,9 +292,11 @@ end else sbal = s end - mag, phase = bode(sbal, w; unwrap=false)[1:2] + mag, phase = bode(sbal, w; unwrap=false) if _PlotScale == "dB" # Set by setPlotScale(str) globally mag = 20*log10.(mag) + elseif 0 ∈ mag + replace!(mag, 0 => -Inf) # To prevent plot crashing when some magnitude is exactly zero end xlab = plotphase ? "" : (hz ? "Frequency [Hz]" : "Frequency [rad/s]") From e02bf36b557be97f8d9a95bb46fcc5077a565674 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Fri, 15 Dec 2023 07:17:55 +0100 Subject: [PATCH 02/13] Make tests pass on Julia nightly --- lib/ControlSystemsBase/test/test_statespace.jl | 6 +++++- lib/ControlSystemsBase/test/test_transferfunction.jl | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/ControlSystemsBase/test/test_statespace.jl b/lib/ControlSystemsBase/test/test_statespace.jl index b31f1716a..38b12b065 100644 --- a/lib/ControlSystemsBase/test/test_statespace.jl +++ b/lib/ControlSystemsBase/test/test_statespace.jl @@ -98,7 +98,11 @@ @test C_111 .* C_222 == ss([-5 0 2 0; 0 -5 0 2; 0 0 -5 -3; 0 0 2 -9], [0 0; 0 0; 1 0; 0 2], [3 0 0 0; 0 3 0 0], 0) @test Ref(ss(1)) .* [C_111, C_111] == [C_111, C_111] - @test_broken @inferred C_111 * C_221 + if version >= v"1.10.0-rc2" + @inferred C_111 * C_221 + else + @test_broken @inferred C_111 * C_221 + end @test_broken @inferred C_111 .* I(2) C_111_d = ssrand(1,1,2) diff --git a/lib/ControlSystemsBase/test/test_transferfunction.jl b/lib/ControlSystemsBase/test/test_transferfunction.jl index defd40b0a..7bc2f80c9 100644 --- a/lib/ControlSystemsBase/test/test_transferfunction.jl +++ b/lib/ControlSystemsBase/test/test_transferfunction.jl @@ -103,7 +103,11 @@ tf(vecarray(1, 2, [0], [0]), vecarray(1, 2, [1], [1]), 0.005) @test minreal(C_111.*C_222 - C_222.*C_111, 1e-3) == tf(ss(0*I(2))) # scalar times MIMO @test C_111 .* C_222 == (C_111 .* I(2)) * C_222 -@test_broken @inferred C_111 .* I(2) +if version >= v"1.10.0-rc2" + @inferred C_111 .* I(2) +else + @test_broken @inferred C_111 .* I(2) +end C_111_d = tf(ssrand(1,1,2)) M = ones(2,2) From 4d41ddcb1cd067a7add69f169603dc3787daa316 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Fri, 15 Dec 2023 07:21:28 +0100 Subject: [PATCH 03/13] typo --- lib/ControlSystemsBase/test/test_statespace.jl | 2 +- lib/ControlSystemsBase/test/test_transferfunction.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ControlSystemsBase/test/test_statespace.jl b/lib/ControlSystemsBase/test/test_statespace.jl index 38b12b065..c4600a43a 100644 --- a/lib/ControlSystemsBase/test/test_statespace.jl +++ b/lib/ControlSystemsBase/test/test_statespace.jl @@ -98,7 +98,7 @@ @test C_111 .* C_222 == ss([-5 0 2 0; 0 -5 0 2; 0 0 -5 -3; 0 0 2 -9], [0 0; 0 0; 1 0; 0 2], [3 0 0 0; 0 3 0 0], 0) @test Ref(ss(1)) .* [C_111, C_111] == [C_111, C_111] - if version >= v"1.10.0-rc2" + if VERSION >= v"1.10.0-rc1" @inferred C_111 * C_221 else @test_broken @inferred C_111 * C_221 diff --git a/lib/ControlSystemsBase/test/test_transferfunction.jl b/lib/ControlSystemsBase/test/test_transferfunction.jl index 7bc2f80c9..eee3bdec8 100644 --- a/lib/ControlSystemsBase/test/test_transferfunction.jl +++ b/lib/ControlSystemsBase/test/test_transferfunction.jl @@ -103,7 +103,7 @@ tf(vecarray(1, 2, [0], [0]), vecarray(1, 2, [1], [1]), 0.005) @test minreal(C_111.*C_222 - C_222.*C_111, 1e-3) == tf(ss(0*I(2))) # scalar times MIMO @test C_111 .* C_222 == (C_111 .* I(2)) * C_222 -if version >= v"1.10.0-rc2" +if VERSION >= v"1.10.0-rc1" @inferred C_111 .* I(2) else @test_broken @inferred C_111 .* I(2) From 4b778e1b1051bf4af07a40ca7a4195555371be82 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Tue, 19 Dec 2023 10:36:58 +0100 Subject: [PATCH 04/13] plot SSE tracking error --- docs/src/examples/ilc.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/src/examples/ilc.md b/docs/src/examples/ilc.md index ea1642a3c..908959504 100644 --- a/docs/src/examples/ilc.md +++ b/docs/src/examples/ilc.md @@ -134,7 +134,8 @@ The next step is to implement the ILC scheme and run it: ```@example ilc function ilc(Gc, Q, L) a = zero(r) # ILC adjustment signal starts at 0 - fig = plot(t, vec(r), sp=1, layout=(3,1), l=(:black, 3), lab="Ref") + fig1 = plot(t, vec(r), sp=1, layout=(3,1), l=(:black, 3), lab="Ref") + fig2 = plot(title="Sum of squared error", xlabel="Iteration", legend=false, titlefontsize=10, framestyle=:zerolines, ylims=(0, 7.1)) for iter = 1:5 ra = r .+ a res = lsim(Gc, ra, t) # Simulate system, replaced by an actual experiment if running on real process @@ -143,10 +144,12 @@ function ilc(Gc, Q, L) Le = lsim_noncausal(L, e, t) a = lsim_zerophase(Q, a + Le, t) # Update ILC adjustment - plot!(res, plotu=true, sp=[1 2], title=["Output \$y(t)\$" "Adjusted reference \$r + a\$"], lab="Iter $iter", c=iter) - plot!(e[:], sp=3, title="Tracking error \$e(t)\$", lab="err: $(round(sum(abs2, e), digits=2))", c=iter) + err = sum(abs2, e) + plot!(fig1, res, plotu=true, sp=[1 2], title=["Output \$y(t)\$" "Adjusted reference \$r + a\$"], lab="Iter $iter", c=iter) + plot!(fig1, e[:], sp=3, title="Tracking error \$e(t)\$", lab="err: $(round(err, digits=2))", c=iter) + scatter!(fig2, [iter], [err]) end - fig + plot(fig1, fig2, layout=@layout([a{0.7w} b{0.3w}])) end ilc(Gc, Q, L) ``` From 6f537266f9fafada395544c02034088783f61df0 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Tue, 2 Jan 2024 06:05:30 +0100 Subject: [PATCH 05/13] document state order --- docs/src/examples/ilc.md | 4 ++-- docs/src/lib/nonlinear.md | 4 +++- docs/src/man/creating_systems.md | 11 +++++++++++ lib/ControlSystemsBase/src/connections.jl | 1 + 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/src/examples/ilc.md b/docs/src/examples/ilc.md index 908959504..ed5f4600f 100644 --- a/docs/src/examples/ilc.md +++ b/docs/src/examples/ilc.md @@ -1,5 +1,5 @@ # Iterative-Learning Control -In this example, we will design an [Iterative-Learning Control (ILC)](https://en.wikipedia.org/wiki/Iterative_learning_control) iteration scheme. ILC can be though of as a simple reinforcement-learning strategy that is suitable in situations where a *repetitive task* is to be performed multiple times, and disturbances acting on the system are also repetitive and predictable but unknown. Multiple versions of ILC exists, in this tutorial we will consider a heuristic scheme as well as a model-based scheme. +In this example, we will design an [Iterative-Learning Control (ILC)](https://en.wikipedia.org/wiki/Iterative_learning_control) iteration scheme. ILC can be thought of as a simple reinforcement-learning strategy that is suitable in situations where a *repetitive task* is to be performed multiple times, and disturbances acting on the system are also repetitive and predictable but unknown. Multiple versions of ILC exists, in this tutorial we will consider a heuristic scheme as well as a model-based scheme. ## Algorithm @@ -102,7 +102,7 @@ nothing # hide ``` ## Choosing filters -The next step is to define the ILC filters ``Q(x)`` and ``L(z)``. +The next step is to define the ILC filters ``Q(q)`` and ``L(q)``. The filter $L(q)$ acts as a frequency-dependent step size. To make the procedure take smaller steps, simply scale $L$ by a constant < 1. Scaling down $L$ makes the learning process slower but more robust. A heuristic choice of $L$ is some form of scaled lookahead, such as $0.5z^l$ where $l \geq 0$ is the number of samples lookahead. A model-based approach may use some form of inverse of the system model, which is what we will use here. [^nonlinear] diff --git a/docs/src/lib/nonlinear.md b/docs/src/lib/nonlinear.md index 6abecb356..4caaced24 100644 --- a/docs/src/lib/nonlinear.md +++ b/docs/src/lib/nonlinear.md @@ -113,7 +113,7 @@ yr = G.C*xr # Reference output Gop = offset(yr) * G * offset(-ur) # Make the plant operate in Δ-coordinates C_sat = saturation(umin, umax) * C # while the controller and the saturation operate in the original coordinates ``` -We now simulate the closed-loop system, the initial state of the plant is adjusted with the operating point `x0-xr` since the plant operates in Δ-coordinates +We now simulate the closed-loop system, the initial state of the plant is adjusted with the operating point `x0-xr` since the plant operates in Δ-coordinates ```@example nonlinear x0 = [2, 1, 8, 3] # Initial tank levels plot( @@ -123,6 +123,8 @@ plot( hline!([yr[1]], label="Reference", l=:dash, sp=1, c=1) ``` +The state vector resulting from the call to `feedback` is comprised of the concatenated states of the first and second arguments, i.e., `feedback(C_sat, Gop)` has the state vector `[C_sat.x; Gop.x]` while `feedback(Gop*C_sat)` has the state vector of `Gop*C_sat` which is starting with the first operand, `[Gop.x; C_sat.x]`. + ### Duffing oscillator In this example, we'll model and control the nonlinear system diff --git a/docs/src/man/creating_systems.md b/docs/src/man/creating_systems.md index 050d6d900..5b3b0a5fe 100644 --- a/docs/src/man/creating_systems.md +++ b/docs/src/man/creating_systems.md @@ -180,6 +180,9 @@ P1 = ss(-1,1,1,0) P2 = ss(-2,1,1,0) P2*P1 ``` + +The state of the resulting system is the concatenation of the states of the two systems, starting with the left/first operand (`P2` above). + If the input dimension of `P2` does not match the output dimension of `P1`, an error is thrown. If one of the systems is SISO and the other is MIMO, broadcasted multiplication will expand the SISO system to match the input or output dimension of the MIMO system, e.g., ```@example MIMO Pmimo = ssrand(2,2,1) @@ -194,6 +197,12 @@ using LinearAlgebra Psiso .* I(2) ``` +## Adding systems +Two systems can be connected in parallel by addition +```@example MIMO +P12 = P1 + P2 +``` +The state of the resulting system is the concatenation of the states of the two systems, starting with the left/first operand (`P1` above). ## MIMO systems and arrays of systems Concatenation of systems creates MIMO systems, which is different from an array of systems. For example @@ -267,6 +276,8 @@ This section lists a number of block diagrams, and indicates the corresponding t The function `feedback(G1, G2)` can be thought of like this: the first argument `G1` is the system that appears directly between the input and the output (the *forward path*), while the second argument `G2` (defaults to 1 if omitted) contains all other systems that appear in the closed loop (the *feedback path*). The feedback is assumed to be negative, unless the argument `pos_feedback = true` is passed (`lft` is an exception, which due to convention defaults to positive feedback). This means that `feedback(G, 1)` results in unit negative feedback, while `feedback(G, -1)` or `feedback(G, 1, pos_feedback = true)` results in unit positive feedback. +The returned closed-loop system will have a state vector comprised of the state of `G1` followed by the state of `G2`. + --- Closed-loop system from reference to output ``` diff --git a/lib/ControlSystemsBase/src/connections.jl b/lib/ControlSystemsBase/src/connections.jl index 9330f222b..75eb73d8d 100644 --- a/lib/ControlSystemsBase/src/connections.jl +++ b/lib/ControlSystemsBase/src/connections.jl @@ -288,6 +288,7 @@ end └──────────────┘ ``` If no second system `sys2` is given, negative identity feedback (`sys2 = 1`) is assumed. +The returned closed-loop system will have a state vector comprised of the state of `sys1` followed by the state of `sys2`. *Advanced use* `feedback` also supports more flexible use according to the figure below From 160423ed84f3421a189d5e9e2e5865f4266b602a Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Tue, 23 Jan 2024 13:31:33 +0100 Subject: [PATCH 06/13] add missing call to c2d in example --- lib/ControlSystemsBase/src/discrete.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ControlSystemsBase/src/discrete.jl b/lib/ControlSystemsBase/src/discrete.jl index c708a0fbc..acd938853 100644 --- a/lib/ControlSystemsBase/src/discrete.jl +++ b/lib/ControlSystemsBase/src/discrete.jl @@ -209,6 +209,7 @@ cc = sol.u[end][end] # Continuous-time cost # Discrete-time version Ts = 0.01 sysd = c2d(sysc, Ts) +Qd, Rd = c2d(sysd, Qc, Rc, opt=:c) Ld = lqr(sysd, Qd, Rd) sold = lsim(sysd, (x, t) -> -Ld*x, 0:Ts:10, x0 = x0) function cost(x, u, Q, R) From 49c81631dedad187c7c447cdd0366ac9d5dfdee2 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Tue, 23 Jan 2024 19:50:07 +0100 Subject: [PATCH 07/13] try enable CI caches --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cc48974ec..b2efc8cd5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: actions/cache@v1 + - uses: julia-actions/cache@v1 env: cache-name: cache-artifacts with: From 3ef8ebc9ec54eb84dbd703200689ceea24a8ae3b Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Fri, 26 Jan 2024 07:53:54 +0100 Subject: [PATCH 08/13] Create CONTRIBUTING.md --- CONTRIBUTING.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..168c2bbd4 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,12 @@ +Issues and PRs are welcome! + +# Issues +- Please open issues with clear descriptions of any problem or feature request. +- If the issue describes a problem or a bug, please include an example that exposes the problem. +- Please make sure that you are testing your code on the latest released version of the package before opening a bug report. +- Discussions and help requests may use [Github discussions](https://github.com/JuliaControl/ControlSystems.jl/discussions), [discourse.julialang.org](https://discourse.julialang.org/) or the JuliaLang slack channel rather than an issue on this repository. + +# Pull requests +- Please consider **opening an issue discussing your proposed changes** before submitting a PR. +- Please make **changes only related to a single concept**, and avoid fixing several different things in a single PR. **Do not run an automatic code formatter** on code that is not otherwise actively modified by the PR. +- Pull requests that add **dependencies are unlikely to be accepted** unless there is a very good motivation for the addition and the added dependency is both lightweight, stable and well maintained. Contributions that add significant new features and require additional dependencies are often better contributed in the form of a separate package. From d4638eaf6d92cbaaa489cde399a142ab0af99b8e Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Tue, 6 Feb 2024 17:53:09 +0100 Subject: [PATCH 09/13] handle rounding error in Nyquist freq for default freq vec --- lib/ControlSystemsBase/src/analysis.jl | 21 ++++++++++---------- lib/ControlSystemsBase/src/freqresp.jl | 6 +++++- lib/ControlSystemsBase/test/test_freqresp.jl | 6 +++++- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/lib/ControlSystemsBase/src/analysis.jl b/lib/ControlSystemsBase/src/analysis.jl index da43b476a..022018e32 100644 --- a/lib/ControlSystemsBase/src/analysis.jl +++ b/lib/ControlSystemsBase/src/analysis.jl @@ -410,18 +410,19 @@ See also [`delaymargin`](@ref) and [`RobustAndOptimalControl.diskmargin`](https: function margin(sys::LTISystem, w::AbstractVector{<:Real}; full=false, allMargins=false) ny, nu = size(sys) + T = float(numeric_type(sys)) if allMargins - wgm = Array{Array{numeric_type(sys),1}}(undef, ny,nu) - gm = Array{Array{numeric_type(sys),1}}(undef, ny,nu) - wpm = Array{Array{numeric_type(sys),1}}(undef, ny,nu) - pm = Array{Array{numeric_type(sys),1}}(undef, ny,nu) - fullPhase = Array{Array{numeric_type(sys),1}}(undef, ny,nu) + wgm = Array{Array{T,1}}(undef, ny,nu) + gm = Array{Array{T,1}}(undef, ny,nu) + wpm = Array{Array{T,1}}(undef, ny,nu) + pm = Array{Array{T,1}}(undef, ny,nu) + fullPhase = Array{Array{T,1}}(undef, ny,nu) else - wgm = Array{numeric_type(sys),2}(undef, ny, nu) - gm = Array{numeric_type(sys),2}(undef, ny, nu) - wpm = Array{numeric_type(sys),2}(undef, ny, nu) - pm = Array{numeric_type(sys),2}(undef, ny, nu) - fullPhase = Array{numeric_type(sys),2}(undef, ny, nu) + wgm = Array{T,2}(undef, ny, nu) + gm = Array{T,2}(undef, ny, nu) + wpm = Array{T,2}(undef, ny, nu) + pm = Array{T,2}(undef, ny, nu) + fullPhase = Array{T,2}(undef, ny, nu) end for j=1:nu for i=1:ny diff --git a/lib/ControlSystemsBase/src/freqresp.jl b/lib/ControlSystemsBase/src/freqresp.jl index ce8148e26..ffb0ad334 100644 --- a/lib/ControlSystemsBase/src/freqresp.jl +++ b/lib/ControlSystemsBase/src/freqresp.jl @@ -382,7 +382,11 @@ function _default_freq_vector(systems::Vector{<:LTISystem}, plot) w2 = maximum(maximum, bounds) nw = round(Int, max(min_pt_total, min_pt_per_dec*(w2 - w1))) - return exp10.(range(w1, stop=w2, length=nw)) + w = exp10.(range(w1, stop=w2, length=nw)) + if length(systems) == 1 && isdiscrete(systems[1]) + w[end] = π/systems[1].Ts # To account for numerical rounding problems from exp(log()) + end + w end _default_freq_vector(sys::LTISystem, plot) = _default_freq_vector( [sys], plot) diff --git a/lib/ControlSystemsBase/test/test_freqresp.jl b/lib/ControlSystemsBase/test/test_freqresp.jl index 89a385e75..358191f22 100644 --- a/lib/ControlSystemsBase/test/test_freqresp.jl +++ b/lib/ControlSystemsBase/test/test_freqresp.jl @@ -173,6 +173,9 @@ mag, mag, ws2 = bode(sys2) @test maximum(ws2) >= 5max(p,z) @test minimum(ws2) <= 0.2min(p,z) @test length(ws2) > 100 + +@test margin(tf(1, [1, -1], 0.01)).gm == [2;;] + end @@ -204,4 +207,5 @@ end # f2 = plot(sizes, last.(times1), scale=:log10, lab="Allocations freqresp", m=:o) # plot!(sizes, last.(times2), scale=:log10, lab="Allocations freqresp_large", xlabel="Model order", m=:o) -# plot(f1, f2) \ No newline at end of file +# plot(f1, f2) + From 5e2029fed71acc51022ef8062bc76f1715fb5c75 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Tue, 6 Feb 2024 19:08:03 +0100 Subject: [PATCH 10/13] Update Project.toml --- lib/ControlSystemsBase/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ControlSystemsBase/Project.toml b/lib/ControlSystemsBase/Project.toml index d2eccf449..36b1d4e10 100644 --- a/lib/ControlSystemsBase/Project.toml +++ b/lib/ControlSystemsBase/Project.toml @@ -2,7 +2,7 @@ name = "ControlSystemsBase" uuid = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e" authors = ["Dept. Automatic Control, Lund University"] repo = "https://github.com/JuliaControl/ControlSystems.jl.git" -version = "1.10.1" +version = "1.10.2" [deps] DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2" From 7748b784fc0c82a77928c6c4558bb474efe46669 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Thu, 8 Feb 2024 07:28:31 +0100 Subject: [PATCH 11/13] rm flaky codecove badge 50% of the time the badge reports the wrong number --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ce41bbe33..b05111810 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,12 @@ # ControlSystems.jl -[![Build Status](https://github.com/JuliaControl/ControlSystems.jl/workflows/CI/badge.svg)](https://github.com/JuliaControl/ControlSystems.jl/actions?query=workflow%3ACI) -[![Documentation Status](https://github.com/JuliaControl/ControlSystems.jl/workflows/Docs/badge.svg)](https://github.com/JuliaControl/ControlSystems.jl/actions?query=workflow%3ADocs) - -[![PkgEval](https://juliaci.github.io/NanosoldierReports/pkgeval_badges/C/ControlSystems.svg)](https://juliaci.github.io/NanosoldierReports/pkgeval_badges/report.html) -[![codecov](https://codecov.io/gh/JuliaControl/ControlSystems.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaControl/ControlSystems.jl) - [![](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliacontrol.github.io/ControlSystems.jl/stable) [![](https://img.shields.io/badge/docs-latest-blue.svg)](https://juliacontrol.github.io/ControlSystems.jl/dev) [![Star on GitHub](https://img.shields.io/github/stars/JuliaControl/ControlSystems.jl.svg?style=social)](https://github.com/JuliaControl/ControlSystems.jl/stargazers) +[![Build Status](https://github.com/JuliaControl/ControlSystems.jl/workflows/CI/badge.svg)](https://github.com/JuliaControl/ControlSystems.jl/actions?query=workflow%3ACI) + + A control systems design toolbox for Julia. ## Installation From 0d825400f1fd0126a4ccaa63408ba2b38351d47a Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Mon, 26 Feb 2024 17:57:41 +0100 Subject: [PATCH 12/13] add latex representation of statespace systems to establish notation --- docs/src/man/creating_systems.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/src/man/creating_systems.md b/docs/src/man/creating_systems.md index 5b3b0a5fe..c5a5b8f80 100644 --- a/docs/src/man/creating_systems.md +++ b/docs/src/man/creating_systems.md @@ -84,7 +84,21 @@ The transfer functions created using this method will be of type `TransferFuncti ## State-Space Systems -A state-space system is created using +A state-space system +```math +\begin{aligned} +\dot{x} &= Ax + Bu \\ +y &= Cx + Du +\end{aligned} +``` +in continuous time, or +```math +\begin{aligned} +x_{t+T_s} &= Ax_t + Bu_t \\ +y_t &= Cx_t + Du_t +\end{aligned} +``` +in discrete time, is created using ```julia ss(A,B,C,D) # Continuous-time system ss(A,B,C,D,Ts) # Discrete-time system From faa314942b3bf6e0175073f353f5dc6cb835d314 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Mon, 1 Apr 2024 10:52:26 +0200 Subject: [PATCH 13/13] Update compat OrdinaryDiffEq --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index d8c2918a7..138ae358c 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "ControlSystems" uuid = "a6e380b2-a6ca-5380-bf3e-84a91bcd477e" authors = ["Dept. Automatic Control, Lund University"] repo = "https://github.com/JuliaControl/ControlSystems.jl.git" -version = "1.10.1" +version = "1.10.2" [deps] ControlSystemsBase = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e" @@ -26,7 +26,7 @@ DelayDiffEq = "5.31" DiffEqCallbacks = "2.16" ForwardDiff = "0.10" Hungarian = "0.6, 0.7" -OrdinaryDiffEq = "~6.60" +OrdinaryDiffEq = "6.60" RecipesBase = "1" Reexport = "1" StaticArrays = "1"