Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
BallAndBeam.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
processes
BallAndBeam.jl
Commits
b5a56bf0
Commit
b5a56bf0
authored
6 years ago
by
Tommi Nylander
Browse files
Options
Downloads
Plain Diff
Merge branch 'freqrespfix' into 'master'
fixed freqresp to new controlsystems version See merge request
!1
parents
f73b559f
73b5daef
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1
fixed freqresp to new controlsystems version
Pipeline
#636
canceled
6 years ago
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/BallAndBeam.jl
+1
-1
1 addition, 1 deletion
src/BallAndBeam.jl
test/runtests.jl
+5
-5
5 additions, 5 deletions
test/runtests.jl
with
6 additions
and
6 deletions
src/BallAndBeam.jl
+
1
−
1
View file @
b5a56bf0
...
...
@@ -173,7 +173,7 @@ function fbdesign(G::AbstractMatrix, polevect, zerovect, gain)
ω
=
Float64
.
(
G
[
:
,
1
])
pzv
=
isempty
(
zerovect
)
?
1
:
prod
(
abs
.
(
zerovect
))
sysFB
=
ss
(
zpk
(
zerovect
,
polevect
,
gain
*
prod
(
abs
.
(
polevect
))
/
pzv
))
C
=
Number
[
ω
freqresp
(
sysFB
,
ω
)
[
1
][
:
]
]
C
=
Number
[
ω
freqresp
(
sysFB
,
ω
)]
L
=
Number
[
ω
G
[
:
,
2
]
.*
C
[
:
,
2
]]
T
=
Number
[
ω
L
[
:
,
2
]
./
(
1
+
L
[
:
,
2
])]
sysFB
,
L
,
T
,
C
...
...
This diff is collapsed.
Click to expand it.
test/runtests.jl
+
5
−
5
View file @
b5a56bf0
...
...
@@ -49,9 +49,9 @@ w1_100 = logspace(-1,log10(300),500)
G1
=
fra
(
P
,
w1_100
,
amplitude
=
1
,
nbr_of_periods
=
nbr_of_periods
,
settling_time
=
settling_time
)
true_resp
=
freqresp
(
P
.
s
.
sys
,
w1_100
)
@test
sum
(
abs
,
log
.
(
abs
.
(
G1
[
:
,
2
]))
-
log
.
(
abs
.
(
true_resp
[
1
][
:
]
)))
<
3.2
# Some numerical errors expected
@test
sum
(
abs
,
log
.
(
abs
.
(
G1
[
:
,
2
]))
-
log
.
(
abs
.
(
true_resp
)))
<
3.2
# Some numerical errors expected
phase_id
=
angle
.
(
G1
[
:
,
2
])
|>
ControlSystems
.
unwrap
phase_true
=
angle
.
(
true_resp
[
1
][
:
]
)
|>
ControlSystems
.
unwrap
phase_true
=
angle
.
(
true_resp
)
|>
ControlSystems
.
unwrap
@test
sum
(
abs
,
(
phase_id
-
phase_true
)[
1
:
400
])
<
0.065
@test
sum
(
abs
,
(
phase_id
-
phase_true
)[
400
:
end
])
<
5.3
# Some numerical errors for high freqs
...
...
@@ -75,11 +75,11 @@ arxtf,_ = arx(h, y[:], u, na, nb; λ = 0)
w1_100
=
logspace
(
-
1
,
log10
(
100
),
500
)
true_resp
=
freqresp
(
P
.
s
.
sys
,
w1_100
)
phase_true
=
angle
.
(
true_resp
[
1
][
:
]
)
|>
ControlSystems
.
unwrap
phase_true
=
angle
.
(
true_resp
)
|>
ControlSystems
.
unwrap
arx_resp
=
freqresp
(
arxtf
,
w1_100
)
@test
sum
(
abs
,
log
.
(
abs
.
(
arx_resp
[
1
][
:
]
))
-
log
.
(
abs
.
(
true_resp
[
1
][
:
]
)))
<
1.25
@test
sum
(
abs
,
log
.
(
abs
.
(
arx_resp
))
-
log
.
(
abs
.
(
true_resp
)))
<
1.25
phase_id
=
angle
.
(
arx_resp
[
1
][
:
]
)
|>
ControlSystems
.
unwrap
phase_id
=
angle
.
(
arx_resp
)
|>
ControlSystems
.
unwrap
@test
sum
(
abs
,
(
phase_id
-
phase_true
)[
1
:
400
])
<
21
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment