|
|
|
|
// CP: 65001
|
|
|
|
|
// SimulationX Version: 3.8.2.45319 x64
|
|
|
|
|
within AIDAModelica;
|
|
|
|
|
model PositionConvector "PositionConvector"
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput Latitude(
|
|
|
|
|
quantity="Mechanics.Rotation.Angle",
|
|
|
|
|
displayUnit="deg") "'input Real' as connector" annotation(Placement(
|
|
|
|
|
transformation(extent={{-20,-20},{20,20}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={-50,-100},
|
|
|
|
|
extent={{-20,-20},{20,20}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput Longitude(
|
|
|
|
|
quantity="Mechanics.Rotation.Angle",
|
|
|
|
|
displayUnit="deg") "'input Real' as connector" annotation(Placement(
|
|
|
|
|
transformation(extent={{-20,-20},{20,20}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={50,-100},
|
|
|
|
|
extent={{-20,-20},{20,20}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealOutput XCoordinate(
|
|
|
|
|
quantity="Mechanics.Translation.Displace",
|
|
|
|
|
displayUnit="m") "'output Real' as connector" annotation(Placement(
|
|
|
|
|
transformation(extent={{-10,-10},{10,10}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={-50,100},
|
|
|
|
|
extent={{-10,-10},{10,10}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealOutput YCoordinate(
|
|
|
|
|
quantity="Mechanics.Translation.Displace",
|
|
|
|
|
displayUnit="m") "'output Real' as connector" annotation(Placement(
|
|
|
|
|
transformation(extent={{-10,-10},{10,10}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={50,100},
|
|
|
|
|
extent={{-10,-10},{10,10}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
parameter Real a(
|
|
|
|
|
quantity="Basics.Length",
|
|
|
|
|
displayUnit="m")=6378137 "Radius semi-major axis";
|
|
|
|
|
parameter Real e2=0.00669437999 "First numerical eccentricity of the elipsoid";
|
|
|
|
|
parameter Real pi=3.14159265359 "Parameter pi";
|
|
|
|
|
Real Lat(
|
|
|
|
|
quantity="Mechanics.Rotation.Angle",
|
|
|
|
|
displayUnit="rad") "Latitude";
|
|
|
|
|
Real Lon(
|
|
|
|
|
quantity="Mechanics.Rotation.Angle",
|
|
|
|
|
displayUnit="rad") "Longitude";
|
|
|
|
|
Real R(
|
|
|
|
|
quantity="Basics.Length",
|
|
|
|
|
displayUnit="m") "The prime vertical radius of curvature";
|
|
|
|
|
parameter Real h=0 "Height above the elipsoide";
|
|
|
|
|
equation
|
|
|
|
|
// enter your equations here
|
|
|
|
|
Lat = Latitude*(pi/180);
|
|
|
|
|
Lon = Longitude*(pi/180);
|
|
|
|
|
R = a/sqrt(1-e2*((1-cos(2*Lat))/2));
|
|
|
|
|
XCoordinate = (R+h)*cos(Lat)*cos(Lon);
|
|
|
|
|
YCoordinate = -1*((R+h)*cos(Lat)*sin(Lon));
|
|
|
|
|
annotation(Icon(graphics={
|
|
|
|
|
Rectangle(
|
|
|
|
|
fillColor={255,255,255},
|
|
|
|
|
fillPattern=FillPattern.Solid,
|
|
|
|
|
extent={{-100,100},{100,-100}})}));
|
|
|
|
|
end PositionConvector;
|