Skip to content
Snippets Groups Projects
Commit 6c83fe04 authored by Claudio (xjobb Martina)'s avatar Claudio (xjobb Martina)
Browse files

inizio scrittura model

parent dbc882f8
Branches
Tags
No related merge requests found
......@@ -272,9 +272,9 @@ package GPS_pw_modeling
//Inputs and outputs //
///////////////////////
Modelica.Blocks.Interfaces.IntegerInput visible_satellites annotation(
Placement(visible = true, transformation(origin = {-101, 101}, extent = {{-11, -11}, {11, 11}}, rotation = 0), iconTransformation(origin = {-94, 2}, extent = {{-26, -26}, {26, 26}}, rotation = 0)));
Placement(visible = true, transformation(origin = {-101, 101}, extent = {{-11, -11}, {11, 11}}, rotation = 0), iconTransformation(origin = {-2, 102}, extent = {{-26, -26}, {26, 26}}, rotation = -90)));
Modelica.Blocks.Interfaces.BooleanInput on_signal annotation(
Placement(visible = true, transformation(origin = {-158, 92}, extent = {{-12, -12}, {12, 12}}, rotation = 0), iconTransformation(origin = {-40, 100}, extent = {{-20, -20}, {20, 20}}, rotation = -90)));
Placement(visible = true, transformation(origin = {-158, 92}, extent = {{-12, -12}, {12, 12}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput power annotation(
Placement(visible = true, transformation(origin = {54, 104}, extent = {{8, -8}, {-8, 8}}, rotation = 0), iconTransformation(origin = {95, 43}, extent = {{-25, -25}, {25, 25}}, rotation = 180)));
//not really an input signal but just the negation of the on signal, still used as an input
......@@ -338,7 +338,7 @@ package GPS_pw_modeling
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(
Placement(visible = true, transformation(origin = {162, 30}, extent = {{10, -10}, {-10, 10}}, rotation = 0), iconTransformation(origin = {95, -43}, extent = {{25, -25}, {-25, 25}}, rotation = 0)));
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(
Line(points = {{110, -8}, {110, -8}, {110, -58}, {50, -58}, {50, -48}, {50, -48}}));
......@@ -438,7 +438,7 @@ package GPS_pw_modeling
sv_ephemeris := 0;
end when;
annotation(
Icon(graphics = {Rectangle(fillColor = {115, 210, 22}, fillPattern = FillPattern.Solid, extent = {{-96, 96}, {96, -96}}), Text(origin = {-40, 70}, extent = {{-20, 8}, {20, -8}}, textString = "turn_on"), Text(origin = {-51, 7}, extent = {{-17, 9}, {91, -15}}, textString = "visible_satellites"), Text(origin = {50, 41}, extent = {{-72, 15}, {22, -9}}, textString = "power_consumption"), Text(origin = {22, -41}, extent = {{-50, 11}, {50, -11}}, textString = "position_avaialble")}),
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;
......
......@@ -81,7 +81,7 @@ for k=2:N
sv=5;
%control action
a=[a,sum(sqrt(out_data.diag_P(1:3,k-1)))];
if sum(sqrt(out_data.diag_P(1:3,k-1)))<1.0
if sum(sqrt(out_data.diag_P(1:3,k-1)))<15.0
turn=false;
else
turn=true;
......
......@@ -61,6 +61,7 @@ Politecnico di Milano, Italy%
\section{GPS receiver model}
\label{sec:gps}
\input{sections/03-model}
\section{Sensor fusion}
\label{sec:fusion}
......
aaa
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment