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
Martina Maggio
gps-modeling
Commits
1d57c473
Commit
1d57c473
authored
Feb 25, 2019
by
Claudio Mandrioli
Browse files
fixed modelica code to have same experiments ready to run as in the paper
parent
3b52d976
Changes
1
Hide whitespace changes
Inline
Side-by-side
GPS_pw_modeling.mo
100644 → 100755
View file @
1d57c473
package
GPS_pw_modeling
model
GPS_pw_simulator_old
//
prima
versione
-
obsoleta
//
//
prima
versione
-
obsoleta
//
//
parameters
parameter
Integer
required_satellites
=
4
;
//
number
of
satellites
required
for
sufficient
accuracy
...
...
@@ -223,26 +223,24 @@ package GPS_pw_modeling
__OpenModelica_simulationFlags
(
lv
=
"LOG_STATS"
,
s
=
"dassl"
));
end
GPS_pw_simulator_old
;
model
test_GPS
GPS_pw_modeling
.
GPS_pw_simulator
GPS_pw_simulator1
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{
70
,
-
30
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Sources
.
BooleanTable
c
on
st_on
(
table
=
{
5
,
71
,
8
0
,
8
1
,
9
0
,
9
1
,
1
00
,
10
1
,
1
1
0
,
1
1
1
,
1
2
0
,
2
61
,
2
70
,
2
71
,
2
80
,
281
,
290
,
291
})
annotation
(
Modelica
.
Blocks
.
Sources
.
BooleanTable
on
Command_TTFFandEphemerisExpirationExperiment
(
table
=
{
5
,
71
,
9
0
,
9
1
,
11
0
,
11
1
,
1
30
,
131
,
150
,
151
,
1840
,
184
1
,
1
85
0
,
1
85
1
,
1
86
0
,
18
61
,
18
70
,
18
71
,
18
80
,
1881
,
1890
,
1891
,
1900
,
1975
,
1985
,
1986
,
1995
,
1996
})
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{-
10
,
-
30
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Sources
.
IntegerConstant
stellites_constant
(
k
=
5
)
annotation
(
Modelica
.
Blocks
.
Sources
.
IntegerConstant
stellites_TTFFandEphemerisExpirationExperiment
(
k
=
5
)
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{-
10
,
10
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Sources
.
IntegerTable
satellites_visibilityLossExperiment
(
table
=
[
0
,
5
;
100
,
3
;
200
,
4
])
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{-
10
,
90
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Sources
.
BooleanTable
slow_and_fas
t
(
table
=
{
10
,
7
0
,
90
,
9
1
,
11
0
,
11
1
,
13
0
,
13
1
,
1
50
,
151
,
1840
,
1841
,
1850
,
1851
,
1860
,
1861
,
1870
,
1871
,
1880
,
1881
,
1890
,
1891
,
190
0
,
19
71
,
19
80
,
19
81
,
1990
,
1991
,
200
0
,
2
00
1
})
annotation
(
Modelica
.
Blocks
.
Sources
.
BooleanTable
onCommand_visibilityLossExperimen
t
(
table
=
{
5
,
71
,
8
0
,
8
1
,
9
0
,
9
1
,
1
00
,
101
,
110
,
111
,
120
,
261
,
27
0
,
2
71
,
2
80
,
2
81
,
29
0
,
2
9
1
})
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{-
10
,
50
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Sources
.
IntegerTable
satellites
(
table
=[
0
,
5
;
100
,
3
;
200
,
4
])
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{-
10
,
10
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
equation
connect
(
GPS_pw_simulator1
.
visible_satellites
,
satellites
.
y
)
annotation
(
Line
(
points
=
{{
70
,
-
2
0
},
{
70
,
-
2
0
},
{
70
,
1
0
},
{
2
,
10
},
{
2
,
1
0
}},
color
=
{
255
,
127
,
0
}));
connect
(
const_on
.
y
,
GPS_pw_simulator1
.
on_signal
)
annotation
(
Line
(
points
=
{{
2
,
-
30
},
{
58
,
-
30
},
{
58
,
-
30
},
{
60
,
-
3
0
}},
color
=
{
255
,
0
,
255
}));
connect
(
satellites_visibilityLossExperiment
.
y
,
GPS_pw_simulator1
.
visible_satellites
)
annotation
(
Line
(
points
=
{{
2
,
9
0
},
{
70
,
9
0
},
{
70
,
-
2
0
},
{
70
,
-
2
0
}},
color
=
{
255
,
127
,
0
}));
connect
(
GPS_pw_simulator1
.
on_signal
,
onCommand_visibilityLossExperiment
.
y
)
annotation
(
Line
(
points
=
{{
60
,
-
30
},
{
30
,
-
30
},
{
30
,
50
},
{
2
,
50
},
{
2
,
5
0
}},
color
=
{
255
,
0
,
255
}));
annotation
(
experiment
(
StartTime
=
0
,
StopTime
=
2000
,
Tolerance
=
1e-6
,
Interval
=
0.0006
),
experiment
(
StartTime
=
0
,
StopTime
=
2000
,
Tolerance
=
1e-
0
6
,
Interval
=
0.0006
),
__OpenModelica_simulationFlags
(
lv
=
"LOG_STATS"
,
s
=
"dassl"
));
end
test_GPS
;
...
...
@@ -251,8 +249,6 @@ package GPS_pw_modeling
model
GPS_pw_simulator
//
not
modeled
hot
start
/////////////////
...
...
@@ -337,7 +333,7 @@ package GPS_pw_modeling
Placement
(
visible
=
true
,
transformation
(
origin
=
{-
4
,
18
},
extent
=
{{
10
,
-
10
},
{-
10
,
10
}},
rotation
=
0
)));
Modelica
.
StateGraph
.
Transition
lose_visibility2
(
condition
=
sv_freq_phase
<
required_satellites
)
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{
110
,
-
6
},
extent
=
{{
10
,
-
10
},
{-
10
,
10
}},
rotation
=
90
)));
Modelica
.
Blocks
.
Interfaces
.
BooleanOutput
position
annotation
(
Modelica
.
Blocks
.
Interfaces
.
BooleanOutput
position
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{
162
,
30
},
extent
=
{{
10
,
-
10
},
{-
10
,
10
}},
rotation
=
0
),
iconTransformation
(
origin
=
{
95
,
-
27
},
extent
=
{{
25
,
-
25
},
{-
25
,
25
}},
rotation
=
0
)));
equation
connect
(
lose_visibility2
.
outPort
,
warm_start
.
inPort
[
2
])
annotation
(
...
...
@@ -441,10 +437,6 @@ package GPS_pw_modeling
Icon
(
graphics
=
{
Rectangle
(
fillColor
=
{
115
,
210
,
22
},
fillPattern
=
FillPattern
.
Solid
,
extent
=
{{-
96
,
96
},
{
96
,
-
96
}}),
Text
(
origin
=
{-
54
,
2
},
extent
=
{{-
20
,
8
},
{
20
,
-
8
}},
textString
=
"turn_on"
),
Text
(
origin
=
{-
45
,
73
},
extent
=
{{-
17
,
9
},
{
91
,
-
15
}},
textString
=
"visible_satellites"
),
Text
(
origin
=
{
44
,
41
},
extent
=
{{-
72
,
15
},
{
22
,
-
9
}},
textString
=
"power_consumption"
),
Text
(
origin
=
{
20
,
-
27
},
extent
=
{{-
50
,
11
},
{
50
,
-
11
}},
textString
=
"position_avaialble"
),
Text
(
origin
=
{
11
,
-
80
},
extent
=
{{-
97
,
32
},
{
79
,
-
24
}},
textString
=
"GPS device"
)},
coordinateSystem
(
initialScale
=
0.1
)),
experiment
(
StartTime
=
0
,
StopTime
=
400
,
Tolerance
=
1e-6
,
Interval
=
0.0008
));
end
GPS_pw_simulator
;
annotation
(
uses
(
Modelica
(
version
=
"3.2.1"
)));
end
GPS_pw_modeling
;
\ No newline at end of file
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