Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Martin Heyden
LabProcesses.jl
Commits
74386a8a
Commit
74386a8a
authored
Aug 20, 2017
by
Fredrik Bagge Carlson
Browse files
Add default sample time BallAndBeam
parent
dac13f1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/LabProcesses.jl
View file @
74386a8a
...
@@ -37,15 +37,17 @@ finalize(p::AbstractProcess) = error("Function not implemented for $(typeof(p
...
@@ -37,15 +37,17 @@ finalize(p::AbstractProcess) = error("Function not implemented for $(typeof(p
struct
BallAndBeam
<:
PhysicalProcess
struct
BallAndBeam
<:
PhysicalProcess
h
::
Float64
h
::
Float64
end
end
BallAndBeam
()
=
BallAndBeam
(
0.01
)
struct
BallAndBeamSimulator
<:
SimulatedProcess
struct
BallAndBeamSimulator
<:
SimulatedProcess
h
::
Float64
h
::
Float64
end
end
BallAndBeamSimulator
()
=
BallAndBeamSimulator
(
0.01
)
const
BallAndBeamType
=
Union
{
BallAndBeam
,
BallAndBeamSimulator
}
const
BallAndBeamType
=
Union
{
BallAndBeam
,
BallAndBeamSimulator
}
num_outputs
(
p
::
BallAndBeamType
)
=
2
num_outputs
(
p
::
BallAndBeamType
)
=
2
num_inputs
(
p
::
BallAndBeamType
)
=
1
num_inputs
(
p
::
BallAndBeamType
)
=
1
outputrange
(
p
::
BallAndBeamType
)
=
[(
-
10
,
10
),(
-
1
,
1
)]
# Beam angle, Ball position
outputrange
(
p
::
BallAndBeamType
)
=
[(
-
10
,
10
),(
-
1
,
1
)]
# Beam angle, Ball position
inputrange
(
p
::
BallAndBeamType
)
=
[(
-
10
,
10
)]
inputrange
(
p
::
BallAndBeamType
)
=
[(
-
10
,
10
)]
isstable
(
p
::
BallAndBeamType
)
=
false
isstable
(
p
::
BallAndBeamType
)
=
false
sampletime
(
p
::
BallAndBeamType
)
=
p
.
h
sampletime
(
p
::
BallAndBeamType
)
=
p
.
h
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment