Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gps-modeling
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martina Maggio
gps-modeling
Commits
1fffa6f0
Commit
1fffa6f0
authored
Aug 29, 2018
by
Claudio (xjobb Martina)
Browse files
Options
Downloads
Patches
Plain Diff
modelicaExamples1
parent
3b911876
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
GPS_pw_modeling.mo
+33
-76
33 additions, 76 deletions
GPS_pw_modeling.mo
with
33 additions
and
76 deletions
GPS_pw_modeling.mo
+
33
−
76
View file @
1fffa6f0
...
@@ -29,8 +29,7 @@ package GPS_pw_modeling
...
@@ -29,8 +29,7 @@ package GPS_pw_modeling
Placement(visible = true, transformation(origin = {-167, 101}, extent = {{-11, -11}, {11, 11}}, rotation = 0), iconTransformation(origin = {-94, 2}, extent = {{-26, -26}, {26, 26}}, rotation = 0)));
Placement(visible = true, transformation(origin = {-167, 101}, extent = {{-11, -11}, {11, 11}}, rotation = 0), iconTransformation(origin = {-94, 2}, extent = {{-26, -26}, {26, 26}}, rotation = 0)));
Modelica.Blocks.Interfaces.BooleanInput on_signal annotation(
Modelica.Blocks.Interfaces.BooleanInput on_signal annotation(
Placement(visible = true, transformation(origin = {-133, 93}, extent = {{-11, -11}, {11, 11}}, rotation = 0), iconTransformation(origin = {-40, 100}, extent = {{-20, -20}, {20, 20}}, rotation = -90)));
Placement(visible = true, transformation(origin = {-133, 93}, extent = {{-11, -11}, {11, 11}}, rotation = 0), iconTransformation(origin = {-40, 100}, extent = {{-20, -20}, {20, 20}}, rotation = -90)));
Modelica.Blocks.Interfaces.BooleanOutput position_out annotation(
Modelica.Blocks.Interfaces.BooleanOutput position_out annotation( Placement(visible = true, transformation(origin = {176, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 0), iconTransformation(origin = {95, -15}, extent = {{25, -25}, {-25, 25}}, rotation = 0)));
Placement(visible = true, transformation(origin = {176, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 0), iconTransformation(origin = {95, -15}, extent = {{25, -25}, {-25, 25}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput power_consumption annotation(
Modelica.Blocks.Interfaces.RealOutput power_consumption annotation(
Placement(visible = true, transformation(origin = {-160, 84}, extent = {{-8, -8}, {8, 8}}, rotation = 0), iconTransformation(origin = {95, 41}, extent = {{-25, -25}, {25, 25}}, rotation = 180)));
Placement(visible = true, transformation(origin = {-160, 84}, extent = {{-8, -8}, {8, 8}}, rotation = 0), iconTransformation(origin = {95, 41}, extent = {{-25, -25}, {25, 25}}, rotation = 180)));
//States
//States
...
@@ -216,66 +215,24 @@ package GPS_pw_modeling
...
@@ -216,66 +215,24 @@ package GPS_pw_modeling
end GPS_pw_simulator;
end GPS_pw_simulator;
model test_GPS
model test_GPS
GPS_pw_simulator gps annotation(
GPS_pw_modeling.
GPS_pw_simulator gps annotation(
Placement(visible = true, transformation(origin = {2, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Placement(visible = true, transformation(origin = {
3
2,
-6
0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.IntegerTable visible_satellites(table = [0, 8; 100, 7; 500, 12]) annotation(
Modelica.Blocks.Sources.IntegerTable visible_satellites(table = [0, 8; 100, 7; 500, 12]) annotation(
Placement(visible = true, transformation(origin = {-72, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Placement(visible = true, transformation(origin = {-90, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.BooleanExpression turn_on(y = if time > 10 then if time < 500 then true else false else false) annotation(
Modelica.Blocks.Sources.BooleanTable general_example(table = {0, 30, 100, 120, 125, 140, 145, 170, 175, 200, 205, 2000, 2010, 2050, 2500, 3000}) annotation(
Placement(visible = true, transformation(origin = {-76, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Placement(visible = true, transformation(origin = {-90, 88}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.BooleanTable turn_on_table(table = {0, 30, 100, 120, 125, 140, 145, 170, 175, 200, 205, 2000, 2010, 2050, 2500, 3000}) annotation(
Modelica.Blocks.Sources.BooleanTable slow_and_fast(table = {20, 85, 90, 91, 100, 101, 110, 111, 120, 121, 1875, 2100}) annotation(
Placement(visible = true, transformation(origin = {-46, 64}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Placement(visible = true, transformation(origin = {-68, -12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.IntegerTable constant_number(table = [0, 8]) annotation(
Placement(visible = true, transformation(origin = {-36, -60}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
equation
connect(
turn_
on
_
ta
ble.y, gps.on_signal
) annotation(
connect(
c
on
s
ta
nt_number.y, gps.visible_satellites
) annotation(
Line(points = {{-
3
4,
64
}, {
-
2,
64
}, {
-
2,
1
0}, {
-
2,
1
0}}, color = {255,
0, 255
}));
Line(points = {{-
2
4,
-60
}, {
2
2,
-60
}, {
2
2,
-6
0}, {
2
2,
-6
0}}, color = {255,
127, 0
}));
connect(
visible_satellites.y, gps.visible_satellites
) annotation(
connect(
slow_and_fast.y, gps.on_signal
) annotation(
Line(points = {{-
60, 0
}, {
-
8,
0
}, {
-
8, 0}, {
-
8, 0}}, color = {255,
127, 0
}));
Line(points = {{-
56, -12
}, {
2
8,
-12
}, {
2
8,
-5
0}, {
2
8,
-5
0}}, color = {255,
0, 255
}));
annotation(
annotation(
experiment(StartTime = 0, StopTime = 1
0
00, Tolerance = 1e-
0
6, Interval = 0.002),
experiment(StartTime = 0, StopTime =
2
100, Tolerance = 1e-6, Interval = 0.00
4
2),
__OpenModelica_simulationFlags(lv = "LOG_STATS", s = "dassl"));
__OpenModelica_simulationFlags(lv = "LOG_STATS", s = "dassl"));
end test_GPS;
end test_GPS;
...
...
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