diff --git a/README.md b/README.md index b05111810..095a164f5 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ P = K/(s*((J*s + b)*(L*s + R) + K^2)) #Continuous-time transfer function model # Create an array of closed loop systems for different values of Kp -CLs = TransferFunction[kp*P/(1 + kp*P) for kp = [1, 5, 15]]; +CLs = [kp*P/(1 + kp*P) for kp ∈ [1, 5, 15]]; # Plot the step response of the controllers # Any keyword arguments supported in Plots.jl can be supplied diff --git a/lib/ControlSystemsBase/Project.toml b/lib/ControlSystemsBase/Project.toml index ce533754c..f7f44c303 100644 --- a/lib/ControlSystemsBase/Project.toml +++ b/lib/ControlSystemsBase/Project.toml @@ -7,8 +7,6 @@ version = "1.13.2" [deps] DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" -IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e" -LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" MatrixEquations = "99c1a7ee-ab34-5fd5-8076-27c950a045f4" @@ -18,7 +16,6 @@ PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" -SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" @@ -34,8 +31,6 @@ Aqua = "0.5" DSP = "0.6.1, 0.7, 0.8" ForwardDiff = "0.10" ImplicitDifferentiation = "0.4.2" -IterTools = "1.0" -LaTeXStrings = "1.0" LinearAlgebra = "<0.0.1, 1" MacroTools = "0.5" MatrixEquations = "1, 2.1" @@ -45,7 +40,6 @@ PrecompileTools = "1" Printf = "<0.0.1, 1" Random = "<0.0.1, 1" RecipesBase = "1" -SparseArrays = "<0.0.1, 1" StaticArraysCore = "1" UUIDs = "<0.0.1, 1" julia = "1.6" @@ -58,8 +52,9 @@ FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000" GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71" ImplicitDifferentiation = "57b37032-215b-411a-8a7c-41a003a55207" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Test", "Aqua", "ComponentArrays", "Documenter", "FiniteDifferences", "ImplicitDifferentiation", "GR", "Plots", "StaticArrays"] +test = ["Test", "Aqua", "ComponentArrays", "Documenter", "FiniteDifferences", "ImplicitDifferentiation", "GR", "Plots", "SparseArrays", "StaticArrays"] diff --git a/lib/ControlSystemsBase/src/ControlSystemsBase.jl b/lib/ControlSystemsBase/src/ControlSystemsBase.jl index 60d25b9a6..9aefb2983 100644 --- a/lib/ControlSystemsBase/src/ControlSystemsBase.jl +++ b/lib/ControlSystemsBase/src/ControlSystemsBase.jl @@ -126,8 +126,7 @@ export LTISystem, add_output -# QUESTION: are these used? LaTeXStrings, Requires, IterTools -using RecipesBase, LaTeXStrings, LinearAlgebra +using RecipesBase, LinearAlgebra import Polynomials import Polynomials: Polynomial, coeffs import Base: +, -, *, /, (==), (!=), isapprox, convert, promote_op diff --git a/lib/ControlSystemsBase/src/pid_design.jl b/lib/ControlSystemsBase/src/pid_design.jl index 2f4238cf3..0f8396dbc 100644 --- a/lib/ControlSystemsBase/src/pid_design.jl +++ b/lib/ControlSystemsBase/src/pid_design.jl @@ -251,7 +251,7 @@ function pidplots(P::LTISystem, args...; kp = kps[i] ki = kis[i] kd = kds[i] - label = latexstring("k_p = $(round(kp, digits=3)), k_i = $(round(ki, digits=3)), k_d = $(round(kd, digits=3))") + label = "\$k_p = $(round(kp, digits=3)), k_i = $(round(ki, digits=3)), k_d = $(round(kd, digits=3))\$" C = pid(kp,ki,kd,form=form) T = robust_minreal(feedback(P*C, 1)) @@ -384,7 +384,7 @@ function stabregionPID(P, ω = _default_freq_vector(P,Val{:bode}()); kd=0, form= K = convert_pidparams_from_parallel.(kp, ki, kd, form) kp, ki = getindex.(K, 1), getindex.(K, 2) fig = if doplot - RecipesBase.plot(kp,ki,linewidth = 1.5, xlabel=L"k_p", ylabel=L"k_i", title="Stability region of P, k_d = $(round(kd, digits=4))") + RecipesBase.plot(kp,ki,linewidth = 1.5, xlabel="\$k_p\$", ylabel="\$k_i\$", title="Stability region of P, k_d = $(round(kd, digits=4))") else nothing end @@ -401,7 +401,7 @@ function stabregionPID(P::Function, ω = exp10.(range(-3, stop=1, length=50)); k K = convert_pidparams_from_parallel.(kp, ki, kd, form) kp, ki = getindex.(K, 1), getindex.(K, 2) fig = if doplot - RecipesBase.plot(kp,ki,linewidth = 1.5, xlabel=L"k_p", ylabel=L"k_i", title="Stability region of P, k_d = $(round(kd, digits=4))") + RecipesBase.plot(kp,ki,linewidth = 1.5, xlabel="\$k_p\$", ylabel="\$k_i\$", title="Stability region of P, k_d = $(round(kd, digits=4))") else nothing end diff --git a/lib/ControlSystemsBase/src/plotting.jl b/lib/ControlSystemsBase/src/plotting.jl index e9207585d..6a18ddfd0 100644 --- a/lib/ControlSystemsBase/src/plotting.jl +++ b/lib/ControlSystemsBase/src/plotting.jl @@ -90,7 +90,7 @@ end # minor = minor[ind] # minorText = minorText[ind] # if length(minor) > minor_text_limit -# minorText = [" " for t in minorText]#fill!(minorText, L" ") +# minorText = [" " for t in minorText]#fill!(minorText, " ") # end # perm = sortperm([major; minor]) # return [major; minor][perm], [majorText; minorText][perm]