Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

phased.Platform System object

Package: phased

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 constant velocity or constant acceleration. You can choose one of two motion models using the MotionModel property.

MotionModel PropertyUsage
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.

Properties

MotionModel

Object motion model

Object motion model, specified as one of 'Velocity' or 'Acceleration'. When you set this property to 'Velocity', the object follows a constant velocity trajectory during each simulation step. When you set this property to 'Acceleration', the object follows a constant acceleration trajectory during each simulation 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]

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

cloneCreate platform object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs from step method
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
resetReset platform to initial position
stepOutput current position, velocity, and orientation axes of platform

Orientation

A platform has an associated local coordinate system. The coordinate system is defined by three orthonormal axis vectors. The direction and magnitude of the velocity vector can change with each call to the method. When the platform undergoes curvilinear motion, the orientation of the local coordinate system axes rotates with the motion of the platform. The change of direction of the velocity vector defines a rotation matrix. The same rotation matrix is then used to rotate the local coordinate system as well. When the velocity vector maintains a constant direction, the rotation matrix is the identity matrix. The initial orientation of the local coordinate system is specified using the InitalOrientationAxes property. When you specify multiple platforms, each platform rotates independently.

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 =

     0
     0
     0

At the second call to step, the position changes.

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

   100
   100
     0

Start with an airplane moving at 150 kmh 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 orign

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

Related Examples

Introduced in R2012a

Was this topic helpful?