This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

phased.Platform

Model platform motion

Description

The phased.Platform System object™ models the translational motion of one or more platforms in space. A platform can be a target such as a vehicle or airplane, or a sonar or radar transmitter and receiver. The model assumes that the platform undergoes translational motion at constant velocity or constant acceleration during each simulation step. Positions and velocities are always defined in the global coordinate system.

To model a moving platform:

  1. Define and set up your platform using the Construction procedure.

  2. Repeatedly call the step method to move the platform along a path determined by the phased.Platform properties.

    The behavior of step is specific to each object in the toolbox.

Note

Starting in R2016b, instead of using the step method to perform the operation defined by the System object, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

Construction

sPlat = phased.Platform creates a platform System object, sPlat. The object models a stationary platform with position at the origin and velocity set to zero.

sPlat = phased.Platform(Name,Value) creates an object, sPlat, with each specified property Name set to the specified Value. You can specify additional name-value pair arguments in any order as (Name1,Value1,...,NameN,ValueN).

sPlat = phased.Platform(pos,vel,Name,Value) creates a platform object, sPlat, with InitialPosition set to pos and Velocity set to vel. Other specified property Names are set to specified Values. The pos and vel arguments are value-only. Value-only arguments do not require a specified Name but are interpreted according to their argument positions. To specify any value-only argument, specify all preceding value-only arguments.

The motion model is either a constant velocity, a constant acceleration, or a custom trajectory. You can choose one of two motion models using the MotionModel property.

MotionModel ValueUsage
'Velocity'

If you set the VelocitySource property to 'Property', the platform moves with constant velocity determined by the Velocity property. You can specify the InitialPosition property or leave it to its default value. You can change the tunable Velocity property at any simulation step.

When you set the VelocitySource property to 'Input port', you can input instantaneous velocity as an argument to the step method. Specify the initial position using the InitialPosition property or leave it as a default value.

'Acceleration'

When you set the AccelerationSource property to 'Property', the platform moves with constant acceleration determined by the Acceleration property. You can specify the InitialPosition and InitialVelocity properties or leave them to their defaults. You can change the tunable Acceleration property at any simulation step.

When you set the AccelerationSource property to 'Input port', you can input instantaneous acceleration as an argument to the step method. Specify the InitialPosition and InitialVelocity properties or leave them as their defaults.

'Custom'Specify the platform motion using a series of waypoints in the CustomTrajectory property.

Properties

MotionModel

Object motion model

Object motion model, specified as 'Velocity', 'Acceleration', or 'Custom'. When you set this property to 'Velocity', the platform follows a constant velocity trajectory during each simulation step. When you set this property to 'Acceleration', the platform follows a constant acceleration trajectory during each simulation step. When you set the property to 'Custom', the platform motion follows a sequence of waypoints specified by the CustomTrajectory property. The object performs a piecewise cubic interpolation on the waypoints to derive the position and velocity at each time step.

Default: 'Velocity'

InitialPosition

Initial position of platform

Initial position of platform, specified as a real-valued 3-by-1 column vector in the form of [x;y;z] or a real-valued 3-by-N matrix where N is the number of platforms. Each column takes the form [x;y;z]. Position units are meters.

Default: [0;0;0]

InitialVelocity

Initial velocity of platform

Initial velocity of platform, specified as a real-valued 3-by-1 column vector in the form of [vx;vy;vz] or a real-valued 3-by-N matrix where N is the number of platforms. Each column taking the form [vx;vy;vz]. Velocity units are meters per second.

This property only applies when you set the MotionModel property to 'Velocity' and the VelocitySource to 'Input port', or when you set the MotionModel property to 'Acceleration'.

Default: [0;0;0]

VelocitySource

Source of velocity data

Source of velocity data, specified as one of 'Property' or 'Input port'. When you set the value of this property to 'Property', use Velocity property to set the velocity. When you set this property to 'Input port', use an input argument of the step method to set the velocity.

This property applies when you set the MotionModel property to 'Velocity'.

Default: 'Property'

Velocity

Current velocity of platform

Specify the current velocity of the platform as a 3-by-1 real-valued column vector in the form of [vx;vy;vz] or a 3-by-N real-valued matrix for multiple platforms. Each column taking the form [vx;vy;vz]. Velocity units are meters/sec. The dimension N is the number of platforms.

This property applies when you set the MotionModel property to 'Velocity' and the VelocitySource to 'Property'. This property is tunable.

Default: [0;0;0]

AccelerationSource

Source of acceleration data

Source of acceleration data, specified as one of 'Property' or 'Input port'. When you set the value of this property to 'Property', specify the acceleration using the Acceleration property. When you set this property to 'Input port', use an input argument of the step method to set the acceleration.

This property applies when you set the MotionModel property to 'Acceleration'.

Default: 'Property'

Acceleration

Acceleration of platform

Specify the current acceleration of the platform as a real-valued 3-by-1 column vector in the form [ax;ay;az] or a real-valued 3-by-N matrix with each column taking the form [ax;ay;az]. The dimension N is the number of platforms. Acceleration units are meters/sec/sec.

This property applies when you set the MotionModel property to 'Acceleration' and AccelerationSource to 'Property'. This property is tunable.

Default: [0;0;0]

CustomTrajectory

Custom trajectory waypoints.

Custom trajectory waypoints, specified as a real-valued M-by-L matrix, or M-by-L-by-N array. M is the number of waypoints. L is either 4 or 7.

  • When L is 4, the first column indicates the times at which the platform position is measured. The 2nd through 4th columns are position measurements in x, y, and z coordinates. The velocity is derived from the position measurements.

  • When L is 7, the 5th through seventh columns in the matrix are velocity measurements in x, y, and z coordinates.

When you set the CustomTrajectory property to a three-dimensional array, the number of pages, N, represent the number of platforms. Time units are in seconds, position units are in meters, and velocity units are in meters per second.

To enable this property, set the MotionModel property to 'Custom'.

ScanMode

Mechanical scanning mode

Mechanical scan mode for platform, specified as 'None', 'Circular'', or 'Sector', where 'None' is the default. When you set the ScanMode property to 'Circular', the platform scan clockwise 360 degrees continuously in the azimuthal direction of the platform orientation axes. When you set the ScanMode property to 'Sector', the platform scans clockwise in the azimuthal direction in the platform orientation axes within a range specified by the AzimuthSpan property. When the platform scan reaches the span limits, the scan reverses direction and scans back to the other scan limit. Scanning happens within the orientation axes of the platform.

InitialScanAngle

Initial scan angle of platform

Initial scan angle of platform, specified as a 1-by-N vector where N is the number of platforms. The scanning occurs in the local coordinate system of the platform. The InitialOrientationAxes specifies the original local coordinate system. At the start of the simulation, the orientation axes specified by the InitialOrientationAxes are rotated by the angle specified in the InitialScanAngle property. The default value is zero. Units are in degrees. This property applies when you set the ScanMode property to 'Circular' or 'Sector'.

Example: [30 40]

AzimuthSpan

Azimuth span

The azimuth angle span, specified as an N-by-2 matrix where N is the number of platforms. Each row of the matrix specifies the scan range of the corresponding platform in the form [ScanAngleLowerBound ScanAngleHigherBound]. The default value is [-60 60]. Units are in degrees. To enable this property, set the ScanMode to 'Sector'.

AzimuthScanRate

Azimuth scan rate

Azimuth scan rate, specified as a 1-by-N vector where N is the number of platforms. Each entry in the vector is the azimuth scan rate for the corresponding platform. The default value is 10 degrees/second. Units are in degrees/second. To enable this property, set the ScanMode property to 'Circular' or 'Sector'.

InitialOrientationAxes

Initial orientation axes of platform

Initial orientation axes of platform, specified as a 3-by-3 real-valued orthonormal matrix for a single platform or as a 3-by-3-by-N real-valued matrix for multiple platforms. The dimension N is the number of platforms. When the orientation matrix is 3-by-3, the three columns represent the axes of the local coordinate system (xyz). When the orientation matrix is 3-by-3-by-N, for each page index, the resulting 3-by-3 matrix represents the axes of a local coordinate system.

Default: [1 0 0;0 1 0;0 0 1]

OrientationAxesOutputPort

Output orientation axes

To obtain the instantaneous orientation axes of the platform, set this property to true and use the corresponding output argument when invoking step. If you do not want to obtain the orientation axes of the platform, set this property to false.

Default: false

Methods

resetReset platform to initial position
stepOutput current position, velocity, and orientation axes of platform
Common to All System Objects
release

Allow System object property value changes

Examples

expand all

Create a platform at the origin having a velocity of (100,100,0) meters per second. Simulate the motion of the platform for two time steps, assuming the time elapsed for each step is one second. The position of the platform is updated after each step.

sPlat = phased.Platform([0; 0; 0],[100; 100; 0]);
T = 1;

At the first call to step, the position is at its initial value.

[pos,v] = step(sPlat,T);
pos
pos = 3×1

     0
     0
     0

At the second call to step, the position changes.

[pos,v] = step(sPlat,T);
pos
pos = 3×1

   100
   100
     0

Start with an airplane moving at 150 kmph in a circle of radius 10 km and descending at the same time at a rate of 20 m/sec. Compute the motion of the airplane from its instantaneous acceleration as an argument to the step method. Set the initial orientation of the platform to the identity, coinciding with the global coordinate system.

Set up the scenario

Specify the initial position and velocity of the airplane. The airplane has a ground range of 10 km and an altitude of 20 km.

range = 10000;
alt = 20000;
initPos = [cosd(60)*range;sind(60)*range;alt];
originPos = [1000,1000,0]';
originVel = [0,0,0]';
vs = 150.0;
phi = atan2d(initPos(2)-originPos(2),initPos(1)-originPos(1));
phi1 = phi + 90;
vx = vs*cosd(phi1);
vy = vs*sind(phi1);
initVel = [vx,vy,-20]';
platform = phased.Platform('MotionModel','Acceleration',...
    'AccelerationSource','Input port','InitialPosition',initPos,...
    'InitialVelocity',initVel,'OrientationAxesOutputPort',true,...
    'InitialOrientationAxes',eye(3));
relPos = initPos - originPos;
relVel = initVel - originVel;
rel2Pos = [relPos(1),relPos(2),0]';
rel2Vel = [relVel(1),relVel(2),0]';
r = sqrt(rel2Pos'*rel2Pos);
accelmag = vs^2/r;
unitvec = rel2Pos/r;
accel = -accelmag*unitvec;
T = 0.5;
N = 1000;

Compute the trajectory

Specify the acceleration of an object moving in a circle in the x-y plane. The acceleration is v^2/r towards the origin.

posmat = zeros(3,N);
r1 = zeros(N);
v = zeros(N);
for n = 1:N
    [pos,vel,oax] = platform(T,accel);
    posmat(:,n) = pos;
    vel2 = vel(1)^2 + vel(2)^2;
    v(n) = sqrt(vel2);
    relPos = pos - originPos;
    rel2Pos = [relPos(1),relPos(2),0]';
    r = sqrt(rel2Pos'*rel2Pos);
    r1(n) = r;
    accelmag = vel2/r;
    accelmag = vs^2/r;
    unitvec = rel2Pos/r;
    accel = -accelmag*unitvec;
end

Display the final orientation of the local coordinate system.

disp(oax)
   -0.3658   -0.9307   -0.0001
    0.9307   -0.3658   -0.0010
    0.0009   -0.0005    1.0000

Plot the trajectory and the origin position

posmat = posmat/1000;
figure(1)
plot3(posmat(1,:),posmat(2,:),posmat(3,:),'b.')
hold on
plot3(originPos(1)/1000,originPos(2)/1000,originPos(3)/1000,'ro')
xlabel('X (km)')
ylabel('Y (km)')
zlabel('Z (km)')
grid
hold off

This example shows

Create waypoints from parabolic motion.

x0 = 100;
y0 = -150;
z0 = 0;
vx = 5;
vy = 10;
vz = 0;
ax = 1;
ay = -1;

t = [0:2:20];
x = x0 + vx*t + ax/2*t.^2;
y = y0 + vy*t + ay/2*t.^2;
z = z0*ones(size(t));
wpts = [t.' x.' y.' z.'];

Create a platform object with motion determined using waypoints.

pltfm = phased.Platform('MotionModel','Custom','CustomTrajectory',wpts);
tstep = .5;
nsteps = 40;
X = [];

Advance the platform in time steps of one half second;.

for k = 1:nsteps
    [pos,vel] = pltfm(tstep);
    X = [X;pos'];
end
plot(x,y,'o'); hold on
plot(X(:,1),X(:,2),'.')
hold off;

More About

expand all

Extended Capabilities

Introduced in R2012a